Page 1 of 2
mrtg for Nagios XI - .rrd files are not being created
Posted: Wed Feb 19, 2020 1:55 pm
by aastaguy
Hello,
I know this post has been covered several times, but when I run the "Network switch/router configuration wizard" on a switch (Cisco), the wizard does the snmp scan and returns about 10 ports that can be monitored, I set it all up and finish, and ping works, but all I see in the bandwidth service is /var/lib/mrtg/ipaddress_10.rrd does not exist. so the rrd files are not being created.
I have looked at the .cfg file and cleared out all snmp scans, I have checked the time and restarted the npcd service, I have ran the following command env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg and receive the following output:
ERROR: unable to open include file: /etc/mrtg/conf.d/*.cfg
I have looked at just about every post on this topic to see if I can solve it myself but to no avail. Any help is greatly appreciated.
Thank you.
Re: mrtg for Nagios XI - .rrd files are not being created
Posted: Wed Feb 19, 2020 2:09 pm
by scottwilkerson
Can you show the output of the following?
Re: mrtg for Nagios XI - .rrd files are not being created
Posted: Wed Feb 19, 2020 2:13 pm
by aastaguy
total 1672
drwxrwxr-x. 2 apache nagios 4096 Feb 19 11:10 .
drwxr-xr-x. 28 root root 4096 Feb 19 04:27 ..
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.90_10.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.90_11.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.90_2.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.90_3.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.90_5.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.90_7.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.90_8.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.90_9.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.91_10.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.91_11.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.91_2.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.91_3.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.91_5.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.91_7.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.91_8.rrd
-rwxrwxr-x 1 apache nagios 105312 Nov 8 2018 172.16.191.91_9.rrd
-rw-r--r-- 1 nagios nagios 0 Feb 19 11:10 mrtg.lock
-rwxrwxr-x. 1 apache nagios 0 Nov 8 2018 mrtg.ok
the thing I notice is that the ip in question that I ran the wizard on does not exist. 192.168.191.93
Re: mrtg for Nagios XI - .rrd files are not being created
Posted: Wed Feb 19, 2020 3:13 pm
by scottwilkerson
Lets run the following command
the the following, and report any errors
Code: Select all
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
Also, can you show the output of
Re: mrtg for Nagios XI - .rrd files are not being created
Posted: Wed Feb 19, 2020 4:59 pm
by aastaguy
Thanks for your quick reply!
The first command to remove the lock went fine and din't report anything
The 2nd command gave me the usual following output:
ERROR: unable to open include file: /etc/mrtg/conf.d/*.cfg
The 3rd command output is below, where the host (192.168.191.93.cfg) does in fact exist:
total 48
drwxrwxr-x 2 apache nagios 4096 Feb 18 15:32 .
drwxr-xr-x. 4 root root 4096 Feb 19 10:46 ..
-rw-r--r-- 1 apache apache 11712 Nov 8 2018 172.16.191.90.cfg
-rw-r--r-- 1 apache apache 11717 Nov 8 2018 172.16.191.91.cfg
-rw-r--r-- 1 apache apache 15807 Feb 19 10:51 192.168.191.93.cfg
Thanks.
Re: mrtg for Nagios XI - .rrd files are not being created
Posted: Wed Feb 19, 2020 5:27 pm
by scottwilkerson
aastaguy wrote:
ERROR: unable to open include file: /etc/mrtg/conf.d/*.cfg
This is quite bizarre because you were actually able to list the directory as root
Let's run the following:
Code: Select all
chown apache.nagios -R /etc/mrtg
chmod ug+wr -R /etc/mrtg/conf.d
Then try this again
Code: Select all
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
Re: mrtg for Nagios XI - .rrd files are not being created
Posted: Wed Feb 19, 2020 5:29 pm
by scottwilkerson
Also, what version of Nagios XI are you running?
And the version of the Switch wizard from Admin -> Manage Config Wizards (latest is 2.5.2)?
Re: mrtg for Nagios XI - .rrd files are not being created
Posted: Wed Feb 19, 2020 6:58 pm
by aastaguy
I agree on the bizarre part! After I change permissions, I get the same error:
ERROR: unable to open include file: /etc/mrtg/conf.d/*.cfg
/usr/local/nagios/bin/nagios –help
Nagios Core 4.4.5
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2019-08-20
License: GPL
Website:
https://www.nagios.org
I am running 2.4.3 for the Network switch/router config wizard.
Thanks!
Re: mrtg for Nagios XI - .rrd files are not being created
Posted: Thu Feb 20, 2020 7:56 am
by scottwilkerson
I would strongly suggest updating the wizard as there were a few versions causing similar errors
what do you get when you run
Code: Select all
su nagios -c 'ls -l /etc/mrtg/conf.d/*.cfg'
Re: mrtg for Nagios XI - .rrd files are not being created
Posted: Thu Feb 20, 2020 11:28 am
by aastaguy
-rw-rw-r-- 1 apache nagios 11712 Nov 8 2018 /etc/mrtg/conf.d/172.16.191.90.cfg
-rw-rw-r-- 1 apache nagios 11717 Nov 8 2018 /etc/mrtg/conf.d/172.16.191.91.cfg
-rw-rw-r-- 1 apache nagios 15807 Feb 19 10:51 /etc/mrtg/conf.d/192.168.191.93.cfg
I will update now and see what happens. I will report back.
Thanks!