[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Alerts - HOSTS matching regular expressions.
- To: hobbit (at) hswn.dk
- Subject: Alerts - HOSTS matching regular expressions.
- From: Kii NODA <kii.noda (at) gmail.com>
- Date: Thu, 28 Jan 2010 22:45:26 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=yCPp7hnRHxYYpLNkExYx6Q+EpNGSU4dfgVHr2v5C6as=; b=MF7Z0/bJOckdZ+Ia/cSIGtczWihkRQ1Sr7IbVWQy/1+sSqk2sZ0tBczGOkcAsif2NG TC0d8QMpOyTTQylYWOLWZC1wDBWTH8k3eP+T6zZcMEpcFTTb5p5OXdf3CddnZ80QJ9Ff h1GnosYEIoqddhec3msHEucsAO+jTf4+76h/I=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=rSkR2R1d8HlFECDBcN0H3zcC6FNAbGPGLI+inIU4y1PQWloQH4tGrUYQqy21DEWJFr KVcjXUqc6Hm4j8vAckqhws2F/EL41p23BX8T3b/b33UTbuEmri60eT8jNh3mhX9xFCOv apG033lmEWd8vpqqCcedMmfs0djFnlphNMe0Q=
Hi everyone,
As you may have already been aware by now, we're here to stay. :)
Here's one interesting problem (and maybe simple) for you: We've seen that
"HOST=%^asd$" matches both hosts named "asd" and "asdf", not respecting the
"$" at the end. Can you guys please confirm that regex matching for "HOST="
does not care about the "$" sign?
For those that need some expanded case-study (all others can now stop),
here's the story behind: we are managing various servers of ours and our
customers. Due to the fact that we do not control DNS entries for all these
machines we have come up with a naming scheme like this:
--- cut here ---
junkyard-starbox # clientID=junkyard, starbox=actual machine
junkyard-starbox-v_trash # v_trash=vserver named trash running on starbox
junkyard-starbox-v_trashcan # v_trashcan=vserver named trashcan running on
starbox
junkyard-starbox-x_dustbin # x_dustbin=xen server running on starbox
--- and here ---
We need to send these "special" alerts:
* ONLY cto (at) junkyard.tld for events on junkyard-starbox-v_trash
* ONLY ceo (at) junkyard.tld for events on junkyard-starbox-x_dustbin
Also, we need to send these alerts for all other hosts & events:
* stars (at) sysadmins.tld for purple, yellow & red w/ REPEAT=60
* cto (at) sysadmins.tld for red w/ DURATION>30 and REPEAT=60
* cto (at) sysadmins.tld for yellow&purple w/ DURATION>60 and REPEAT=60
Exercising our brain muscles we came up with these:
--- cut here ---
#alert CTO for v_trash
HOST=junkyard-starbox-v_trash
MAIL=cto (at) junkyard.tld
#alert CEO for x_dustbin
HOST=junkyard-starbox-x_dustbin
MAIL=ceo (at) junkyard.tld
#stop alerting for the private boxes above
HOST=*
IGNORE HOST=%^junkyard-starbox-(v_trash|x_dustbin)$
HOST=* COLOR=purple,yellow
MAIL=stars (at) sysadmins.tld REPEAT=60 RECOVERED NOTICE
MAIL=cto (at) sysadmins.tld DURATION>60 REPEAT=60 RECOVERED NOTICE
HOST=* COLOR=red
MAIL=stars (at) sysadmins.tld REPEAT=10 RECOVERED NOTICE
MAIL=cto (at) sysadmins.tld DURATION>30 REPEAT=60 RECOVERED NOTICE
--- and here ---
However, even with the "$" at the end of our regex we are no longer
receiving any alerts for v_trashcan because the regex wrongly matches on the
"IGNORE HOST=" line. We could use 2 lines to match each host on its own line
but that's not the point of this exercise.
So, can anyone confirm our finding?
--
kN