[mrtg] Re: Thresholds and Alerts via Email ???

Griner, Jeremy griner at susq.com
Thu Aug 19 22:41:38 MEST 1999


In my Unix threshhold script I check for the existence of a threshhold
parameter file which I create when a threshhold is reached.  If it exists
then I skip the routines to send a page/email.  Also, I added a line to my
crontab to remove all threshhold files every hour so I will receive a
reminder each hour but not get the annoying page every 5 minutes.  In my
threshhold ok script, I remove the particular file for that threshhold also.

threshhold.sh:
#!/bin/sh
Path=mrtg/thresh/tmp	#this is where I keep my tmp threshhold files
Parameter=$1
Thresh=$2
CurrVal=$3

if [ -r $Path/$Parameter ] ; then
        RCVRS=none
else

 #Variables to define for mail/paging aliases and command line executables
        RCVRS=your mail alias or your paging alias
        MAIL="mailx -s"  or your mail app command line
        MAIL_SUBJ="MRTG Threshhold Alert"
        PAGE=/usr/local/bin/send_alert    or your paging software's
executable

 #Define text to be sent
        echo_info()
        {
        echo "$Parameter $CurrVal % used"
        }

 #Mail/Page with the text defined above then create the tmp file with touch
so we can check to see if it exists next time
        echo_info | $MAIL "$MAIL_SUBJ" "$RCVRS"
        $PAGE $RCVRS "MRTG $Parameter Threshhold Alert.  $CurrVal % Used"
        touch $Path/$Parameter
fi

Crontab entry to remove the tmp files every hour at 1:02, 2:02, 3:02,
etc...:
2 * * * * rm /home/griner/public_html/mrtg/thresh/tmp/*

Jeremy Griner
Susquehanna Partners

> -----Original Message-----
> From:	Leite, Keith [SMTP:Keith.Leite at GSC.GTE.Com]
> Sent:	Thursday, August 19, 1999 3:59 PM
> To:	'Garth K. Williams'; 'MRTG'
> Subject:	[mrtg] Re: Thresholds and Alerts via Email ???
> 
> Thanks to all for the great input on setting threshold and alerts via NT
> ....
> 
> Keith ...
> 
> -----Original Message-----
> From: Garth K. Williams [mailto:garth.williams at home.com]
> Sent: Thursday, August 19, 1999 1:03 PM
> To: Leite, Keith; 'MRTG'
> Subject: [mrtg] Re: Thresholds and Alerts via Email ???
> 
> 
> I just updated my Thresholds page.  You can find it at
> http://24.66.225.129/snmp4tpc/threshld.htm#MRTG
> 
> The only issue it has is that it will send an email every 5 minutes until
> the threshold breach returnd to normal value.  I'm working on a "once
> every
> 30-60 minutes" type of thing.
> 
> Garth
> 
> Garth K. Williams - Systems Engineer (MCP+I, MCSE, CNA)
> Williams Technology Consulting Services
> Edmonton, Alberta  Canada	Phone: (780) 469-4341
> 
> Web: http://www.wtcs.org	Email: mailto:garth.williams at home.com
> Home of: http://snmp.cjb.net - SNMP for the Public Community
> 
> 
> -----Original Message-----
> From: mrtg-bounce at list.ee.ethz.ch [mailto:mrtg-bounce at list.ee.ethz.ch]On
> Behalf Of Leite, Keith
> Sent: Thursday, August 19, 1999 2:54 PM
> To: 'MRTG'
> Subject: [mrtg] Thresholds and Alerts via Email ???
> 
> 
> 	Hello to the group,
> 
> 	Just wondering I currently am running MRTG on a NT platform and was
> wondering if anyone
> 	out there has had any luck setting some sort of threshold value and
> having MRTG either send a
> 	email message or Page someone ????
> 
> 	ThanX
> 
>     Keith ...
> "THROUGH THE SWITCH; OFF THE ROUTER; OVER THE  T-3
>                       BACKBONE...NOTHING BUT NET!!!"
> 
>                   Information Technology- Network Operations
>                               Keith.Leite at GSC.GTE.COM
> 
> 
> 
> --
> * To unsubscribe from the mrtg mailing list, send a message with the
>   subject: unsubscribe to mrtg-request at list.ee.ethz.ch
> * The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg
> 
> --
> * To unsubscribe from the mrtg mailing list, send a message with the
>   subject: unsubscribe to mrtg-request at list.ee.ethz.ch
> * The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg
> 
> --
> * To unsubscribe from the mrtg mailing list, send a message with the
>   subject: unsubscribe to mrtg-request at list.ee.ethz.ch
> * The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg

--
* To unsubscribe from the mrtg mailing list, send a message with the
  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg


More information about the mrtg mailing list