RRD not being updated

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

RRD not being updated

Post by vmesquita »

Hello,

We are having an issue with the RRD used to store the bandwith usage of a Switch
The service check is:

Code: Select all

check_rrdtraf -f /var/lib/mrtg/192.168.50.100_10613.rrd -w 500.0,500.0 -c 800.0,800.0 -l M
wichi results :

Code: Select all

OK - Current BW in: 0Mbps Out: 0Mbps|in=0Mb/s;500.0;800.0 out=0Mb/s;500.0;800.0
However upon closer inspection, the file hasn't been updated since we migrated the Nagios Install:

Code: Select all

ls -ls /var/lib/mrtg/192.168.50.100_10613.rrd
104 -rwxrwxr-x 1 apache nagios 105320 Feb 21 18:51 /var/lib/mrtg/192.168.50.100_10613.rrd
In this migration, we installed a fresh CentOS 7, then Nagios and finally restored the backup. The previous server had CentOS 6.

Any ideas of what could be happening?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: RRD not being updated

Post by scottwilkerson »

There are a couple possibilities, but being these are only used temporarily I would suggest renaming the file and let MRTG generate a new one

Code: Select all

mv /var/lib/mrtg/192.168.50.100_10613.rrd /var/lib/mrtg/192.168.50.100_10613.rrd~
then a new file should be generated within 5 minutes, and valid data should come to the check_rrdtraf plugin within 15 minutes
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: RRD not being updated

Post by vmesquita »

I did as suggested however the file was not created after half an hour, what could be happening?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: RRD not being updated

Post by scottwilkerson »

Do you have any errors in

Code: Select all

tail -50 /var/log/cron |grep mrtg
related to mrtg?

If not lets run the following from the command line to see if there are any errors

Code: Select all

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lib/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok --user=nagios --group=nagios
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: RRD not being updated

Post by vmesquita »

So apparently there's a lib missing:

Code: Select all

$ sudo tail -50 /var/log/cron |grep mrtg
Mar 26 15:45:01 sx591 CROND[85569]: (root) CMD (LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lib/mrtg/mrtg.lock --confcache-file /var/lib mrtg/mrtg.ok --user=nagios --group=nagios)
$ LANG=C LC_ALL=C sudo /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lib/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok --user=nagios --group=nagios
ERROR: could not find RRDs.pm. Use LibAdd: in mrtg.cfg to help mrtg find RRDs.pm
How can I fix this?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: RRD not being updated

Post by tgriep »

The missing perl module can be installed by running this as root

Code: Select all

yum install rrdtool-perl
To test to see if MRTG can find the module, run the following command as root.

Code: Select all

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lib/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok --user=nagios --group=nagios
If you do not see the "could not find RRDs.pm" message, let the system run for 20 minutes and see if the Bandwidth graphs start to populate.
Be sure to check out our Knowledgebase for helpful articles and solutions!
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: RRD not being updated

Post by vmesquita »

Ok the files are being updated now, it seems that the issue have been fixed.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: RRD not being updated

Post by tgriep »

That is good news, glad it worked.
I'll lock the post for you as solved but feel free to open a new post in the future for any new questions.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked