<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body>
<p>Den 27-03-2017 14:04, Even Hauge Juberg skrev:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%">
<p>*snippet from my alerts.cfg*</p>
<p> </p>
<div><em>HOST=* RECOVERED=1</em></div>
<div><em>        IGNORE HOST=*</em></div>
<div> </div>
<div><em>HOST=one-host SERVICE=http</em></div>
<div><em>        MAIL someuser@domain.local COLOR=red</em></div>
<div><em>        MAIL </em><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: #ffffff;"><em>someuser@domain</em></span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: #ffffff;"><em>.local</em></span><em> DURATION>5 COLOR=red</em></div>
</blockquote>
<div> </div>
<div>Several problems here.</div>
<div><ol>
<li>"IGNORE" is for a recipient. If you want to exclude a host it is "EXHOST=<hostname>". But having a "HOST=* EXHOST=*" does not make sense.</li>
<li>It is "RECOVERED" by itself, not "RECOVERED=1". </li>
<li>Judging from the whitespace (the blank line), you want the first "HOST=*" to be a rule by itself. It is not, a rule must have a recipient (MAIL or SCRIPT). So all of what you have from this bit of alerts.cfg go into one rule, and probably ends up being interpreted as all "http" alerts going to the two mail addresses, and both of them receiving recovery notifications. Try running "xymoncmd xymond_alert --dump-config" and see how the parsed configuration looks. </li>
</ol></div>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%">
<div> What I'm trying to accomplish is to stop the "I'm OK - recovered" messages. Those messages are irrelevant, so I want those filtered out. The problem though, is that the logic is completely off on this point. The first rule for some reason takes presedense, even though I have explicitly told it to only use that rule IF the host has recovered, no? </div>
</blockquote>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%">
<div>I want it to skip that rule, if it has not yet recovered, send mail to the first user immediately, then to the other user after 5 minutes, but leave those users alone if the service is OK again. Is there a way to accomplish this? </div>
</blockquote>
<div>If you don't want any messages about recovered hosts, just dont put "RECOVERED" anywhere in your config. They are not enabled by default.</div>
<div> </div>
<div> </div>
<div>If you want recovery messages for all of the recipients matching a rule, then put it on the rule specification. E.g.</div>
<div> </div>
<div>HOST=one-host SERVICE=http RECOVERED</div>
<div>   MAIL adam@example.com</div>
<div>   MAIL eve@example.com</div>
<div> </div>
<div>will send alerts and recovery notices to both Adam and Eve.</div>
<div> </div>
<div> </div>
<div>If you only want recovery notices sent to one recipient, then put it on that recipient:</div>
<div> </div>
<div>
<div>HOST=one-host SERVICE=http</div>
<div>   MAIL adam@example.com RECOVERED</div>
<div>   MAIL eve@example.com</div>
</div>
<div> </div>
<div>will send alerts to both Adam and Eve, but recovery messages only to Adam.</div>
<div> </div>
<div> </div>
<div>Regards,</div>
<div>Henrik</div>
</body></html>