[mrtg] Re: crontab & MRTG emails

Andrew Hull list at racc2000.com
Tue Oct 18 14:59:07 MEST 2005


Shane,
My solution did not use cron, but it achieves the desired results. I 
used a ".forward" file in the user's home dir that runs MRTG.


[mrtg at tbx mrtg]$ cat .forward
\mrtg  		 # This keeps a copy in the local account also
user at domain.com  # Address to send mail to


Just create your own version in the home dir of the user that is running 
MRTG and that should do it. Permissions should be -rw------- (600).

Disclaimer: It is possible to configure Sendmail so that it ignores this 
file, and the uber-security-minded may prefer it that way.

Check out
http://www.feep.net/sendmail/tutorial/intro/forward.html
for a .forward tutorial; google has many more also.

Andrew

Shane Presley wrote:
> Hello,
> 
> I'm running MRTG on a Red Hat system, every 5 minutes through cron.
> 
> 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/bin/mrtg /etc/mrtg/mrtg.cfg
> 
> If MRTG experiences any errors (like a host is down) it sends an email
> to root.  I would prefer those e-mails to go to someone else.  So I
> tried this...
> 
> 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/bin/mrtg
> /etc/mrtg/mrtg.cfg 2>&1 | mail -s "MRTG Report"  someone at domain.com
> 
> However, that creates an e-mail EVERY 5 minutes, even if things are
> okay.  I am guessing it has something to do with stdout vs stderr. 
> Any idea how to structure the cron so I get emails to
> someone at domain.com, not root.
> 
> Thanks
> Shane
> 
> --
> Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
> Archive     http://lists.ee.ethz.ch/mrtg
> FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
> WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi
> 
> 

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the mrtg mailing list