Thanks Henrik,<br><br>So this should do it?<br>HOST=<a href="http://www.foo.com/" target="_blank">www.foo.com</a> <<a href="http://www.foo.com/" target="_blank">http://www.foo.com</a>> SERVICE=http<br>
MAIL <a href="mailto:cio@foo.com" target="_blank">cio@foo.com</a> <mailto:<a href="mailto:cio@foo.com" target="_blank">cio@foo.com</a>> DURATION>2 COLOR=red<br>
SCRIPT /usr/local/bin/restartapache.sh 123456789 REPEAT 1440<br><br>That above will email <a href="mailto:cio@foo.com">cio@foo.com</a> after 2 minutes of RED <br>It will also call up  /usr/local/bin/restartapache.sh and run it once every 24 hours if it's down that long?<br>
<br>Do I need to put in a DURATION on that one also or does it keep the 2 minutes from the above line or does it run it as soon as it see's it's red?  Can I put a DURATION on that also? (eg. SCRIPT /usr/local/bin/restartapache.sh 123456789 REPEAT 1440 DURATION>2 )<br>
<br>thanks!!<br>
<blockquote class="gmail_quote"></blockquote><br><br><br><div class="gmail_quote">On Fri, Dec 23, 2011 at 5:05 PM, Henrik Størner <span dir="ltr"><<a href="mailto:henrik@hswn.dk">henrik@hswn.dk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On <a href="tel:23-12-2011%2022" value="+12312201122" target="_blank">23-12-2011 22</a>:57, Tom S wrote:<br>

</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Thanks.<br>
<br>
So this will work?: (example in alerts.cfg)<br></div>
HOST=<a href="http://www.foo.com" target="_blank">www.foo.com</a> <<a href="http://www.foo.com" target="_blank">http://www.foo.com</a>> SERVICE=http<br>
MAIL <a href="mailto:cio@foo.com" target="_blank">cio@foo.com</a> <mailto:<a href="mailto:cio@foo.com" target="_blank">cio@foo.com</a>> DURATION>2 COLOR=red<br>
SCRIPT /usr/local/bin/restartapache.<u></u>sh<br>
</blockquote>
<br>
Check the alerts.cfg man-page, you need a "recipient" on the SCRIPT command - if you don't use it, just put dummy text after the command.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and in restartapache.sh I would have the following:<br>
#/bin/bash<br>
ssh xymon@web1-server 'sudo /etc/init.d/apache2 restart'<br>
exit<br>
(considering xymon is in the sudoers list)<br>
<br>
How can I make sure that the 'SCRIPT /usr/local/bin/restartapache.<u></u>sh' is<br>
only run once per alert in case of network issues (connecting to port<br>
80) it doesn't keep trying to ssh and restarting the server every few<br>
minutes?<br>
</blockquote>
<br></div>
Use REPEAT to limit it to e.g. once every 24 hours. Note that the repeat-setting gets reset once the alert clears, so it will work OK even if the server goes down at 10 AM, comes back up, and then goes down again at 7 PM; in both cases the script will be called.<br>

<br>
<br>
Regards,<br><font color="#888888">
Henrik</font><div><div></div><div class="h5"><br>
______________________________<u></u>_________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com" target="_blank">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/<u></u>mailman/listinfo/xymon</a><br>
</div></div></blockquote></div><br>