Page 1 of 1
Is /etc/mrtg/mrtg.d supposed to be empty?
Posted: Tue Jul 05, 2016 9:24 am
by eloyd
/etc/mrtg/conf.d is empty. Is it supposed to be? I keep getting these by the hundreds all of a sudden (this is via email from cron):
Code: Select all
Subject: Cron <root@nagiosxi> LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok
Date: Tue, 5 Jul 2016 10:20:03 -0400 (EDT)
ERROR: unable to open include file: conf.d/*.cfg
Re: Is /etc/mrtg/mrtg.d supposed to be empty?
Posted: Tue Jul 05, 2016 10:01 am
by tgriep
If you are monitoring Bandwidth information for Network Interfaces, then there should be config files in that folder.
If you ran the Network Switch / Router Wizard, it will create cfg files in that folder that MRTG uses to generate the bandwidth rrd files that the XI plugin uses to get the bandwidth information for those Ethernet ports.
The MRTG program is run every 5 minutes by CRON and since the folder is empty, you are getting the error messages.
Are you monitoring bandwidth information for Ethernet ports on that XI server?
Re: Is /etc/mrtg/mrtg.d supposed to be empty?
Posted: Tue Jul 05, 2016 10:08 am
by eloyd
No - no network switch/router wizard, but I am running NCPA-based bandwidth usage on remote machine interfaces via check_xi_ncpa_agent. The weird thing is that no configuration changes were made since last week, yet sometime in the past 24 hours, this started.
Re: Is /etc/mrtg/mrtg.d supposed to be empty?
Posted: Tue Jul 05, 2016 10:17 am
by tgriep
That is strange.....
If you want to stop those emails, you can edit the /etc/cron.d/mrtg file and put in the following line
save the file and restart cron by running
That will stop the emails from being sent.
Re: Is /etc/mrtg/mrtg.d supposed to be empty?
Posted: Tue Jul 05, 2016 10:28 am
by eloyd
Yah, I can stop them from being sent, but I'd rather not have them in the first place. Is it necessary to send email saying that the conf.d directory is empty? That seems like a better fix. Otherwise, I tend to think that it's telling me about an error condition and I don't really have an error. Doesn't explain why it started happening ~24 hours ago though.
Re: Is /etc/mrtg/mrtg.d supposed to be empty?
Posted: Tue Jul 05, 2016 10:35 am
by tgriep
The email in generated by cron so adding that line will stop the emails.
To figure out why those emails started, you would have to check all of the log files for any activity at that time.
If a yum update was ran on the server, that could of caused it.
Can you run the following on that server and post the output?
Code: Select all
LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
I want to see if the latest version is installed.
Re: Is /etc/mrtg/mrtg.d supposed to be empty?
Posted: Tue Jul 05, 2016 10:44 am
by eloyd
A yum update is not unlikely, but why would that affect this? None of the files involved were updated:
Code: Select all
[root@nagiosxi ~]# ll /etc/cron.d/mrtg
-rw-r--r-- 1 root root 139 May 11 04:16 /etc/cron.d/mrtg
[root@nagiosxi ~]# cat /etc/cron.d/mrtg
*/5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok
[root@nagiosxi ~]# ll /usr/bin/mrtg
-rwxr-xr-x 1 root root 102208 May 11 04:16 /usr/bin/mrtg
[root@nagiosxi ~]# ll /etc/mrtg/mrtg.cfg
-rwxrwxr-x 1 apache nagios 751 Apr 23 2015 /etc/mrtg/mrtg.cfg
[root@nagiosxi ~]# LANG=C LC_ALL=C /usr/bin/mrtg
Usage: mrtg <config-file>
mrtg-2.16.2 - Multi Router Traffic Grapher
To put it differently, if not having any config files is no reason to panic, then why send the email? They weren't being sent previously.
Re: Is /etc/mrtg/mrtg.d supposed to be empty?
Posted: Tue Jul 05, 2016 10:56 am
by tgriep
Somehow your version of MRTG was downgraded on your server and that is why the emails are being generated.
The older version or MRTG doesn't use the include variable in the mrtg.cfg file which causes an error and an email.
Follow this KB article to upgrade MRTG to the latest version which will stop the errors and emails from being generated.
https://support.nagios.com/kb/article.php?id=511
Re: Is /etc/mrtg/mrtg.d supposed to be empty?
Posted: Tue Jul 05, 2016 11:18 am
by eloyd
Hm. So that's odd, then, isn't it? yum update ends up downgrading an installed Nagios component? Figures it would happen to me.
Thanks. I'll let you know how it all works out.
Re: Is /etc/mrtg/mrtg.d supposed to be empty?
Posted: Tue Jul 05, 2016 11:25 am
by eloyd
Problem solved. We'll see if we can figure out how it got downgraded, but I'm not sure we're going to do much about it. It might be easier to have Nagios do a version check on mrtg for us once a day and warn if it's lower then 2.17.
close at your leisure.