[mrtg] Re: Delayed Threshold Actions
Barry Irwin
bvi-mrtg-list at rucus.ru.ac.za
Thu Nov 9 20:39:38 MET 2000
On Thu 2000-11-09 (13:03), Patrick Bartkus wrote:
> My problem is one of timing. What I want is an action to take place (e-mail
> sent, pager paged, etc) if the threshold remains crossed for 15 minutes
> (using the default 5 minute polling). If my CPU remains > 95% utilization
> for > 15 minutes, let someone know.
>
I would suggest having your threshold script touch some kind of lock file
when it is first callled. Subsequent calls can then check the timestamp of
the file ( atime, ctime, mtime etc) or even a timestamp contained within the
file. If the timestamp difference is 15 mins or greater, then performa and
action. The script called on the threshold down should clean up. I'd
probably add a cronjob to clean up once a day as well just incase somethign
dies and a lock file gets erroneously left lying around.
This should be fairly easy to implement in perl , or even sh with a bit of
thinking.
This does however come off the top of my head :-) so ymmv. I've seen
similar schemes implementes in other bits of software.
Barry
--
--------------------------------------------------------------------------
Barry Irwin IRC: balin at zanet (#linux)
bvi at moria.org http://rucus.ru.ac.za/~bvi
Whois BI414 - PMPN8EZ - http://moria.org
--------------------------------------------------------------------------
--
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