On Mon, 31 Oct 2011 15:40:02 -0500, Taylor Lewick <tlewick at tradebotsystems.com> wrote:
Hi all. Is it possible to control the times an HTTP URL test is performed?
I know I can add http://www.sample.com and use regexs to look for an occurrence of the word Fail, but we would only like it to check once or twice per day, say at 7:45 and then once more at 8:25. I know its easy to control the timing of when the alert is sent. But can I limit when the test is run? Short of creating an ext-script, not sure how I do that in xymon.
There is, but it is a bit of work.
- Change the XYMONNETWORK setting in xymonserver.cfg to "standard".
- Either add the "--test-untagged" option to your xymonnet command in tasks.cfg, or add "NET:standard" to all of your normal hosts.
- Add a "NET:morningcheck" to the host(s) that have this particular schedule.
You now have a setup where the normal network checks will test all servers, except the ones with the special schedule.
So, to run the morning check on the special hosts, create an extension script with this:
#!/bin/sh XYMONNETWORK=morningcheck export XYMONNETWORK exec xymonnet $*
Put this in ~xymon/server/ext/morningcheck and make that file executable.
Then configure tasks.cfg to run this at the specific times you want. In tasks.cfg, add this:
[morningcheck0745] CMD $XYMONHOME/ext/morningcheck --validity=60 [... any other xymonnet options ...] CRONDATE 45 7 * * * [morningcheck0815] CMD $XYMONHOME/ext/morningcheck --validity=1440 [... any other xymonnet options ...] CRONDATA 15 8 * * *
The --validity options are to make sure the checks don't go purple, since you won't be updating the status every 5 minutes.
The same technique can be used if you want to run checks with different intervals, e.g. if you have hosts that must be checked more often than once every 5 minutes.
Regards, Henrik