What I have
is a job that monitoring a web page using the http ping script that comes
with MOM. What I have it do is if the page fails after 3 attempts it will
restart the web services I have this running as a timed event every 5
minutes.
So if the page fails after 3 attempts within say 15 minutes) I want a script
to page or notify the on call. But only after the 3 failures. My dilemma is
not that I can't create a script to monitor the number of times the event
has occurred but that I want it to say within 15 minutes 3 events have
occurred and I need to notify someone. But if 3 events occurred in 8 hours
to say, ok everything is fine.
Contributed
By: Mike Betts [MVP MOM]
Have your http ping script increment a state variable, called "failed pages"
or something, each time the ping script detects the webserver is down. Have
the http ping script run, as you say, every 5 minutes.
Now create another script, to run on the same machine, as a timed event
which runs every 15 minutes. This script should examine the value of "failed
pages". If it is 3 then raise an alert. If it is less than 3 then simply
have the script reset it to 0. Using this method you will only fire an alert
when the ping script has failed 3 times in a row, i.e. in 15 minutes.
In order to reset the variable if it doesn’t meet the criteria you’ll have
to add a line something like the following to your script:
totalfailedpings=0
|