[Xymon] Elegant way to run an aggregate ext test over multiple clients?
Vernon Everett
everett.vernon at gmail.com
Wed May 18 03:56:22 CEST 2011
That's probably how I would do it.
I have done something similar to this before, but I no longer have
access to the code.
You need to get all the values together in one script, and grabbing
the web page is a pretty quick and easy way to do so.
A command you may find useful, is this
sed -e :a -e 's/<[^>]*>//g;/</N;//ba'
It will strip most HTML tags, making parsing a lot easier.
However, if Q is being graphed, it will already be on a line by
itself, so you may be able to simply
grep "^Q=[1-9][0-9]*$"
or
grep "^Q:[1-9][0-9]*$"
Depending on how your scripts send the data.
Hope it works..
Vernon
On Wed, May 18, 2011 at 9:32 AM, Elizabeth Schwartz
<betsy.schwartz at gmail.com> wrote:
> Suppose I have a five-server cluster, and on each server there's a
> calculated value, call it Q, and an ext test "qlength" that operates
> on Q and returns a color and a message containing Q.
>
> We want to make a server-side test that does some alerting based on
> aggregate values of Q across all five servers in the cluster. Not a
> combo test, we want to do math, like Sum (Q1...Qn) >Threshold.
>
>
> *One* way to get Q for each server is to write a server-side ext test
> that loops a wget over each host, something like:
>
> wget /dev/null
> http://xymon/xymon-cgi/svcstatus.sh\?HOST=myhost.example.com\&SERVICE=qlength
>
> then parse each server's Q info out of the html and do my arithmetic,
> but is there a more direct way?
>
> thanks for any pointers clues or code snippets
> Betsy
> _______________________________________________
> Xymon mailing list
> Xymon at xymon.com
> http://lists.xymon.com/mailman/listinfo/xymon
>
More information about the Xymon
mailing list