/var/www/html/graph_image.php' not found or unable to stat,

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
todd.seidenberg
Posts: 10
Joined: Tue Jun 17, 2008 8:58 am

/var/www/html/graph_image.php' not found or unable to stat,

Post by todd.seidenberg »

Folks,

I'm sure this is a simple issue, but I'm not sure where to look, so I'm asking for some help.

I've got Cacti running nicely. I've got Nagios running nicely. I even have NPC running nicely. However, when I try to click on a graph from within NPC, I get the following error in my /var/log/httpd/error.log:

Code: Select all

/var/www/html/graph_image.php' not found or unable to stat
Now, I know that the graph_image.php file is in the cacti directory - and I have a /var/www/html/cacti/graph_image.php file in place. But for some reason, my NPC setup is looking for everything in /var/www/html, instead of /var/www/html/cacti.

Any thoughts on this? What setting to I need to change to make NPC look in the correct directory?

- Thanks,

Todd
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

By the looks of it, it has hard coded '/graph_image.php' in quite a few files. Changing that should solve your problem:

js/src/monitoring/services/serviceDetail.js
js/src/monitoring/services/services.js
js/src/monitoring/hosts/hosts.js
js/src/monitoring/hosts/hostDetail.js
js/src/npc.js
js/npc-all-min.js

Long term fix would have to be done by the plugin developer....
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
todd.seidenberg
Posts: 10
Joined: Tue Jun 17, 2008 8:58 am

Post by todd.seidenberg »

I went ahead, and changed the reference in all of those files from '/graph_image.php' to 'cacti/graph_image.php'


but I still get the following in my error log:

Code: Select all

script '/var/www/html/graph_image.php' not found or unable to stat, referer: http://skeeter/cacti/plugins/npc/npc.php?module=layoutDev&action=drawLayout
Is there somewhere else that I need to make the change?

Linegod wrote:By the looks of it, it has hard coded '/graph_image.php' in quite a few files. Changing that should solve your problem:

js/src/monitoring/services/serviceDetail.js
js/src/monitoring/services/services.js
js/src/monitoring/hosts/hosts.js
js/src/monitoring/hosts/hostDetail.js
js/src/npc.js
js/npc-all-min.js

Long term fix would have to be done by the plugin developer....
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

Not that I can see. Try grep'ing for 'graph_image' within the npc directory....
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
todd.seidenberg
Posts: 10
Joined: Tue Jun 17, 2008 8:58 am

Post by todd.seidenberg »

Yeah...you're right. Those are the only places that the graph_image.php shows up. So what could be the problem?

I can see all of my graphs when i click on the graphs tab, but when I try and click on the little graphs button in my host listing from within NPC, I get the error.

weird. My cacti/include/global.php file has the following line:

$config['url_path'] = "/cacti/";


And that appears to work just fine for everything else. Could it be something outside of the NPC plugin?


Linegod wrote:Not that I can see. Try grep'ing for 'graph_image' within the npc directory....
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

IIRC, NPC does some caching, so clearing the cache/restarting the browser may be the trick...
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
todd.seidenberg
Posts: 10
Joined: Tue Jun 17, 2008 8:58 am

Post by todd.seidenberg »

The weird thing is the changes I made had no affect on the results. Nothing I've done has made a difference.

Do the *.js files need to be re-read somehow? Is there a way to force that? or are they read in on the fly?

Or, again, is there somewhere else that I need to make a change?


- Todd

todd.seidenberg wrote:Yeah...you're right. Those are the only places that the graph_image.php shows up. So what could be the problem?

I can see all of my graphs when i click on the graphs tab, but when I try and click on the little graphs button in my host listing from within NPC, I get the error.

weird. My cacti/include/global.php file has the following line:

$config['url_path'] = "/cacti/";


And that appears to work just fine for everything else. Could it be something outside of the NPC plugin?


Linegod wrote:Not that I can see. Try grep'ing for 'graph_image' within the npc directory....
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

Linegod wrote:IIRC, NPC does some caching, so clearing the cache/restarting the browser may be the trick...
Did you try this? (I noticed the reply times where close, so you may not have seen it...)
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
todd.seidenberg
Posts: 10
Joined: Tue Jun 17, 2008 8:58 am

Post by todd.seidenberg »

Yep, I tried this. And yes, that was it. It now works.

So here's what I did.

In the files within the cacti/plugins/npc directory that have the graph_image.php reference, I changed it to say /cacti/graph_image.php......

Once I did that, and _cleared_ the cache, I was able to see the graphs connected to NPC without a problem.


- Thanks to everyone for your help.

Todd



Linegod wrote:
Linegod wrote:IIRC, NPC does some caching, so clearing the cache/restarting the browser may be the trick...
Did you try this? (I noticed the reply times where close, so you may not have seen it...)
[/code]
npc_user
Posts: 3
Joined: Tue Jan 11, 2011 1:37 pm

Re: /var/www/html/graph_image.php' not found or unable to st

Post by npc_user »

I initially had the same error as above. - script '/var/www/html/graph_image.php' not found or unable to stat.
I replaced all occurences of greaph_image.php, cleared the cache and finally the error went away. However, now when I try to map the graph, I see the following message in the http - errors -

File does not exist: /var/www/html/var, referer: http://xxx.xxx.xxx.xxx/cacti/plugins/np ... drawLayout

I am not sure how to go around this.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest