Page 1 of 1
RRD not being updated
Posted: Tue Mar 26, 2019 12:11 pm
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?
Re: RRD not being updated
Posted: Tue Mar 26, 2019 12:56 pm
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
Re: RRD not being updated
Posted: Tue Mar 26, 2019 1:18 pm
by vmesquita
I did as suggested however the file was not created after half an hour, what could be happening?
Re: RRD not being updated
Posted: Tue Mar 26, 2019 1:37 pm
by scottwilkerson
Do you have any errors in
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
Re: RRD not being updated
Posted: Tue Mar 26, 2019 1:48 pm
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?
Re: RRD not being updated
Posted: Tue Mar 26, 2019 2:13 pm
by tgriep
The missing perl module can be installed by running this as root
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.
Re: RRD not being updated
Posted: Tue Mar 26, 2019 3:57 pm
by vmesquita
Ok the files are being updated now, it seems that the issue have been fixed.
Re: RRD not being updated
Posted: Tue Mar 26, 2019 4:01 pm
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.