Page 1 of 2

Nagios XI 5.6.6 Missing /var/lib/mrtg/

Posted: Mon Dec 02, 2019 12:17 pm
by dfmco
Host checks are not working for two hosts due to this error missing /var/lib/mrtg/. The permissions are ok (attached) along with the server profile. Has anyone seen this in the past?

Re: Nagios XI 5.6.6 Missing /var/lib/mrtg/

Posted: Mon Dec 02, 2019 3:07 pm
by tgriep
Are these the permission errors that you are seeing?
[Thu Nov 14 12:27:56.567882 2019] [:error] [pid 31195] [client 192.168.128.110:63025] PHP Warning: copy(/etc/mrtg/conf.d/10.104.255.103.cfg): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/configwizards/switch/switch.inc.php on line 1555, referer: https://10.102.53.100/nagiosxi/config/m ... wizard.php
and
Cannot find module (NET-SNMP-VACM-MIB): At line 0 in (none)
............................................................/usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt: Permission denied
If so, 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 uses 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
chown root.nagios /usr/share/snmp/mibs/*
chmod 0664 ​/usr/share/snmp/mibs/*

Re: Nagios XI 5.6.6 Missing /var/lib/mrtg/

Posted: Mon Dec 02, 2019 5:31 pm
by dfmco
Thank you for your help. This is what I am seeing now. I also updated the Network Switch/Router wizard to version 2.5.2

Re: Nagios XI 5.6.6 Missing /var/lib/mrtg/

Posted: Mon Dec 02, 2019 5:46 pm
by tgriep
Does the /etc/mrtg/conf.d/10.104.255.103.cfg file exist on the nagios server?
That is the configuration file that MRTG used to create the .rrd files in the /var/lib/mrtg folder.

If it does not exist, re-run the Network Switch / Router wizard for that device so it will recreate the config file and then it can generate the rrd files.
Wait at least 20 minutes for the files to be created and to get populated with data.

Re: Nagios XI 5.6.6 Missing /var/lib/mrtg/

Posted: Tue Dec 03, 2019 4:51 pm
by dfmco
Hello,

Thank you for your recommendations. All of the steps have been completed and I updated to 5.6.8 but I am still having the same issue with the two hosts. Please let me know if you have any other suggestions.

Re: Nagios XI 5.6.6 Missing /var/lib/mrtg/

Posted: Tue Dec 03, 2019 5:40 pm
by tgriep
Could you post or PM me your Nagios XI System Profile so we can review it?
To get your system profile. Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and upload it to the forum post or PM it to me.

Did you re-run the wizard?
After running the wizard, did it create the configuration file in the /etc/mrtg/conf.d folder?

Re: Nagios XI 5.6.6 Missing /var/lib/mrtg/

Posted: Wed Dec 04, 2019 2:27 pm
by tgriep
Thanks for the profile, I now see that the MRTG config file exists.
Are you still seeing the rrd file not exist for the BUC SYS 4A R01 host?

Code: Select all

If so, Can you run the following commands as root and post the the /tmp/mrtg.txt file here?
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 --user=nagios --group=nagios &>> /tmp/mrtg.txt
{ time LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg 2>1 ; } 2>> /tmp/mrtg.txt
ls -lR /usr/share/snmp/mibs/* >> /tmp/mrtg.txt
You said you have issues with 2 hosts, what is the name of the host other than this one "BUC SYS 4A R01"?

Re: Nagios XI 5.6.6 Missing /var/lib/mrtg/

Posted: Wed Dec 04, 2019 3:29 pm
by dfmco
I have attached the results. The second device having issues is BUC SYS4B R01

Re: Nagios XI 5.6.6 Missing /var/lib/mrtg/

Posted: Wed Dec 04, 2019 4:11 pm
by scottwilkerson
From what you returned, I found this

Code: Select all

--cfg: /etc/mrtg/mrtg.cfg[34]: LibAdd: /opt/rrdtool-1.4.4/lib/perl/5.10.1
ERROR: CFG Error in "libadd", file /etc/mrtg/mrtg.cfg line 0: /opt/rrdtool-1.4.4/lib/perl/5.10.1 is not the name of a directory
this means that in your /etc/mrtg/mrtg.cfg you have added the line

Code: Select all

LibAdd: /opt/rrdtool-1.4.4/lib/perl/5.10.1
And this error is denoting /opt/rrdtool-1.4.4/lib/perl/5.10.1 doesn't exist

This line doesn't exist on a default install

Re: Nagios XI 5.6.6 Missing /var/lib/mrtg/

Posted: Mon Dec 09, 2019 12:28 pm
by dfmco
The servers are built the same using via automation. I am unclear as to what you are recommending for next steps.

Thanks again for all of your help.