[SOLVED - sort of] 0.8.8a & realtime no longer graphing

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
GlueGuy
Cacti User
Posts: 255
Joined: Fri Nov 04, 2005 3:37 pm
Location: Ca US
Contact:

[SOLVED - sort of] 0.8.8a & realtime no longer graphing

Post by GlueGuy »

Upgraded from 0.8.7g to 0.8.8a and now realtime graphs are not displaying. The realtime plugin is version 0.5. System is CentOS(Linux 2.6.18-308.24.1.el5 on x86_64).

I turned logging up to high and got this in the cacti log
CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=-300 --end=-5 --title="xyxyxy Router - Traffic ether1 (xyxyxy)"
--rigid --base=1000 --height=120 --width=500 --x-grid SECOND:30:MINUTE:1:SECOND:30:0:%M:%S --alt-autoscale-max
--lower-limit=0 --vertical-label="bits per second" --slope-mode --font TITLE:10: --font AXIS:6: --font LEGEND:8:
--font UNIT:6: DEF:a="/var/www/html/plugins/realtime/cache/realtime_7694_5.rrd":traffic_in:AVERAGE
DEF:b="/var/www/html/plugins/realtime/cache/realtime_7694_5.rrd":traffic_out:AVERAGE CDEF:cdefa=a,8,*
CDEF:cdeff=b,8,* CDEF:cdefba=TIME,1359057395,GT,a,a,UN,0,a,IF,IF,TIME,1359057395,GT,b,b,UN,0,b,IF,IF,+,8,*
AREA:cdefa#00CF00FF:"Inbound" GPRINT:cdefa:LAST:" Current\:%8.2lf %s" GPRINT:cdefa:AVERAGE:"Avg\:%8.2lf %s"
GPRINT:cdefa:MAX:"Max\:%8.2lf %s\n" COMMENT:"Total In\: 0 bytes\n" LINE1:cdeff#002A97FF:"Outbound"
GPRINT:cdeff:LAST:" Current\:%8.2lf %s" GPRINT:cdeff:AVERAGE:"Avg\:%8.2lf %s" GPRINT:cdeff:MAX:"Max\:%8.2lf %s\n"
COMMENT:"Total Out\: 0 bytes\n" LINE1:cdefba#FF0000FF:"Total In+Out" GPRINT:cdefba:LAST:"Current\:%8.2lf %s"
GPRINT:cdefba:AVERAGE:"Avg\:%8.2lf %s" GPRINT:cdefba:MAX:"Max\:%8.2lf %s\n" COMMENT:"Total In+Out\: 0 bytes\n"

CACTI2RRD: /usr/bin/rrdtool fetch /var/www/html/rra/xyxyxy_relayrouter_traffic_in_7694.rrd AVERAGE -s -300 -e -5 -r 5

CACTI2RRD: /usr/bin/rrdtool info /var/www/html/rra/xyxyxy_relayrouter_traffic_in_7694.rrd
Apache log shows this
ERROR: opening '/var/www/html/plugins/realtime/cache/realtime_7694_5.rrd': No such file or directory
So clearly the cache RRD is not getting created. However, the realtime cache directory is owned by apache.apache (as is the whole cacti directory structure). Just as a "let's see" I turned on +w for the realtime cache directory, but got no change.
Is there some other ownership thing that I'm missing?
Last edited by GlueGuy on Mon Jan 28, 2013 6:36 pm, edited 1 time in total.
---------
The Glue Guy
User avatar
GlueGuy
Cacti User
Posts: 255
Joined: Fri Nov 04, 2005 3:37 pm
Location: Ca US
Contact:

Re: 0.8.8a & realtime no longer graphing

Post by GlueGuy »

One correction to the above. It looks like the realtime plugin is actually version 0.5.2, but the plugin manager is identifying it as 0.5.

The archive that I downloaded is this: realtime-v0.5-2.tgz

But this is what is in the setup.php

Code: Select all

function realtime_version () {
        return array(
                'name'     => 'realtime',
                'version'  => '0.5',
                'longname' => 'Realtime Graph Viewer',
                'author'   => 'Mathieu Virbel',
                'homepage' => 'http://www.cacti.net',
                'email'    => 'mathieu.v@capensis.fr',
                'url'      => 'http://versions.cactiusers.org'
        );
Maybe something else is wrong?
---------
The Glue Guy
User avatar
GlueGuy
Cacti User
Posts: 255
Joined: Fri Nov 04, 2005 3:37 pm
Location: Ca US
Contact:

Re: 0.8.8a & realtime no longer graphing

Post by GlueGuy »

This clearly is some sort of permissions issue. If I run the realtime script from the CLI (as root), the cache files get created.

However, running through the browser (as apache.apache), the cache files do not get created.

All the files and directories are owned by apache.apache.

I turned off SElinux because it was creating weird ownership issues that I don't have time to debug.

I even chowned the /var/www/html/plugins/realtime/cache directory 777.

Still no joy.

Anyone know what else I can look at?
---------
The Glue Guy
User avatar
GlueGuy
Cacti User
Posts: 255
Joined: Fri Nov 04, 2005 3:37 pm
Location: Ca US
Contact:

Re: 0.8.8a & realtime = FUBAR

Post by GlueGuy »

Not so convinced this is a permissions issue. I can run the realtime poller from the CLI, and get a sane response. This also creates the cached RRD file.:

Code: Select all

sudo -u apache php  /var/www/html/plugins/realtime/poller_rt.php --graph=4680 --interval=3 --debug
OK u:0.01 s:0.01 r:0.00
However, when initiated from the realtime icon, it never creates the cached RRD file, and the only error (in the httpd log) is that the RRD file doesn't exist.

I upgraded a second cacti server to 0.8.8a, and it behaves the same way. So I am missing something obvious, but have not been able to discover what it is.
---------
The Glue Guy
User avatar
GlueGuy
Cacti User
Posts: 255
Joined: Fri Nov 04, 2005 3:37 pm
Location: Ca US
Contact:

Re: 0.8.8a & realtime no longer graphing

Post by GlueGuy »

I've discovered that if I run poller_rt.php from the CLI, the realtime plugin "simulates" running correctly. So either polle_rt.php is not getting called (I think this is what is happening), or else it's not generating the RRD output file (I don't think this, but just throwing it out there as a possibility).

No help out there?
Last edited by GlueGuy on Mon Jan 28, 2013 6:37 pm, edited 1 time in total.
---------
The Glue Guy
User avatar
GlueGuy
Cacti User
Posts: 255
Joined: Fri Nov 04, 2005 3:37 pm
Location: Ca US
Contact:

[SOLVED - sort of] Re: 0.8.8a & realtime no longer graphing

Post by GlueGuy »

With a lot of help from TheWitness, I've got at least a workaround for this.

Almost every plugin has this little bit of code:

Code: Select all

/* do NOT run this script through a web browser */
if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD'])  || isset($_SERVER['REMOTE_ADDR'])) {
        die("<br><strong>This script is only meant to run at the command line.</strong>");
}
The intention is to prevent shell scripts from running if they are maliciously run from a browser; an exploit of sorts.

I'm not sure this is the correct way to block this. However, I've found that if I reduce the code to this:

Code: Select all

/* do NOT run this script through a web browser */
if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD']) ) {
        die("<br><strong>This script is only meant to run at the command line.</strong>");
}
Everything seems to work correctly.

Is there a better way to fix this?
---------
The Glue Guy
dieselboy
Cacti User
Posts: 135
Joined: Wed May 27, 2009 5:10 pm

Re: [SOLVED - sort of] 0.8.8a & realtime no longer graphing

Post by dieselboy »

I have this problem too and it's stopped working all of a sudden - the RRD's are not being created in cache. I updated to the latest 0.5-2 realtime but no joy and the window keeps resizing to a extremely tiny size every second. I'll try the workaround. thx
dieselboy
Cacti User
Posts: 135
Joined: Wed May 27, 2009 5:10 pm

Re: [SOLVED - sort of] 0.8.8a & realtime no longer graphing

Post by dieselboy »

workaround didn't work.
SpeedyGonzales
Posts: 34
Joined: Fri Sep 16, 2016 7:51 am

Re: [SOLVED - sort of] 0.8.8a & realtime no longer graphing

Post by SpeedyGonzales »

Cacti 0.8.8f
PHP7

Realtime not working

Fixed this by following the instructions on here

http://www.devthought.com/2009/06/09/fi ... in-php-53/

Hope this helps others, took me a while to sort
SpeedyGonzales
Posts: 34
Joined: Fri Sep 16, 2016 7:51 am

Re: [SOLVED - sort of] 0.8.8a & realtime no longer graphing

Post by SpeedyGonzales »

Realtime graphs working but now getting new apache2 errors


ERROR: is not a vname nor a number
ERROR: don't understand 'a,8,*'
ERROR: is not a vname nor a number
ERROR: is not a vname nor a number
ERROR: don't understand 'a,8,*'
ERROR: is not a vname nor a number
ERROR: is not a vname nor a number
[Mon Sep 26 14:50:11.630481 2016] [mpm_prefork:notice] [pid 21690] AH00169: caught SIGTERM, shutting down
[Mon Sep 26 14:50:12.775429 2016] [mpm_prefork:notice] [pid 24228] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Mon Sep 26 14:50:12.775474 2016] [core:notice] [pid 24228] AH00094: Command line: '/usr/sbin/apache2


Anyone help?
sz22
Posts: 3
Joined: Sat Aug 11, 2018 9:34 am
Location: Hungary

Re: [SOLVED - sort of] 0.8.8a & realtime no longer graphing

Post by sz22 »

old topic, but maybe someone still needs it :)

if you have PHP7, you have to change the following:

replace all ereg() with preg_match(//) in graph_image_rt.php
replace split() with explode() in poller_rt.php and cmd_rt.php

that's all!
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: [SOLVED - sort of] 0.8.8a & realtime no longer graphing

Post by netniV »

You should probably search through all PHP files for these, since you may have plugins also with this issue.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest