MRTG cron job mail

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
TBT
Posts: 621
Joined: Wed May 18, 2011 1:26 pm

MRTG cron job mail

Post by TBT »

We are currently receiving emails from the /etc/cron.d/mrtg cron entry (Debian 10 installation) every few minutes from each of our Nagios machines.

Sample headers:

Code: Select all

From:	Cron Daemon <root@host.domain.com>
Subject:	Cron <root@host> 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
Date:	Tue, 15 Feb, 22 6:35:11PM
Message-ID:	<E1nK2fP-0001lR-KH@host>
And the body of the message is a listing mrtg errors, sometimes thousands of lines.

Would it be okay to redirect the output of that cron job to /dev/null, similar to the other Nagios cron jobs we have?
Nagios XI 5.9.1 (8 Servers)
Nagios Fusion 2024R1.0.2
User avatar
jdunitz
Posts: 235
Joined: Wed Feb 05, 2020 2:50 pm

Re: MRTG cron job mail

Post by jdunitz »

It might be better to address the errors (perhaps you have a lot of abandoned files that need to be cleaned up?) but as long as MRTG seems to be working and your perfdata is current/seems accurate/is doing what you want/etc, you should be OK to direct it to /dev/null, or at least to a single file that gets overwritten each time, just in case you feel the need to refer to it sometime.

Code: Select all

[root@jpd-nagiosxi-one cron.d]# cat /etc/cron.d/mrtg
*/5 * * * * root 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 --user=nagios --group=nagios
[root@jpd-nagiosxi-one cron.d]#

--Jeffrey
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked