rrdtool problem... creating graphs.

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

Moderators: Developers, Moderators

Post Reply
Alex-A11
Posts: 5
Joined: Thu Nov 20, 2003 7:40 pm

rrdtool problem... creating graphs.

Post by Alex-A11 »

Hi, I've recently installed cacti and got it working fine, the PHP, MySQL side and SNMP side is working perfectly... Well, i think i've done alright, its a bit different from Linux :P (though i wish it was a linux install). ANYWAY!

Back to my problem...

Warning: popen(c:/rrdtool/rrdtool.exe graph - --imgformat=PNG --start=-86400 --title="Foundry - Traffic - ethernet2/15" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label="bits per second" DEF:a="c\:/inetpub/wwwroot/cacti/rra/foundry_traffic_in_173.rrd":traffic_in:AVERAGE DEF:b="c\:/inetpub/wwwroot/cacti/rra/foundry_traffic_in_173.rrd":traffic_out:AVERAGE CDEF:cdefa=a,8,* CDEF:cdefe=b,8,* AREA:cdefa#00CF00:"Inbound" GPRINT:cdefa:LAST:" Current\:%8.2lf %s" GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" LINE1:cdefe#002A97:"Outbound" GPRINT:cdefe:LAST:"Current\:%8.2lf %s" GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s" 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


Im getting this error... Not sure why, rrdtool is there, and the DocumentRoot is set correctly.

If you can help me, I'd be much appreciated...

Alex.
rex
Posts: 7
Joined: Mon Nov 17, 2003 5:12 pm
Location: US/California/Bay Area

Re: rrdtool problem... creating graphs.

Post by rex »

Alex-A11 wrote:Hi, I've recently installed cacti and got it working fine, the PHP, MySQL side and SNMP side is working perfectly... Well, i think i've done alright, its a bit different from Linux :P (though i wish it was a linux install). ANYWAY!

Back to my problem...

Warning: popen(c:/rrdtool/rrdtool.exe graph - --imgformat=PNG --start=-86400 --title="Foundry - Traffic - ethernet2/15" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label="bits per second" DEF:a="c\:/inetpub/wwwroot/cacti/rra/foundry_traffic_in_173.rrd":traffic_in:AVERAGE DEF:b="c\:/inetpub/wwwroot/cacti/rra/foundry_traffic_in_173.rrd":traffic_out:AVERAGE CDEF:cdefa=a,8,* CDEF:cdefe=b,8,* AREA:cdefa#00CF00:"Inbound" GPRINT:cdefa:LAST:" Current\:%8.2lf %s" GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" LINE1:cdefe#002A97:"Outbound" GPRINT:cdefe:LAST:"Current\:%8.2lf %s" GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s" 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


Im getting this error... Not sure why, rrdtool is there, and the DocumentRoot is set correctly.

If you can help me, I'd be much appreciated...

Alex.
Check to make sure that the user that php is running as has rights to run cmd.exe in %windir%\system32. This will most likely be the IWAM_<hostname>. Under Windows2003/IIS6 "NETWORK SERVICE" might need rights to cmd.exe. You can see what user php is running as by looking at the properties of the web site in IIS Manager. Look at the Home Directory tab. There should be a drop down for Application Pool near the bottom. Unless you have changed this it will probably be DefaultAppPool. To see what user this application pool runs as look at the properties of the application pool in the Applications Pools tree of the IIS Manager. If you look at the properties of the application pool (mostly likely DefaultAppPool) and click the Identity tab you will see the user the pool is running as.

I think that if you are running the ISAPI version of PHP (having .php files run by php4isapi.dll). If this is the case you may want to try running cgi style with DRIVE:\PATH\TO\PHP.EXE running .php files. If you are running IIS6 you will need to add this as an allowed Web Service Extension (add an allowed Web Service Extension of something like this
'c:\php\php.exe "%s" %s' and change the script mappings for you site so that .php is run by something like 'c:\php\php.exe "%s% %s').

Hope this helps!
Alex-A11
Posts: 5
Joined: Thu Nov 20, 2003 7:40 pm

Post by Alex-A11 »

Thanks for the speedy response, i hope i get another!

I've still got the same error. We've tried adding the bits you mentioned, we're running IIS5 with ISAPI PHP (apparently).

Anything else i can try before i buy my nylon rope? :)
rex
Posts: 7
Joined: Mon Nov 17, 2003 5:12 pm
Location: US/California/Bay Area

Post by rex »

Alex-A11 wrote:Thanks for the speedy response, i hope i get another!

I've still got the same error. We've tried adding the bits you mentioned, we're running IIS5 with ISAPI PHP (apparently).

Anything else i can try before i buy my nylon rope? :)
You may want to try enabling audit logging on cmd.exe just to make sure that a lack or rights isn't the problem. I still haven't been able to make cacti work with IIS6 with ISAPI PHP, so trying non-ISAPI might do the trick. Let me ponder this one over a bit more and I'll post a followup if anything pops into my head.
Alex-A11
Posts: 5
Joined: Thu Nov 20, 2003 7:40 pm

GAH!

Post by Alex-A11 »

Warning: popen(c:\rrdtool\rrdtool.exe graph - --imgformat=PNG --start=-86400 --title="Cisco 3640 - Traffic - Fa3/0" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label="bits per second" DEF:a="c\:\inetpub\wwwroot\cacti/rra/cisco_3640_traffic_in_202.rrd":traffic_in:AVERAGE DEF:b="c\:\inetpub\wwwroot\cacti/rra/cisco_3640_traffic_in_202.rrd":traffic_out:AVERAGE CDEF:cdefa=a,8,* CDEF:cdefe=b,8,* AREA:cdefa#00CF00:"Inbound" GPRINT:cdefa:LAST:" Current\:%8.2lf %s" GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" LINE1:cdefe#002A97:"Outbound" GPRINT:cdefe:LAST:"Current\:%8.2lf %s" GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s" 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


Still got a problem, I've been trying to swap things around, and change various bits, but to no avail. If you've got any ideas, ANYONE! Even stupid ones could help... Rax, any suggestions would be appreciated...

Thanks again guys,

Alex
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

If you've got any ideas, ANYONE! Even stupid ones could help...
First idea - run all this long rrdtool command line by yourself, i.e. open cmd.exe box and run it with output redirection to some file with .png extension. Watch any error messages and try to open generated file in your browser. If it works then it's for sure permission problem (like rex suggested above).

Another one - look in IIS log file... maybe there is some more info about unsuccesfull attempts of running rrdtool.

- Piotr
AndyHodge

Post by AndyHodge »

I get the same problem and it appears to be the final few charaters on the long string ie. the ,rb .

if I remove these and then run the code on command line with a redirect to file ( > test.png ) then the image gets created

If I leave the ,rb in then I get the following error CANNOT PARSE

looked in the rdd.php and can kind of see where this is coming from but dont understand how its working......
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

You can't use ",rb" on command line because it is just a second parameter of popen() function (describes the mode you are opening file).

- Piotr
Guest

Post by Guest »

AndyHodge wrote:I get the same problem and it appears to be the final few charaters on the long string ie. the ,rb .

if I remove these and then run the code on command line with a redirect to file ( > test.png ) then the image gets created

If I leave the ,rb in then I get the following error CANNOT PARSE

looked in the rdd.php and can kind of see where this is coming from but dont understand how its working......
I suspect the problem is opening cmd.exe through IIS.

Check the permissions on cmd.exe in windows\system32, verify the anonymous accounts IIS uses (iusr_machinename, iwam_machinename) have execute rights to it.

If that does not resolve the problem, try changing the anonymous user account to a local user account in the directory security settings of IIS, or disable anonymous access and log in with an NT user account.
Andy Hodge

Graphs

Post by Andy Hodge »

changing the group the inet usr and iwam to the administrators group makes the graphs work so definately a permissions problem....

just changing the cmd.exe permissions didnt seem to work....

need to go and tighten this up but looks like cacti is working except for the bug regarding windows machines thats in the other threads....

didnt take too long to get working (about 5 hours in total) :D
Guest

Post by Guest »

Hi,

Just incase anyone is still having problems with this - you should also make sure that on the perms for cmd.exe that you remove the "DENY" perms on For "Web Anonymous Users" and "Web Application Users"

Cheers
User avatar
dieter
Cacti User
Posts: 164
Joined: Fri Feb 20, 2004 3:08 pm

Post by dieter »

woow, a whole thread on this and I have been spending a whole afternoon on this yesterday. :x

If you give an administrator account it works. I figured that out. I also figured out that you have to make a web service extension for PHP to run. (only IIS 6, not for 5)

Can someone tell me how you assign rights for execution to cmd.exe for IUSR_? If I open the active directory management console and click properties I cannot specify it. I don't know a lot about active directory and stuff. I tried assigning rights to rrdtool.exe with NTFS but didn't work. I forgot to do cmd.exe so maybe this will work? Well, gonna try it monday.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest