[NTLUG:Discuss] need script that sends email message

Bug Hunter bughuntr at one.ctelcom.net
Wed Nov 28 15:03:40 CST 2001


  It is fairly easy.  The mrtg command line can call a script like this:

Target[iits-users]: `/usr/bin/finger @machine.domain.com | wc -l |
/usr/local/bin/iitscount.pl`

  This single line calls /usr/bin/finger , passing the command line option
@machine.domain.com, then it calls word count (wc) with the parameter -l
to count lines, piping the output from finger.  This number is then sent
to a perl script which subtracts the header and tail numbers from the word
count, and puts it out in the triplet format that mrtg requires.

  If you want to, you can check the number to be 0 in the perl script and
then send an email, etc.


bug

On Wed, 28 Nov 2001, Raymond Norton wrote:

> I am setting up our MRTG configs to use the Threshold feature, and send out
> an automated email when traffic reaches 0%. I understand how to make the
> additions to my configs, but I am at a loss how to write a script that can
> be called by MRTG which will send the email when the threshold is reached.
> 
> I am using RedHat 7.1 and Sendmail 8.11.6
> 
> Can anyone help me with this?
> 
> 
> Raymond
> 
> 
> 
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
> 





More information about the Discuss mailing list