<div dir="ltr">jc,<div><br></div><div>Using your idea...</div><div>PAGE=mypage COLOR=red,yellow</div><div>   MAIL <a href="mailto:me@here.com">me@here.com</a></div><div><br></div><div>...when cpu is green, yellow, purple, or red --test now always returns a mail -s with CRITICAL (RED) message.</div><div><br></div><div>which may actually BE correct, since elsewhere on the page there is a red status and I've now put the COLOR on the main line referencing the whole page. In an attempt to narrow it back down to the one host, however, I used HOST=^Server1*, instead of PAGE=, but STILL get the CRITICAL (RED) message in the --test run, but actually got an email regarding the yellow cpu status (and not for a different yellow status on the same page).</div><div><br></div><div>--dump-config returns...</div><div>HOST=^Server1* COLOR=yellow,red     <---- NOTICE REVERSED COLORS (see above)??</div><div>MAIL <a href="mailto:me@here.com">me@here.com</a> FORMAT=TEXT REPEAT=30</div><div><br></div><div>Interestingly enough, when I use a --color parameter with the --test, it performs correctly...</div><div>If --color of cpu is yellow, --test returns a warning (YELLOW) message.<br></div><div>If --color of cpu is red, --test returns a CRITICAL (RED) message.</div><div>If --color of cpu is green or purple, --test returns a FAILED (due to color) message.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div>By the way, my ALERTCOLORS="red,yellow,purple"</div><div><br></div><div>Could it possibly be that the --test feature needs more testing, and that the alerting is actually working the way I expect it should?</div><div><br></div><div>Thanks,</div><div>David</div><div><br></div><div><br></div><div class="gmail_quote">On Thu, Nov 12, 2015 at 10:41 AM, J.C. Cleaver <span dir="ltr"><<a href="mailto:cleaver@terabithia.org" target="_blank">cleaver@terabithia.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Thu, November 12, 2015 6:44 am, David Welker wrote:<br>
<br>
> Thanks!  Makes sense.  I guess the alerts.cfg.5.html file needs to be<br>
> changed?  That's where I was looking...<br>
</span>> *COLOR=color[,color]* Rule matching an alert by color. Can be "red",<br>
<span class="">> "yellow", or "purple". The forms "!red", "!yellow" and "!purple" can also<br>
> be used to NOT send an alert if the color is the specified one.<br>
><br>
> Well, that fixed my first issue.  Now when the cpu is reporting green, the<br>
> --test gives me a "Failed" message as expected, but with the cpu reporting<br>
> yellow, I get the same "Failed" message - failed due to color!<br>
><br>
> Even took xymoncmd out of the equation and the result is the same.<br>
> Took out EXSERVICE as well.<br>
><br>
> Now all I have in alerts.cfg:<br>
> PAGE=mypage<br>
>   MAIL <a href="mailto:me@here.com">me@here.com</a> COLOR=%(red|yellow)<br>
><br>
> ..yet when I run:<br>
>  xymond_alert --test <a href="http://server.com" rel="noreferrer" target="_blank">server.com</a> cpu<br>
> I get..<br>
> #### DATE TIME Failed 'MAIL <a href="mailto:me@here.com">me@here.com</a> COLOR=%(red|yellow)' (color)<br>
><br>
> Any other suggestions?  For example, do I have to restart the server after<br>
> making changes to the alerts.cfg file?<br>
<br>
<br>
</span>I believe the proper syntax there is simply:<br>
<br>
PAGE=mypage COLOR=red,yellow<br>
   MAIL <a href="mailto:me@here.com">me@here.com</a><br>
<br>
COLOR can be a list of options, unlike most of the other filters (such as<br>
EXSERVICE) which must either lexically match OR have to be prepended with<br>
a '%' to enter "pcre-regex" mode. Additionally, COLOR= appears to not be<br>
allowed as a per-recipient filter; in this case, it'll need to be on the<br>
main line.<br>
<br>
One easy way to check the syntax and rule logic is to run xymoncmd<br>
xymond_alert --dump-config . What shows up in the result will be how the<br>
alert system interprets it.<br>
<br>
Also, to actually enable 'yellow' alerts, you'll want to ensure the color<br>
is added to "$ALERTCOLORS" in xymonserver.cfg if it's not already.<br>
<br>
<br>
HTH,<br>
-jc<br>
<div class=""><div class="h5"><br>
<br>
<br>
<br>
><br>
> Thanks,<br>
> David<br>
><br>
><br>
> On Wed, Nov 11, 2015 at 10:10 PM, Martin Lenko <<a href="mailto:lenko99@gmail.com">lenko99@gmail.com</a>> wrote:<br>
><br>
>> Hi David,<br>
>> to specify multiple color values you will have to use regular<br>
>> expression.<br>
>> Use something like this in your alert config:<br>
>> COLOR=%(yellow|red)<br>
>><br>
>> The '%' character instructs xymon that following string is a regular<br>
>> expression.<br>
>><br>
>> Regards,<br>
>> Martin<br>
>><br>
>> On 11 November 2015 at 18:46, David Welker <<a href="mailto:dewelker@gmail.com">dewelker@gmail.com</a>> wrote:<br>
>><br>
>>> I admit, this is my first attempt at alerting, so this may or may not<br>
>>> be<br>
>>> user error.  It also could be an issue that is fixed in the latest<br>
>>> upgrade<br>
>>> (I'm still on 4.3.21), but before I resort to that (which will be soon<br>
>>> enough), I wanted to make sure I was at least thinking along the right<br>
>>> line...<br>
>>><br>
>>> The cpu column is reporting green.<br>
>>> The entry in alerts.cfg includes a COLOR=yellow parameter.<br>
>>> Running the xymond_alert --test reports (as expected)...<br>
>>> Failed 'MAIN me@here COLOR=yellow EXSERVICE=conn,disk' (color)<br>
>>><br>
>>> If, however, I change the COLOR to red, or even if I just add it<br>
>>> (COLOR=yellow,red), I get the "Mail alert with command 'mail -s...'"<br>
>>> line<br>
>>> rather than the failed.  Did I do something wrong?<br>
>>><br>
>>> Funny though, either way I don't actually get the email.<br>
>>><br>
>>> Thanks,<br>
>>> David<br>
>>><br>
>>> _______________________________________________<br>
>>> Xymon mailing list<br>
>>> <a href="mailto:Xymon@xymon.com">Xymon@xymon.com</a><br>
>>> <a href="http://lists.xymon.com/mailman/listinfo/xymon" rel="noreferrer" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
>>><br>
>>><br>
>><br>
> _______________________________________________<br>
> Xymon mailing list<br>
> <a href="mailto:Xymon@xymon.com">Xymon@xymon.com</a><br>
> <a href="http://lists.xymon.com/mailman/listinfo/xymon" rel="noreferrer" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
><br>
<br>
<br>
</div></div></blockquote></div><br></div></div>