Is /etc/mrtg/mrtg.d supposed to be empty?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Is /etc/mrtg/mrtg.d supposed to be empty?

Post 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
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Is /etc/mrtg/mrtg.d supposed to be empty?

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Is /etc/mrtg/mrtg.d supposed to be empty?

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Is /etc/mrtg/mrtg.d supposed to be empty?

Post 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

Code: Select all

MAILTO=""
save the file and restart cron by running

Code: Select all

service crond restart
That will stop the emails from being sent.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Is /etc/mrtg/mrtg.d supposed to be empty?

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Is /etc/mrtg/mrtg.d supposed to be empty?

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Is /etc/mrtg/mrtg.d supposed to be empty?

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Is /etc/mrtg/mrtg.d supposed to be empty?

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Is /etc/mrtg/mrtg.d supposed to be empty?

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Is /etc/mrtg/mrtg.d supposed to be empty?

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Locked