[SOLVED] RealTime graphs work but normal Poller graphs don't

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

[SOLVED] RealTime graphs work but normal Poller graphs don't

Post by Voiper99 »

Hi all, I have freshly installed 0.8.8 on my Centos 5.5 machine. I am also running the latest version of rrdtool.

The issue I have is that all of my graphs are reporting NaN values, even the graphs that are created for my local machine.

Here are some outputs I hope will be useful. Thanks everyone.

Code: Select all

# rrdtool fetch  rra/localhost_users_6.rrd AVERAGE
1333969500: nan
1333969800: nan
1333970100: nan
1333970400: nan
1333970700: nan
1333971000: nan
1333971300: nan
1333971600: nan
1333971900: nan
1333972200: nan
1333972500: nan
1333972800: nan
1333973100: nan
1333973400: nan
1333973700: nan
1333974000: nan
1333974300: nan
1333974600: nan
1333974900: nan
1333975200: nan
1333975500: nan
1333975800: nan
1333976100: nan
1333976400: nan
1333976700: nan
1333977000: nan
1333977300: nan
1333977600: nan
1333977900: nan
1333978200: nan
1333978500: nan
1333978800: nan
1333979100: nan
1333979400: nan
1333979700: nan
1333980000: nan
1333980300: nan
1333980600: nan
1333980900: nan
1333981200: nan
1333981500: nan
1333981800: nan
1333982100: nan
1333982400: nan
1333982700: nan
1333983000: nan
1333983300: nan
1333983600: nan
1333983900: nan
1333984200: nan

# rrdtool info  rra/localhost_users_6.rrd
filename = "rra/localhost_users_6.rrd"
rrd_version = "0003"
step = 300
last_update = 1334003461
header_size = 1888
ds[users].index = 0
ds[users].type = "GAUGE"
ds[users].minimal_heartbeat = 600
ds[users].min = 0.0000000000e+00
ds[users].max = 5.0000000000e+02
ds[users].last_ds = "2"
ds[users].value = 1.2200000000e+02
ds[users].unknown_sec = 0
rra[0].cf = "AVERAGE"
rra[0].rows = 600
rra[0].cur_row = 583
rra[0].pdp_per_row = 1
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = NaN
rra[0].cdp_prep[0].unknown_datapoints = 0
rra[1].cf = "AVERAGE"
rra[1].rows = 700
rra[1].cur_row = 242
rra[1].pdp_per_row = 6
rra[1].xff = 5.0000000000e-01
rra[1].cdp_prep[0].value = 0.0000000000e+00
rra[1].cdp_prep[0].unknown_datapoints = 0
rra[2].cf = "AVERAGE"
rra[2].rows = 775
rra[2].cur_row = 667
rra[2].pdp_per_row = 24
rra[2].xff = 5.0000000000e-01
rra[2].cdp_prep[0].value = 1.2000000000e+01
rra[2].cdp_prep[0].unknown_datapoints = 0
rra[3].cf = "AVERAGE"
rra[3].rows = 797
rra[3].cur_row = 236
rra[3].pdp_per_row = 288
rra[3].xff = 5.0000000000e-01
rra[3].cdp_prep[0].value = 1.4000000000e+01
rra[3].cdp_prep[0].unknown_datapoints = 239
rra[4].cf = "MAX"
rra[4].rows = 600
rra[4].cur_row = 530
rra[4].pdp_per_row = 1
rra[4].xff = 5.0000000000e-01
rra[4].cdp_prep[0].value = NaN
rra[4].cdp_prep[0].unknown_datapoints = 0
rra[5].cf = "MAX"
rra[5].rows = 700
rra[5].cur_row = 382
rra[5].pdp_per_row = 6
rra[5].xff = 5.0000000000e-01
rra[5].cdp_prep[0].value = -inf
rra[5].cdp_prep[0].unknown_datapoints = 0
rra[6].cf = "MAX"
rra[6].rows = 775
rra[6].cur_row = 599
rra[6].pdp_per_row = 24
rra[6].xff = 5.0000000000e-01
rra[6].cdp_prep[0].value = 2.0000000000e+00
rra[6].cdp_prep[0].unknown_datapoints = 0
rra[7].cf = "MAX"
rra[7].rows = 797
rra[7].cur_row = 350
rra[7].pdp_per_row = 288
rra[7].xff = 5.0000000000e-01
rra[7].cdp_prep[0].value = 2.0000000000e+00
rra[7].cdp_prep[0].unknown_datapoints = 239
Last edited by Voiper99 on Sat Apr 14, 2012 6:23 am, edited 3 times in total.
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Re: 0.8.8 - NaN graphs on fresh install

Post by Voiper99 »

I have just found that while using "Realtime" plugin, the graphs show up properly.

I also tried a fresh install of 8.7i and and had the exact same issue and found Realtime fixed it there too.

By the way, I'm not trying to use 1 minute polling (as I believe this can cause the issue I am experiencing).

Does anyone have any ideas as to what I can do to resolve this?

Thanks again.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: 0.8.8 - NaN graphs on fresh install

Post by gandalf »

In this case, I would assume a permission issue as REALTIME is run through the browser, whereas the poller is run through crontab
R.
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Re: 0.8.8 - NaN graphs on fresh install

Post by Voiper99 »

Hi gandalf, thanks a lot for the message. I have been working at this for days without success, but your message has given me new hope :)

OK, so I believe I've done exactly what all of the documentation I have read states (though I must be doing something wrong as it's still not working) :(

What I have done is create the user "cactiuser" and changed the permissions for both the rra and log directories, like so:

Code: Select all

chown -R cactiuser rra/ log/
chmod 777 /var/www/html/cacti/log/cacti.log 
chmod 777 /var/www/html/cacti/rra/
What I then did is set the poller up in cron, using this line:

Code: Select all

cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
I'll double check my settings tonight, but in the mean time, could you please refresh my memory in regards to permissions? This is my understanding:

1) Create a new user (e.g cactiuser)
2) Recursively change the permissions of the log and rra directories so that they are 777.
3) Recursively change the permissions of the log and rra directories so that they are owned by the user created in step 1.
4) Set up the cron job so that it is run by the user who was created in step 1.

Is this correct? If I recall correctly, I thought I've seen in the past people suggesting that the user created in Step 1 above needs to be part of the webserver group. Or is that incorrect?

Thank you.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: 0.8.8 - NaN graphs on fresh install

Post by gandalf »

Please change

Code: Select all

cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
to

Code: Select all

cactiuser php /var/www/html/cacti/poller.php > /var/www/html/cacti/log/poller.log 2>&1
and watch that very file for hints. I assume, that you did prepend this "line" by the required timings for cron, as given by the documentation.
R.
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Re: 0.8.8 - NaN graphs on fresh install

Post by Voiper99 »

Thanks for the suggestion Gandalf, I will give that a go as soon as I can and will report back here once done.

By the way, your right, I did the correct timings. Sorry, I don't know how I ended up pasting half of the cron job. Here is what it actually looks like:

Code: Select all

*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
Thanks :)
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Re: 0.8.8 - NaN graphs on fresh install

Post by Voiper99 »

By the way, I just made a (long overdue) $30 donation as a "thank you" to all of you guys.

Not only is Cacti such a great tool, but you all devote so much of your time to helping us on the forums too, and I really appreciate it. Thank you guys :)
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Re: [SOLVED] - 0.8.8 - NaN graphs on fresh install

Post by Voiper99 »

I have got it working and am almost too embarrassed to admit where I went wrong :P

A lot of Cacti install guides that I have read tell you to create a .conf file in your Apache directory, and point it to your Cacti install directory. e.g:

Code: Select all

vi /etc/httpd/conf.d/cacti.conf

#
# Cacti: An rrd based graphing tool
#
Alias /cacti /usr/share/cacti
<Directory /usr/share/cacti/>
Order Deny,Allow
Deny from all
Allow from all
</Directory>
So, I blindly followed the guides except for one minor detail (due to my lack of Linux knowledge). As per the example above, the Cacti install is in /usr/share/cacti - however, I was putting my Cacti install in /var/www/html/cacti - then, on top of that I had a alias /cacti /var/www/html/cacti line in my cacti.conf file - In other words (if I understand it correctly), I effectively had an alias pointing to its self.

To resolve the issue, I had a fresh install of CentOS (again :P) but this time did not create the cacti.conf file at all, and worked as expected.

Thanks again Gandalf, your assistance, like always, was much appreciated!

EDIT: I have created a "HowTo" so others don't fall in to the same trap that I did. It can be found here: http://forums.cacti.net/viewtopic.php?f=2&t=46997
tzoubicou
Posts: 18
Joined: Wed Apr 11, 2012 8:06 am

Re: [SOLVED] - 0.8.8 - NaN graphs on fresh install

Post by tzoubicou »

Hi,
I've the same problem of Voiper, but i'm so sorry, but i don't understand all oh your reply.
What did you mean, when you say "In this case, I would assume a permission issue as REALTIME is run through the browser, whereas the poller is run through crontab"?
Cacti: 0.8.7h
Fedora 14
Thank's for your reply.
Thomas
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Re: [SOLVED] - 0.8.8 - NaN graphs on fresh install

Post by Voiper99 »

I am by far a Linux or Cacti expert, so take my information with a grain of salt :)

What I believe he is saying is that the RealTime plugin is run through Linux using your webserver user - e.g www-data or apache, or something similar. Whereas the poller is run by whichever username you choose to run it. As per the example below, I chose to run it by the "cactiuser" username.

Code: Select all

cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
So, if RealTime is working but regular graphs aren't, you may not have changed the permissions for the /rra directory properly to allow the poller username (e.g cactiuser in the example above) to write to that directory.

By the way, what OS are you using? And, is this a fresh install?

If it is, you may want to look at HowTo guide - http://forums.cacti.net/viewtopic.php?f=2&t=46997 - for info on how to get Cacti 8.8 up and running.
tzoubicou
Posts: 18
Joined: Wed Apr 11, 2012 8:06 am

Re: [SOLVED] - 0.8.8 - NaN graphs on fresh install

Post by tzoubicou »

Thank's to reply me.
Then, i use apache webserver, fedora for OS, Cact version 0.8.7h.
The poller run every 5 minutes because I've a lot of log.
This is a fresh install with de packages issue of fedora 14.
I think that the permissions for /rra directories are ok.
This is the crontab for cactiuser:
*/5 * * * * cactiuser /usr/bin/php /usr/share/cacti/poller.php > /usr/share/cacti/log/poller.log 2>&1
To me, i don't use realtime plugin, and never install this plugin.
In my logfile, i don't have errors, only this kind of message:
04/12/2012 02:56:33 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=1334148992 --end=1334235392 --title='Localhost - Processes' --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 COMMENT:"From 11/04/2012 14\:56\:32 To 12/04/2012 14\:56\:32\c" COMMENT:" \n" --vertical-label='processes' --slope-mode --font TITLE:10: --font AXIS:7: --font LEGEND:8: --font UNIT:7: DEF:a="/var/lib/cacti/rra/localhost_proc_7.rrd":proc:AVERAGE AREA:a#F51D30FF:"Running Processes" GPRINT:a:LAST:"Current\:%8.0lf" GPRINT:a:AVERAGE:"Average\:%8.0lf" GPRINT:a:MAX:"Maximum\:%8.0lf\n"
To me, it's just informative?
tzoubicou
Posts: 18
Joined: Wed Apr 11, 2012 8:06 am

Re: [SOLVED] - 0.8.8 - NaN graphs on fresh install

Post by tzoubicou »

Technical Support
General Information
Date Thu, 12 Apr 2012 16:06:00 +0200
Cacti Version 0.8.7h
Cacti OS unix
SNMP Version NET-SNMP version: 5.5
RRDTool Version RRDTool 1.4.x
Hosts 2
Graphs 5
Data Sources Script/Command: 5
SNMP Query: 1
Total: 6

Poller Information
Interval 300
Type cmd.php
Items Action[0]: 2
Action[1]: 5
Total: 7
Concurrent Processes 1
Max Threads 1
PHP Servers 1
Script Timeout 25
Max OID 10
Last Run Statistics Time:1.1835
Method:cmd.php
Processes:1
Threads:N/A
Hosts:3
HostsPerProcess:3
DataSources:7
RRDsProcessed:6

PHP Information
PHP Version 5.3.8
PHP OS Linux
PHP uname Linux SRV-CACTI 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18 23:56:17 UTC 2010 i686
PHP SNMP Installed
max_execution_time 30
memory_limit 128M
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Re: [SOLVED] RealTime graphs work but normal Poller graphs d

Post by Voiper99 »

Yes, the output you provided does seem informational. Are the RRA files actually being created? (Take a look in the "rra" directory).

Having said that, if it is a distribution install, they may decide to store the files elsewhere on the system.
tzoubicou
Posts: 18
Joined: Wed Apr 11, 2012 8:06 am

Re: [SOLVED] RealTime graphs work but normal Poller graphs d

Post by tzoubicou »

I created all rra file with this command "php -q /usr/share/cacti/poller.php" because they're not created automatically with cacti.
My RRA directory is "/usr/share/cacti/rra/", the link target of "/var/lib/cacti/rra/". The rrd's files are in the second directory.
I don't known why the rrd files are not created automatically!!
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Re: [SOLVED] RealTime graphs work but normal Poller graphs d

Post by Voiper99 »

Just to confirm, your cron job does not create (or update) your graphs and the only way you can have them created (or updated) is by manually issuing the "php -q /usr/share/cacti/poller.php" command on your CLI? If this is correct, I assume this is a permissions issue. This is because your running your cron job as user "cactiuser" but when you manually issue the command, your running it as root.

Try issuing the following commands:

Code: Select all

chown -R cactiuser /var/lib/cacti/rra
chmod 777 -R /var/lib/cacti/rra
chown -R cactiuser /var/lib/cacti/rra/*
chmod 777 -R /var/lib/cacti/rra/*
(I don't believe the bottom two commands are required but thought I'd throw them in there as I'm not 100% sure).

Note: Once you have done this, do not issue the "php -q /usr/share/cacti/poller.php" command from the CLI again, as I believe this will undo the permission changes made above.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests