[mrtg] Re: threshold alert every 2 hour, not every 5 minutes

Lozano_Art Lozano_Art at lacoe.edu
Mon Jun 13 18:12:45 MEST 2005


Hi Dan,

   I had this same issue, but I wanted the alert to arrive at most one
per hour (and to reset after one hour).  If you run some type of
Unix/Linux this is easily solvable.  I use FreeBSD, so you may need to
tweak the shell script syntax if you use something else.  Instead of
just e-mailing a text message, I do that and then add some additional
text that I check for on subsequent runs.  After one hour, I reset the
text message to remove that additional text (via cron).  Here is the
shell script that I use:

if cat /usr/local/www/data/pixconn.msg | grep alertsent > /dev/null
        then sleep 5
        else (  cat /usr/local/www/data/pixconn.msg | mail
recipient1 at test.edu;
                cat /usr/local/www/data/pixconn.msg | mail
recipient2 at test.edu;
                cat /usr/local/www/data/pixconn.msg | mail
recipient3 at test.edu;
                cat /usr/local/www/data/pixconn.msg | mail
recipient4 at test.edu;
                cat /usr/local/www/data/pixconn.msg | mail
recipient5 at test.edu;
                cat /usr/local/www/data/alertsent >>
/usr/local/www/data/pixconn.msg )
fi

alertsent is a text file that contains the word "alertsent" which is
appended to the alert message on the first go round and is checked for
on subsequent runs.  On the hour I have cron copy the original alert
message to overwrite the one that has "alertsent" appended to it.

Make sure to set the file permissions of the script to executable, i.e.
chmod 555.

Regards,

-Art

-----Original Message-----
From: mrtg-bounce at list.ee.ethz.ch [mailto:mrtg-bounce at list.ee.ethz.ch]
On Behalf Of Dan Wozniak
Sent: Friday, June 10, 2005 10:40 AM
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] threshold alert every 2 hour, not every 5 minutes


Every 5 minutes, I'm having my MRTG server poll my router for the
bandwidth status.  Every time it polls, it checks the input against the
defined threshold boundary which I set.  If the threshold is broken, it
calls a perl script which then sends out an email.  

If the T1 maxes out for 30 minutes, I'd receive 6 email messages
notifying me of the threshold break.   This is unreasonable.  I want to
receive 1 email message only if the T1 maxes out for 2 hours straight.
Does anyone have any ideas on how I would go about doing this?  Thanks
in advance.

--Dan

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