From: trygvelu@bug.itea.ntnu.no
On Wed, 4 Aug 1999, Utsav Ratti wrote:
>
> I want to use the 'monitor-thresholds' tag. The reference guide describes
> its functionality really well, but one thing isn't clear: what happens when
> a threshold is exceeded? How do I call an external script to send an alert
> via e-mail or pager? The guide mentioned traps, but where do these go?
I played around a little with modifying the 'value' monitor to sending a
mail when a threshold is exceeded. You'll have to look into the file
Monitor.pm in cricket's lib/ and specifically the Alarm(), Clear() and
sendMonitorTraps() subs.
Modifying the sendMonitorTraps() to something like 'sendMonitorMail()'
should be pretty straight forward.. (Just include your favourite sendmail
routine)
There's been little discussion about this feature yet, maybe someone could
go more in-depth explaining things.
I, for one, would like to put some more functionality in this, eg have
multiple monitors on a target for different threshold/time pairs. I think
some new monitor would have to be built (monValueOverTime eg), and it
could look something(?) like this in the config
#monitor if value since last update exceeds 80%
monitor-thresholds = "myds:value:0:80"
trap-address = some@address
#monitor if value exceeds 60% over 15min period
monitor-thresholds = "myds:valueovertime:15:0:60"
trap-address = some@other.address
I've only thought a little about this, I'm not even sure if you can define
multiple monitor/trap-address pairs on the same target? If not, I could
probably hardcode the address in the new monitor.
but now I'm babbling
-- Trygve Lunheim NTNU ITEA/Nett--------------------------- ONElist Sponsor ----------------------------
GET WHAT YOU DESERVE! A NextCard Platinum VISA: DOUBLE Rewards points, NO annual fee & rates as low as 9.9 percent FIXED APR. Apply online today! http://www.onelist.com/ad/nextcard1
------------------------------------------------------------------------
This archive was generated by hypermail 2b29 : Mon Mar 06 2000 - 19:00:59 PST