Just what perms are required?

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

cb6040

Just what perms are required?

Post by cb6040 »

I'm setting up cacti/php/mysql/rrdtool/IIS on a Windows 2000 server in an AD environment - I've got it all going aside from actually being able to run rrdtool - I get this error:


Warning: popen(c:\\rrdtool\\rrdtool.exe graph - --imgformat=PNG --start=-86400 --title="EXCH Interface" --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label="" 2>&1,rb): No error in C:\inetpub\wwwroot\cacti\include\rrd_functions.php on line 58



Warning: fgets(): supplied argument is not a valid stream resource in C:\inetpub\wwwroot\cacti\include\rrd_functions.php on line 72

I've seen some people say that you have to give cmd.exe certain permissions - but HOW? internet guest account? I see IUSR* and IWAM* accounts as builtin by Windows - is this what i'm looking for?

Someone please point out what permissions are truly required, as it's already risky to be haphazardly assigning this stuff to cmd.exe ..

thanks!
Guest

Post by Guest »

Sigh, seems like everything works aside from the graphs .. so close :)

someone, please help. documentation isn't doing me any good here
Guest

Post by Guest »

aagh! i just did it as an admdin from the cmdline, so it's GOT to be permissions! someone, anyone :)

who want to win an ecookie!
Guest

Post by Guest »

I'm replying to my own article to bump it to the top - I see people have gone through this problem, but no one has posted the actual solution, only mentioning what they've done.

I've got IIS lockdown on this server if that changes anything, both IUSR* accts (I had two, both with random looking generated names) have read/execute perms on cmd.exe - someone please help...
brundle
Posts: 6
Joined: Fri May 09, 2003 1:25 pm
Location: Portland, OR USA
Contact:

Post by brundle »

I was able to solve this issue by giving the web user execute perms on cmd.exe in c:\winnt\system32.

I didn't like giving the anonymous web server user those perms so I created a new user, gave it perms to cmd.exe and run the cacti app in iis under that user.

Did I make sense?
-b
infuseweb
Posts: 35
Joined: Wed Oct 29, 2003 5:30 pm

Post by infuseweb »

It definitely has something to do with it. I tried that, and my graphs page just churned and churned, rather than spitting broken images like usual. I'm running PHP in ISAPI mode, not CGI, so that might have something to do with why mine didn't work and yours did.

But why is Cacti using CMD.EXE?
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Cacti uses cmd.exe because it runs all the scripts (in cmd.php) using shell exec (backticks execution operator).
You may try with FastCGI instead of ISAPI as described here: http://php.weblogs.com/fastcgi_with_php_and_iis

- bulek
brundle
Posts: 6
Joined: Fri May 09, 2003 1:25 pm
Location: Portland, OR USA
Contact:

Post by brundle »

Yeah, I've had some of the churning problems as well. You can usually tell it's working though by going to the Graph Management section, then turning on the Graph Debug Mode for a single graph - you should see the one graph display properly.
-b
infuseweb
Posts: 35
Joined: Wed Oct 29, 2003 5:30 pm

Post by infuseweb »

I looked at trying to go back to the CGI PHP implementation, after I went away from it to use the ISAPI version as recommended in the instructions. Could never get the CGI version to do SNMP correctly with that version, though. I might have to try the FastCGI way. ISAPI is definitely noticeably slower.

But how do you safely work around the CMD.EXE issue? Like brundle said, he didn't feel comfortable running it as IUSR, and neither do I, especially given what can be done with CMD.EXE. I have to imagine there's some other way to do this without having to use CMD.EXE, no?
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

AFAIK you need to run shell (cmd.exe in this case) to do some scripting and IO redirection. For example such custom script like:

type c:\apache\logs\access.log | wc -l

needs shell interpretation of "|" symbol to make pipe between processes. Such feature is of course not required in all cases but it makes custom scripting in cacti much more flexible.

- bulek
infuseweb
Posts: 35
Joined: Wed Oct 29, 2003 5:30 pm

Post by infuseweb »

Thanks, but might not do me much good since I'm running IIS6.

It's frustrating as my export graphs work and the cmd.php seems to execute properly. The sticky in the Win32 section says there's an issue with PHP and graphing, which could be the reason I'm having this problem. But no one here seems to have gotten internal Cacti graphing to work as advertised (or at least can't explain what they did in an IIS environment).
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

infuseweb wrote:Thanks, but might not do me much good since I'm running IIS6.

This was just an example of script with output pipelining to show you why cmd.exe is used by cacti... notthing to do with apache or IIS.
infuseweb wrote:But no one here seems to have gotten internal Cacti graphing to work as advertised (or at least can't explain what they did in an IIS environment).
I can see quite a lot of hints in sticky post. There are some info on IIS turning into CGI mode, the same for Apache. Last post even suggests FastCGI on IIS which may be the best option for you. Main problem here is PHP 4.3.x line which has unresolved bug (btw, has anybody tried recent 4.3.4 version?). I am using PHP 4.2.3 on Windows without any problem for months.

- bulek
Phil

Post by Phil »

(btw, has anybody tried recent 4.3.4 version?). I am using PHP 4.2.3 on Windows without any problem for months.
Yep (PHP 4.3.4RC2), doesn't fix the issue with graph rendering, but i haven't noticed any other problems.
infuseweb
Posts: 35
Joined: Wed Oct 29, 2003 5:30 pm

Post by infuseweb »

Thanks. Well, guess I'll try the CGI implementation and see what happens :(
infuseweb
Posts: 35
Joined: Wed Oct 29, 2003 5:30 pm

Post by infuseweb »

Well, no dice, even in CGI mode. FastCGI support is included with 4.3.x versions of PHP, and even with that on, graphs are still broken. Sigh. Guess I'll have to wait until someone gets this fixed.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests