<div class="gmail_quote">On Wed, Apr 29, 2009 at 2:37 AM, Wouter Schoot <span dir="ltr"><<a href="mailto:wouter@schoot.org">wouter@schoot.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
I'm using a few HTTP checks to see how fast (and if) a website responds. However, some are known to be slower than others and I want therefor some sites not to trigger an alert or at least not if it doesn't respond in 10 seconds, but for instance 20 seconds. How can I achieve this for 1 check, not globally for all HTTP checks?</blockquote>
<div><br></div><div>I don't think you can do that at present, not with the builtin HTTP check.  On the other hand, an external script can do whatever you can dream up.  Here's something similar to what I set up for about 2500 web server checks:</div>
<div><br></div><div>Parent script:</div><div><br></div><div>   #!/bin/bash</div><div>   /home/hobbit/server/ext/bb-url.sh 10 <a href="http://server1.domain.com">server1.domain.com</a> </div><div>   /home/hobbit/server/ext/bb-url.sh 20 <a href="http://server2.domain.com">server2.domain.com</a> </div>
<div>   ..... etc.....</div><div><br></div><div><br></div><div>Child script:</div><div><br></div><div>   #!/bin/bash</div><div>   curl -s -S -L -m $1 -o /dev/null http://$2</div><div>   if [ "$?" -ne "0" ]; then</div>
<div>      COLOR=red</div><div>      MESSAGE="something bad happened: url=http://$2"</div><div>   else</div><div>      COLOR=green</div><div>      MESSAGE="everything is ok: url=http://$2"</div><div>   fi</div>
<div>   $BB $BBDISP "status $2.http $COLOR `date`</div><div>$MESSAGE"</div><div><br></div><div><br></div><div>Obviously that can get a lot more complicated.  You'd need to kick off the parent script by adding a section to the server/etc/hobbitlaunch.cfg file.  Or you could do what I did and have the parent script run by cron, which makes it easier to schedule the checks to run at specific times.</div>
<div><br></div><div>Ralph Mitchell</div><div><br></div></div>