1.0.1 Realtime graphs do not load (broken img icon)

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
kjstech
Cacti User
Posts: 97
Joined: Thu Feb 28, 2013 2:57 pm

1.0.1 Realtime graphs do not load (broken img icon)

Post by kjstech »

When I click on the realtime icon next to a traffic graph, I simply get a broken image link. Everything else in cacti 1.0.1 seems to be functioning as expected since my upgrade, but I was really hoping to try this new feature. If I tail the logs on apache2 I see this in the error.log for the duration of time that a graph is in realtime mode:

ERROR: opening '/var/www/cacti/cache/realtime//user_3pe1ri5258sai8ocm5ponjdn34_2207.rrd': No such file or directory
[Thu Feb 02 09:41:46.409141 2017] [:error] [pid 19384] [client 10.7.3.7:61008] PHP Warning: fopen(/var/www/cacti/cache/realtime//user_3pe1ri5258sai8ocm5ponjdn34_lgi_2094.png): failed to open stream: Permission denied in /var/www/cacti/lib/rrd.php on line 2067, referer: http://intranet/cacti/graph_view.php?ac ... hyper=true
ERROR: opening '/var/www/cacti/cache/realtime//user_3pe1ri5258sai8ocm5ponjdn34_2207.rrd': No such file or directory
[Thu Feb 02 09:41:56.415286 2017] [:error] [pid 19384] [client 10.7.3.7:61008] PHP Warning: fopen(/var/www/cacti/cache/realtime//user_3pe1ri5258sai8ocm5ponjdn34_lgi_2094.png): failed to open stream: Permission denied in /var/www/cacti/lib/rrd.php on line 2067, referer: http://intranet/cacti/graph_view.php?ac ... hyper=true
cigamit
Developer
Posts: 3368
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: 1.0.1 Realtime graphs do not load (broken img icon)

Post by cigamit »

I would do as the error says and check the permissions on
/var/www/cacti/cache/realtime/

to ensure that the webserver can read/write to that directory.
kjstech
Cacti User
Posts: 97
Joined: Thu Feb 28, 2013 2:57 pm

Re: 1.0.1 Realtime graphs do not load (broken img icon)

Post by kjstech »

I changed group and owner to match other cacti resources and made permissions 775.

Still get the error though.

Thu Feb 02 10:32:00.468000 2017] [:error] [pid 1292] [client 10.7.3.7:49586] PHP Warning: fopen(/var/www/cacti/cache/realtime//user_3pe1ri5258sai8ocm5ponjdn34_lgi_2093.png): failed to open stream: Permission denied in /var/www/cacti/lib/rrd.php on line 2067, referer: http://intranet/cacti/graph_view.php?ac ... hyper=true


Is it because there is a bug putting a double slash between realtime//user and the file user_3pe1ri5258sai8ocm5ponjdn34_lgi_2093.png doesn't even exist (there's no files in /realtime).

Or is it saying permission denied in /var/www/cacti/lib/rrd.php , which if it were I would think a lot more would be broken besides realtime graphs?
cigamit
Developer
Posts: 3368
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: 1.0.1 Realtime graphs do not load (broken img icon)

Post by cigamit »

No, the double // doesn't matter. It still doesn't think it has write permissions to the folder for some odd reason. Try it at 777 real quick just to see if its permissions. Also do you have Selinux enabled?
kjstech
Cacti User
Posts: 97
Joined: Thu Feb 28, 2013 2:57 pm

Re: 1.0.1 Realtime graphs do not load (broken img icon)

Post by kjstech »

No selinux status shows disabled.

Ok Made the folder realtime 777. Now the log is simply this

ERROR: opening '/var/www/cacti/cache/realtime//user_3pe1ri5258sai8ocm5ponjdn34_2206.rrd': No such file or directory
ERROR: opening '/var/www/cacti/cache/realtime//user_3pe1ri5258sai8ocm5ponjdn34_2206.rrd': No such file or directory
ERROR: opening '/var/www/cacti/cache/realtime//user_3pe1ri5258sai8ocm5ponjdn34_2206.rrd': No such file or directory
ERROR: opening '/var/www/cacti/cache/realtime//user_3pe1ri5258sai8ocm5ponjdn34_2206.rrd': No such file or directory
ERROR: opening '/var/www/cacti/cache/realtime//user_3pe1ri5258sai8ocm5ponjdn34_2206.rrd': No such file or directory


Seems its accessing the folder but the file /user_3pe1ri5258sai8ocm5ponjdn34_2206.rrd is not there.

However now I check the /realtime directory and there is one 0KB png file there, but its not the one ending in 2206.rrd... its user_3pe1ri5258sai8ocm5ponjdn34_lgi_2093.png.

I tried realtime on a different graph, and error.log complains about file ending in _2207.rrd, but now /realtime has a new 0KB png file ending in 2094.png
cigamit
Developer
Posts: 3368
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: 1.0.1 Realtime graphs do not load (broken img icon)

Post by cigamit »

Yes, the png and rrd files will most likely have a different number on the end, that is normal. Now it just seems like it isn't creating the RRD file. The PNG file is empty because there is no rrd file.
cigamit
Developer
Posts: 3368
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: 1.0.1 Realtime graphs do not load (broken img icon)

Post by cigamit »

If you want to get rid of the // btw, just go change your Settings for the realtime cache path. Remove the / off the end.
kjstech
Cacti User
Posts: 97
Joined: Thu Feb 28, 2013 2:57 pm

Re: 1.0.1 Realtime graphs do not load (broken img icon)

Post by kjstech »

Ok took that extra / off the end in the realtime path under settings.

I get a new 0KB png for any new graph I try to realtime, but your correct... no .rrd files, hence the latest line in the error.log
ERROR: opening '/var/www/cacti/cache/realtime/user_3pe1ri5258sai8ocm5ponjdn34_1726.rrd': No such file or directory

I would imagine rrd is working or else I wouldn't have graphs for anything!
ttiot
Posts: 2
Joined: Mon Feb 13, 2017 10:50 am

Re: 1.0.1 Realtime graphs do not load (broken img icon)

Post by ttiot »

Hello,

I have the same problem. Do you figure out how to solve it ?

Thanks

P.S : I am on 1.0.2 version
ttiot
Posts: 2
Joined: Mon Feb 13, 2017 10:50 am

Re: 1.0.1 Realtime graphs do not load (broken img icon)

Post by ttiot »

Ok just figure out!

I'm running cacti under IIS and Windows server 2012 R2.
My php path was c:\program files(x86)\PHP\v5.5\php.exe

The file poller_realtime.php fails when it want to execute shell_command with an "Unknown command c:\program"

Juste move my php path to c:\php5.5 and it's working. no space in path.
kjstech
Cacti User
Posts: 97
Joined: Thu Feb 28, 2013 2:57 pm

Re: 1.0.1 Realtime graphs do not load (broken img icon)

Post by kjstech »

Not me, I'm Ubuntu Linux 14.04 LTS.

That command seems to execute. I'll try playing around with it in putty.

/var/www/cacti# php poller_realtime.php
ERROR: No --graph=ID specified

Cacti Realtime Poller, Version 1.0.1, Copyright (C) 2004-2017 The Cacti Group

usage: poller_rt.php --graph=ID [--interval=SEC] [--force] [--debug]

Cacti's Realtime graphing poller. This poller behavies very similary
to Cacti's main poller with the exception that it only polls data source
that are specific to the graph being rendered in the Cacti UI.

Required:
--graph=ID Specify the graph id to convert (realtime)

Optional:
--interval=SEC Specify the graph interval (realtime)
--force Override poller overrun detection and force a poller run
--debug|-d Output debug information. Similar to cacti's DEBUG logging level.
notanexpert
Posts: 4
Joined: Mon Feb 20, 2017 2:54 pm

Re: 1.0.1 Realtime graphs do not load (broken img icon)

Post by notanexpert »

Same issue here.

Httpd gives me:

[Mon Feb 20 17:10:01 2017] [error] [client 172.30.142.30] PHP Warning: fopen(/usr/share/cacti/cache/realtime/user_edqq6n9ujk5e8v5kg28fmaon53_lgi_5.png): failed to open stream: Permission denied in /usr/share/cacti/lib/rrd.php on line 2036, referer: http://172.30.142.31/cacti/graph_view.p ... hyper=true

Cacti 1.0.3 CentOS 6.5

All my cacti folders are owned by apache user and are 777 by now.

I also tried restorecon -R [cacti_folder].

Still can't generate realtime graphs.

Regards.
cigamit
Developer
Posts: 3368
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: 1.0.1 Realtime graphs do not load (broken img icon)

Post by cigamit »

notanexpert wrote:Same issue here.

Httpd gives me:

[Mon Feb 20 17:10:01 2017] [error] [client 172.30.142.30] PHP Warning: fopen(/usr/share/cacti/cache/realtime/user_edqq6n9ujk5e8v5kg28fmaon53_lgi_5.png): failed to open stream: Permission denied in /usr/share/cacti/lib/rrd.php on line 2036, referer: http://172.30.142.31/cacti/graph_view.p ... hyper=true

Cacti 1.0.3 CentOS 6.5

All my cacti folders are owned by apache user and are 777 by now.

I also tried restorecon -R [cacti_folder].

Still can't generate realtime graphs.

Regards.
You are getting a permission denied error. The line that it is throwing an error on is a simple fopen (for write)

Code: Select all

				if ($fp = fopen($graph_data_array['export_realtime'], 'w')) {
ls -Z /usr/share/cacti/cache/realtime
If you are running SELinux, permissions don't matter as much as the selinux contexts. Restoring contexts on a folder that has no policy defined won't have much effect either. You can check your audit log for any selinux errors. And if you just want to test to see if it is indeed selinux, just temp disable it via "setenforce 0"
notanexpert
Posts: 4
Joined: Mon Feb 20, 2017 2:54 pm

Re: 1.0.1 Realtime graphs do not load (broken img icon)

Post by notanexpert »

That was SELinux's fault,realtime up and running. Thank you.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests