Remove email id from the cron job for mrtg

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
tthomas
Posts: 39
Joined: Mon Jun 01, 2015 6:54 am

Remove email id from the cron job for mrtg

Post 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.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Remove email id from the cron job for mrtg

Post 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!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Remove email id from the cron job for mrtg

Post 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
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Remove email id from the cron job for mrtg

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked