RRD files for traffic not updating

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

Moderators: Developers, Moderators

Post Reply
Burvil
Posts: 16
Joined: Sat Jun 05, 2004 1:11 am
Contact:

RRD files for traffic not updating

Post by Burvil »

Hi,

I created some traffic graphs using the Interface - traffic template. They're
not updating, i.e. no updates to rrd files and thus NaNs in my graph.
However, all my other datasources, including others for this host, *are* updating. I tried
using lvm's directions to troubleshoot, and got to step 3, but there's no
updates in cacti.log. What's causing this?

1. Data sources -> filter by host -> add data source for remotehost, pick
Interface - traffic template, click save. I get this debug statement, which I
also have to run manually, as cactiuser (don't know why, but if I don't no
rrdfile shows up in the rra directory):

Code: Select all

/usr/bin/rrdtool create \
/var/www/html/cacti/rra/remotehost_traffic_in_61.rrd \
--step 300  \
DS:traffic_out:DERIVE:600:0:100000000 \
DS:traffic_in:DERIVE:600:0:100000000 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:600 \
RRA:LAST:0.5:6:700 \
RRA:LAST:0.5:24:775 \
RRA:LAST:0.5:288:797 
So, the files are:

Code: Select all

[cactiuser@burvil ~]$ ls -l rra/*traffic*
-rw-rw-r--  1 cactiuser cactiuser 141700 Sep 10 12:03 rra/appserver_traffic_in_62.rrd
-rw-rw-r--  1 cactiuser cactiuser 141700 Sep 10 11:35 rra/remotehost_traffic_in_61.rrd
[cactiuser@burvil ~]$ date
Sun Sep 10 12:11:55 BST 2006
2. Despite all my other data sources updating, which is reflected in
cacti.log, there's nothing for this datasource. I run the following command,
and it keeps getting nothing:

Code: Select all

 [cactiuser@burvil ~]$ tail -f log/cacti.log | grep 'rrdtool update' |grep  remotehost_traffic
Same thing with this command - I created another traffic datasource for
another host, and ran this:

Code: Select all

[cactiuser@burvil ~]$ tail -f log/cacti.log | grep 'rrdtool' |grep traffic
Also, the modification dates when I do an ls -l on the files from step 1 are
unchanged.


I've tried this multiple times, i.e. deleted the datasource and started anew,
each time with no updates to the rrdfile. This is even after waiting for an
hour or two.


3. These are my settings:

Code: Select all

[cactiuser@burvil ~]$ crontab -l
*/5 * * * * php /var/www/html/cacti/poller.php > /dev/null 2>&1
I tried setting to cmd.php as well as cactid.php. I also tried commenting out lines with rrd_close and rrd_init in poller.php, but that means that $rrdtool_pipe is undefined, which causes poller.php to error out. Now, I've changed it back to uncommented, and am using cmd.php (defaults).

Cacti 0.8.6h
RRDtool 1.0.50
RHEL AS4 Upd 3
========================
Burvil * http://www.burvil.org *
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: RRD files for traffic not updating

Post by gandalf »

Burvil wrote: 1. Data sources -> filter by host -> add data source for remotehost, pick
Interface - traffic template, click save. I get this debug statement, which I
also have to run manually, as cactiuser (don't know why, but if I don't no
rrdfile shows up in the rra directory):
...
Cacti 0.8.6h
RRDtool 1.0.50
RHEL AS4 Upd 3
This seems to be the problem. RRD files should be created by the poller. If it does not create them, it will not fill them either. So the question is: why does the poller ignore your SNMP Data Query for this targets? So, please check your Poller Cache from Utilities and serach for your target. Does the query show up here?
BTB: Will update my HowTo concerning this point
Reinhard
Burvil
Posts: 16
Joined: Sat Jun 05, 2004 1:11 am
Contact:

Re: RRD files for traffic not updating

Post by Burvil »

This seems to be the problem. RRD files should be created by the poller. If it does not create them, it will not fill them either.
I can see your point; it makes sense. However, for all the other hosts, I was able to get around this by creating the rrd files by hand, i.e. from the command line. Those rrds are getting updated, and it shows up in the poller cache, and I have valid graphs for them. This is an issue I brought up in this post, but have not gotten a response (although I realize it may have been because I wasn't clear; I edited it just now to clarify it).
So the question is: why does the poller ignore your SNMP Data Query for this targets? So, please check your Poller Cache from Utilities and serach for your target. Does the query show up here?
No, it doesn't. Nothing shows up with 'traffic' in it. It's all stuff for other rrds.

If this helps, here is what I get from adding a host in cacti.log after setting the debug level to DEBUG. It seems that there's rrdtool update statements for other rrdfiles that are created, but not for the traffic one, even though it's getting added to the database.

Code: Select all

[cactiuser@burvil ~]$ grep remotehost3 log/cacti.log
09/11/2006 10:57:16 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update data_template_data set name_cache='remotehost3 - Load Average - 5 Minute' where local_data_id=63"
09/11/2006 10:57:16 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update data_template_data set data_source_path='<path_rra>/remotehost3_ucd_load5min_63.rrd' where local_data_id=63"
09/11/2006 10:57:16 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_item (local_data_id,host_id,action,hostname,   snmp_community,snmp_version,snmp_timeout,snmp_username,snmp_password,snmp_port,rrd_name,rrd_path,   rrd_num,arg1,arg2,arg3) values (63,9,0,'172.31.55.51',   'public','1','500',   '','','161',   'ucd_load5min','/var/www/html/cacti/rra/remotehost3_ucd_load5min_63.rrd',   '1','.1.3.6.1.4.1.2021.10.1.3.2','','')"
09/11/2006 10:57:16 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_item (local_data_id,host_id,action,hostname,   snmp_community,snmp_version,snmp_timeout,snmp_username,snmp_password,snmp_port,rrd_name,rrd_path,   rrd_num,arg1,arg2,arg3) values (63,9,0,'172.31.55.51',   'public','1','500',   '','','161',   'ucd_load5min','/var/www/html/cacti/rra/remotehost3_ucd_load5min_63.rrd',   '1','.1.3.6.1.4.1.2021.10.1.3.2','','')"
09/11/2006 10:57:27 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update data_template_data set name_cache='remotehost3 - Load Average - 5 Minute' where local_data_id=63"
09/11/2006 10:57:27 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_item (local_data_id,host_id,action,hostname,   snmp_community,snmp_version,snmp_timeout,snmp_username,snmp_password,snmp_port,rrd_name,rrd_path,   rrd_num,arg1,arg2,arg3) values (63,9,0,'172.31.55.51',   'public','1','500',   '','','161',   'ucd_load5min','/var/www/html/cacti/rra/remotehost3_ucd_load5min_63.rrd',   '1','.1.3.6.1.4.1.2021.10.1.3.2','','')"
09/11/2006 10:59:57 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update data_template_data set name_cache='remotehost3 - Traffic' where local_data_id=64"
09/11/2006 10:59:57 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update data_template_data set data_source_path='<path_rra>/remotehost3_traffic_in_64.rrd' where local_data_id=64"
09/11/2006 11:00:02 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacti/rra/remotehost3_ucd_load5min_63.rrd --template ucd_load5min 1157968801:U
09/11/2006 11:01:04 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update data_template_data set name_cache='remotehost3 - Traffic' where local_data_id=6
Also, when I add the traffic rrd file, I choose the template
Interface - Traffic, but have to cut and paste rrd file name from debug statement into box for Data Source Path, *then* save it, and run from the command line.
========================
Burvil * http://www.burvil.org *
mlyonff
Posts: 1
Joined: Thu Sep 21, 2006 5:59 pm

ERROR: opening '/usr/share/cacti/site/rra/ issue....

Post by mlyonff »

Howdy,

I am having this issue:

ERROR: opening '/usr/share/cacti/site/rra/att_bgp_router_traffic_in_9.rrd': No such file or directory

and so of course none of the graphs are showing up.

I see it in my poller cache:

Data Source: ATT BGP router - Traffic - xxx.xxx.xxx.xxx - Gi0/0
RRD: /usr/share/cacti/site/rra/att_bgp_router_traffic_in_9.rrd
Action: 0, OID: .1.3.6.1.2.1.2.2.1.10.2 (Host: xxx.xxx.xxx.xxx, Community: *****)

I am completely clueless as how to fix this.

Any suggestions?

Thanks,
Mike
gigglesworth
Posts: 24
Joined: Wed Jan 25, 2006 12:51 pm

Post by gigglesworth »

I have a similar problem in another thread.

The poller would update some RRD files but not others.

For me, if the poller worked for one hosts it would update the RRD file.

If it failed for the host, it would not update the RRD file. I even created some new devices-- the SNMP queries failed, which meant that Cacti didn't even CREATE the RRD file at all.

I only noticed this after turning the "Poller Logging Level" to DEBUG, modify /etc/crontab to log the 'poller.php' to a logfile, and observing the logfiles.

If I created a new host, I would see something like this in the poller.php output:

Code: Select all

Timeout: No Response from host.example.com:161.
I even saw this host in the Poller Cache:

Code: Select all

Data Source: Example Firewall - 5 Minute CPU
RRD: /usr/local/cacti/rra/Example_firewall_5min_cpu_10.rrd
Action: 0, OID: .1.3.6.1.2.2.2.2.2.58.0 (Host: host.example.com, Community: public)
Since Cacti cannot monitor 'host.example.com' with SNMP (port 161), the files '/usr/local/cacti/rra/Example_firewall_5min_cpu_10.rrd' was never created for this host.

There are no errors like 'Can't communicate with remote host --- not updating /usr/local/cacti/rra/host.rrd file'. However, I noticed that the RRD files would not be updated in the case of several errors -- in one case, the 'ping' perl wrapper script was referencing the wrong version of Perl for instance.

If Cacti suddenly lost communication with the remote host, the RRD file would never be updated.
Burvil
Posts: 16
Joined: Sat Jun 05, 2004 1:11 am
Contact:

Have you tried doing an snmpwalk by hand?

Post by Burvil »

Have you tried

Code: Select all

snmpwalk -c public -v1 ip-address-of-firewall-here
replacing the parameters as necessary (I assumed community string of public and SNMP version 1, since that's usually the default in cacti and on most devices)?

If that's not working, you may have

- something that's blocking snmp specifically, e.g. a firewall rule
- snmp not running on the firewall

which, I'm guessing, is plausible, since it's a firewall and you may have tried to tie down the machine security-wise.
========================
Burvil * http://www.burvil.org *
gigglesworth
Posts: 24
Joined: Wed Jan 25, 2006 12:51 pm

Re: Have you tried doing an snmpwalk by hand?

Post by gigglesworth »

Burvil wrote:Have you tried

Code: Select all

snmpwalk -c public -v1 ip-address-of-firewall-here
Yes--- that is how I discovered that the SNMP requests were failing.

My big gripe is that Cacti failed to create the data files (or the graphs), and it never told me why. I wish I there was a better error in the logs.

Judging by the other posts in this forum, this is a common issue.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests