[mrtg] Re: E-mail Alarm for MRTG.
Justin Shore
listuser at vinnie.ksu.ksu.edu
Wed Aug 30 06:09:50 MEST 2000
You might try some redirection. I always forget the format so man
bash to figure it out for sure:
*/5 * * * * /usr/local/mrtg-2.9.0pre23/mrtg ~/configs/mrtg.cfg
2>&1 > ~/logs/mrtg-output.log
The 2>&1 part is the important part and I can't remember if that's
the right format or not since I dont' use it often. It basically
redirects STDERR to STDOUT so all output could be logged to file, not
just STDOUT.
Justin
At 8:43 AM +0200 8/29/00, Kenneth Laulund Nielsen wrote:
>Hi
>
>Is it then possible to have mrtg put the output in an log file insted of
>
>mailing it to an user? Because it is very annoying to mhave the mail box
>filled if a machine is not up and running!!
>
>Kenneth L. Nielsen
>
>
>Justin Shore skriver:
>
>> While creating a mail alias or moving the cron stuff to
>> another user would work, it basically sucks because you have to redo
>> what you've already done, changing your habits, adding users,
>> actually requires work, blah blah blah. Want an easy solution? When
>> crond runs something and it generates a STDOUT or STDERR it sends
>> mail to the owner of the crontab. That's a given. To change this
>> behavior, add this line to your mrtg user's crontab:
>>
>> MAILTO="jack at talink.net"
>>
>> Put it right before your block of MRTG cron entries so it defines
>> that environment variable before they run. From that point in the
>> crontab on all STDOUT and STDERR will be sent to the user you define.
>> Likewise if you don't want any mail sent you could make it MAILTO="".
>> If you want your MRTG user to actually receive certain pieces of
>> mail, put them at the beginning of the crontab before your MAILTO tag.
>
>>
>> For that tidbit of cron joy and many others...
>>
>> man 5 crontab
>>
>> HTH
>> Justin
>
>
>
>--
>Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
>Archive http://www.ee.ethz.ch/~slist/mrtg
>FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
>WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
--
--
Justin Shore K-State Linux Distro Mirror, Sysadmin
macdaddy at vinnie.ksu.ksu.edu
<http://vinnie.ksu.ksu.edu/mirror/rpm2html>
<ftp://vinnie.ksu.ksu.edu/pub/mirror/linux>
*Internet2 Users*
<ftp://quest.ksu.ksu.edu/pub/mirror/linux>
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://www.ee.ethz.ch/~slist/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the mrtg
mailing list