[mrtg] Re: How to configure Alerts on MRTG

Rainer Sokoll R.Sokoll at intershop.de
Fri Mar 14 08:54:10 MET 2003


On Fri, Mar 14, 2003 at 06:24:05AM +0530, Keshav J wrote:

Hi,

>   Please let me know what I have to do, to get Alerts by Email if the Graph
> Value's go beyond a certain limit!! also, where can I set the thresholds, I
> am relatively New to MRTG so please be patient and give as much detail as
> possible!!!

----8<----
ThreshDir: /usr/local/share/it/mrtg/tmp/

[device definitions]

ThreshMaxI[192.168.1.6-cpu]: 95
ThreshProgI[192.168.1.6-cpu]: /usr/local/share/it/mrtg/bin/mailalert.sh
ThreshProgOKI[192.168.1.6-cpu]: /usr/local/share/it/mrtg/bin/mailok.sh
----8<----

mailalert.sh:
----8<----
#!/bin/sh
if [ $1 == "192.168.10.6-cpu" ] ; then
  DEST="<your_mail_addresses_here>"
else
  DEST="<other_addresses_here>"
fi
( echo "load on $1 currently $3%, but should be not more than $2%."
  echo "see http://itcentral.net.j.intershop.de/mrtg/$1.html ") |\
mail -s "load on $1" $DEST
----8<----

mailok.sh:
----8<----
#!/bin/sh
if [ $1 == "192.168.10.6-cpu" ] ; then
  DEST=<your_mail_addresses_here>""
else
  DEST="<other_addresses_here>"
fi
( echo "load on $1 is good, currently $2%."
  echo "see http://itcentral.net.j.intershop.de/mrtg/$1.html ") |\
mail -s "load on $1" $DEST
----8<----


HTH,
Rainer

--
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