Nagios XI 5.6.6 Missing /var/lib/mrtg/

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
dfmco
Posts: 257
Joined: Wed Dec 04, 2013 11:05 am

Nagios XI 5.6.6 Missing /var/lib/mrtg/

Post 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?
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

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

Post 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/*
Be sure to check out our Knowledgebase for helpful articles and solutions!
dfmco
Posts: 257
Joined: Wed Dec 04, 2013 11:05 am

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

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

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

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
dfmco
Posts: 257
Joined: Wed Dec 04, 2013 11:05 am

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

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

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

Post 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?
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: Nagios XI 5.6.6 Missing /var/lib/mrtg/

Post 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"?
Be sure to check out our Knowledgebase for helpful articles and solutions!
dfmco
Posts: 257
Joined: Wed Dec 04, 2013 11:05 am

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

Post by dfmco »

I have attached the results. The second device having issues is BUC SYS4B R01
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
dfmco
Posts: 257
Joined: Wed Dec 04, 2013 11:05 am

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

Post 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.
Locked