<div>Hi Chris,</div>
<div> </div>
<div>As far as I know, you would need to use a SCRIPT line in hobbit-alerts. The example that Henrik gave is quite simple and I would be very careful about how you use it... For example, if you run a backup, or a one off job that does something CPU intensive that would not be considered a fault, yet it did trigger a CPU threshold breach, you may actually triger an event that kills and restarts a perfectly healthy process.</div>

<div> </div>
<div>Your best approach is to see if there is something that is very unique about your problem and build a test around it, for example, use ps or top to give you the process using the most cpu, if that process is your usual suspect and cpu usage is greater than 80% and it has been that way for five minutes, then take an action and report up to hobbit that an action has been taken...</div>

<div> </div>
<div>Cheers</div>
<div> </div>
<div>Phil<br><br></div>
<div class="gmail_quote">2008/4/15 Chris Wopat <<a href="mailto:chrisw@supranet.net">chrisw@supranet.net</a>>:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Henrik Stoerner wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d">On Fri, Apr 11, 2008 at 08:56:02AM -0500, Chris Wopat wrote:<br></div>
<div class="Ih2E3d">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px; BORDER-LEFT: #ccc 1px solid">Is there a cleaner way built in that will just say "if service FOO is red then on client run script ext/BAR.sh"?<br>
</blockquote><br>There is. You use the Hobbit "query" command to probe the status, and<br>then act accordingly. To use your example with the "cpu" status going<br>red:<br><br>  #!/bin/sh<br><br>  CPUCOLOR=`$BB $BBDISP "query $MACHINE.cpu" | awk '{print $1}'`<br>
  if test "$CPUCOLOR" = "red"<br>  then<br>      # Kill some cpu hogging processes<br>      .... whatever it takes ....<br>  fi<br>  exit 0<br><br>The "query" command returns the first line of the current status, and<br>
the first word is the current color. You probably will want to put in<br>some sort of sanity check so you don't trigger this too often. Or<br>perhaps just log the fact that it triggered.<br></div></blockquote><br>Excellent, was unaware of this query feature. The script above looks like it would perfectly deal with my situation if I were to put it in cron on the client machine, which may be suitable.<br>
<br>Is there some way to tell the hobbit server to execute this script on the client, or would something in a SCRIPT line in a hobbit alert, likely using ssh keys, be the only way?<br><font color="#888888"><br>--Chris</font> 
<div>
<div></div>
<div class="Wj3C7c"><br><br>To unsubscribe from the hobbit list, send an e-mail to<br><a href="mailto:hobbit-unsubscribe@hswn.dk" target="_blank">hobbit-unsubscribe@hswn.dk</a><br><br><br></div></div></blockquote></div><br>
<br clear="all"><br>-- <br>Tel: 0400 466 952<br>Fax: 0433 123 226<br>email: philwild AT <a href="http://gmail.com">gmail.com</a>