[hobbit] Help with a custom test script
Q
q at tippett.com
Tue Aug 28 16:59:33 CEST 2007
Thanks Henrik,
That did the trick for status and helped me write a few more testes. .
Your help is very much appreciated.
I still need to work out how to do rrd data I am starting to do research
on that but if anyone has any suggestions I would be glad to see them.
Q
Henrik Stoerner wrote:
> On Sun, Aug 26, 2007 at 03:39:21PM -0700, Q wrote:
>
>> I am new to writing custom scripts and looking for advice on how to
>> write a test to monitor the status of a machine in our render farm. Each
>> machine is broken down into a number of CPU cores. We have a command
>> that displays the status of each core in the format per line of
>> "<machine name>_<core number> in|out <partition name>" (i.e. testbox_0
>> in testpartition). So here is the part I an trying to work out. A
>> machine with 4 cores will produce 4 lines each with it's own status. I
>> would like to to include all cores in one test. I would like to produce
>> a YELLOW status if any core is labeled as out and RED if they are all
>> listed as out. I would also like to make rrd graphs that shows the in
>> and out time for each core. Any help would be greatly appreciated.
>>
>
> This doesn't do the graph, but it will give you the status you want:
>
> #!/bin/sh
>
> # Change this command to the one you use to collect the data
> getthestatus >$BBTMP/corestat.$$
>
> OUTCOUNT=`grep -c " out " $BBTMP/corestat.$$`
> if test "$OUTCOUNT" = "4"
> then
> COLOR=red
> elif test "$OUTCOUNT" -gt 0
> then
> COLOR=yellow
> else
> COLOR=green
> fi
>
> # Note: This command spans multiple lines
> $BB $BBDISP "status $MACHINE.cores $COLOR `date`
>
> $OUTCOUNT cores out
>
> `cat $BBTMP/corestat.$$
> "
>
> rm $BBTMP/corestat.$$
> exit 0
>
>
> Regards,
> Henrik
>
>
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe at hswn.dk
>
>
More information about the Xymon
mailing list