Page 1 of 1

Remove email id from the cron job for mrtg

Posted: Wed Oct 21, 2015 10:57 am
by tthomas
Hi

Nagios server is sending emails with the below subject line to particular email ID
Sender ID : root@nagiosserver
Subject Line : Cron <root@nagiosserver> 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

We have checked crontab running with this root user but in that as well but no email ID is mentioned also we have checked in the all above mentioned files but no luck,
Could anyone suggest how we can stop sending these emails as we can not stop cron job running for mrtg as its generating graph.

Re: Remove email id from the cron job for mrtg

Posted: Wed Oct 21, 2015 5:15 pm
by jolson
Let's check on your crontab for the root user:

Code: Select all

crontab -l
ls -lR /etc/cron*
Any crontabs that look particularly suspicious should have 'cat' run against them. Let us know your results!

Re: Remove email id from the cron job for mrtg

Posted: Wed Oct 21, 2015 7:45 pm
by SteveBeauchemin
You could edit the cron file and make a simple change.

Code: Select all

vi /etc/cron.d/mtrg
At the top, add these lines - then you can make it stop sending at all. The comments
will help you remember how to send it somewhere if you change your mind later.

Code: Select all

# Send mail to No one
MAILTO=""
# Send mail to...
#[email protected]
It is probably sending some error messages. Cron normally sends nothing if all is well.
If is is sending information about some Subroutine things, there is a way to stop them
if you are interested. If so, read my last post on the topic about SNMP_Session.pm problems.
https://support.nagios.com/forum/viewto ... =6&t=34916

Just a suggestion.

Steve B

Re: Remove email id from the cron job for mrtg

Posted: Thu Oct 22, 2015 2:32 pm
by lmiltchev
tthomas, did jolson and/or SteveBeauchemin answer your question?

BTW, do you see any errors when you verify the MRTG syntax?

Code: Select all

LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
Note: No output is good - means no errors.