MRTG for Nagios: RRD files not being created

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mbeebe
Posts: 144
Joined: Thu Dec 20, 2018 5:12 pm

MRTG for Nagios: RRD files not being created

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: MRTG for Nagios: RRD files not being created

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: MRTG for Nagios: RRD files not being created

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
mbeebe
Posts: 144
Joined: Thu Dec 20, 2018 5:12 pm

Re: MRTG for Nagios: RRD files not being created

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: MRTG for Nagios: RRD files not being created

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
mbeebe
Posts: 144
Joined: Thu Dec 20, 2018 5:12 pm

Re: MRTG for Nagios: RRD files not being created

Post by mbeebe »

Yup, that worked!

Thanks as always,

-- Mike Beebe
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: MRTG for Nagios: RRD files not being created

Post by scottwilkerson »

mbeebe wrote:Yup, that worked!

Thanks as always,

-- Mike Beebe
Grewat!

Locking
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked