Page 1 of 1

MRTG for Nagios: RRD files not being created

Posted: Tue Sep 03, 2019 10:20 am
by mbeebe
Hello,

I'm trying to set up monitoring for a F5 load balance, a Cisco ASA and a Juniper QFX using the both the Network/Switch router wizard and the SNMP wizard in Networking.

I'm able to find all the ports on the devices with the wizard, but the issue is the RRD files never get built, so the monitors error out. Complicating this are the large number of ports being monitored, which probably is what's causing the issue.

I've tried upping the memory for PHP in /etc/php.ini to 512m as well as upping the number of connections to 30,000. This didn't help, however.

Any suggestions?

-- Mike Beebe

Re: MRTG for Nagios: RRD files not being created

Posted: Tue Sep 03, 2019 11:34 am
by tgriep
First, upgrade the Network Switch / Router wizard in XI to the latest version by logging in to the XI GUI and going to the Admin > Manage Config Wizards menu.
Click the Check for Updates button and update the Network Switch / Router wizard.
Then run the following as root to set the permissions of the files the wizard / plugin use to get the bandwidth information.

Code: Select all

chown apache:nagios /etc/mrtg -R
chmod 775 /etc/mrtg -R
chown apache:nagios /var/lib/mrtg -R
chmod 775 /var/lib/mrtg -R
Let the system run for 15 minutes and see if the issue has been resolved.

If the above does not work, can you run the following commands as root and post the the /tmp/mrtg.txt file here?

Code: Select all

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg -debug=cfg,base,log &> /tmp/mrtg.txt
LANG=C LC_ALL=C /usr/bin/mrtg &>> /tmp/mrtg.txt
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 &>> /tmp/mrtg.txt
{ time LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg 2>1 ; } 2>> /tmp/mrtg.txt
What OS and release version is the Nagios server running on?

Re: MRTG for Nagios: RRD files not being created

Posted: Tue Sep 03, 2019 3:03 pm
by tgriep
Thanks for the file in the PM.

There is a setting in one of the config files that changed the folder where the rrd files are stored and that is why the rrd files are not getting created in the correct folder.

Edit this file

Code: Select all

/etc/mrtg/conf.d/10.43.76.1.cfg
Find and remove the following line in the cfg file

Code: Select all

WorkDir: /var/www/html/mymrtg/
Save the change and wait for 15 minutes to see if the files get created and that they show valid data as well.

Re: MRTG for Nagios: RRD files not being created

Posted: Tue Sep 03, 2019 3:11 pm
by mbeebe
Hello,

That worked wonderfully, but induced a new problem: we're no longer getting our MRTG graphs in the mymrtg directory. Is there any way of getting both the .rrd files required by Nagios in /var/lib/mrtg and the MRTG graphs we need to see in /var/www/html/mymrtg?

Thanks,

-- Mike Beebe

Re: MRTG for Nagios: RRD files not being created

Posted: Tue Sep 03, 2019 3:16 pm
by tgriep
I don't know what application you are running that needs the files in the /var/www/html/mymrtg folder but could you change that application to point to the /var/lib/mrtg folder instead?

Or, you create a symbolic link to the /var/www/html/mymrtg folder from the /var/lib/mrtg folder, that should work as well.

Re: MRTG for Nagios: RRD files not being created

Posted: Thu Sep 05, 2019 3:15 pm
by mbeebe
Yup, that worked!

Thanks as always,

-- Mike Beebe

Re: MRTG for Nagios: RRD files not being created

Posted: Thu Sep 05, 2019 3:31 pm
by scottwilkerson
mbeebe wrote:Yup, that worked!

Thanks as always,

-- Mike Beebe
Grewat!

Locking