<div dir="ltr">Hi Christian<div><br></div><div>TL;DR: Xymon will use the first line for the test in the analysis.cfg file that matches either hostname or class.</div><div><br></div><div>As far as I can tell, it's the first matching line that wins. For instance, the MEMACT line that will match a Linux host called LINUX-1 will be the line in CLASS=linux, setting MEMACT=80/85. If you moved the HOST=LINUX-1 above CLASS=linux then that would match instead, so MEMACT=85/90. And if you moved the DEFAULT entry above that, then you would have MEMACT=90/95. This is why the example analysis.cfg says that the DEFAULT section "must be placed at the end of the file". It's also why you can have two lines for the same test in the same section, and only the first one will be used.</div><div><br></div><div>Internally, Xymon converts every rule line into a certain structure. You can dump this structure using "xymond_client --dump-config", with the format being "<TESTNAME> <alert parameters> [HOST|CLASS]=<section>". You can then check each line to see if it is the test you're interested in, and if it matches either class or hostname then those are the parameters it will use for colour selection.</div><div><br></div><div>Also note that the class defaults to the OS name, but can be different. So in essence the flow is effectively like this:</div><div><br></div><div>Repeat for each line:</div><div>    Is the line for the test we're interested in? (eg MEMACT)?</div><div>    If so, does the section name match the OS or the class or the hostname?</div><div>    If so, this is the line for you -> exit</div><div><br></div><div>Cheers</div><div>Jeremy</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 11 Dec 2020 at 22:26, Becker Christian <<a href="mailto:christian.becker@rhein-zeitung.net">christian.becker@rhein-zeitung.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="DE">
<div class="gmail-m_-5384485080762902707WordSection1">
<p class="MsoNormal">Hello to the list,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">this is probably the 50st question about this…..<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Can anybody guide me to understand, how individual machine thresholds, default thresholds and class thresholds are interpreted in analysis.cfg for different servers and in which order?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Let me say this is my analysis.cfg (<i><span style="color:rgb(0,176,240)">this is
<u>not</u> my working analysis.cfg, it’s shown here just to ask my question</span></i>):<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(0,112,192)"># Drop windows servers below here<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">   
<span style="color:red">CLASS=win32</span><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">           
<span style="color:rgb(112,48,160)">MEMACT  85 90  <u></u><u></u></span></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)">            MEMACT  85 90 
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)">            MEMSWAP 85 90   
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">   
<span style="color:red">HOST=WINDOWS-1</span><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)">            MEMACT  97 98 
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(0,112,192)"># Drop powershell configured servers below here<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">   
<span style="color:red">CLASS=powershell</span><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)">            MEMACT  90 95 
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)">            MEMACT  90 95 
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)">            MEMSWAP 90 95   
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">   
<span style="color:red">HOST=WINDOWS-2</span><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)">            MEMACT  90 92 
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(0,112,192)"># Drop linux servers below here<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">    <span style="color:red">CLASS=linux</span><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">           <span style="color:rgb(112,48,160)">PROC    %(syslogd|syslog-ng|rsyslogd)<u></u><u></u></span></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)">            PROC   sshd<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)">            MEMACT  80 85 
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)">            MEMACT  80 85 
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)">            MEMSWAP 80 85   
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">   
<span style="color:red">HOST=LINUX-1</span><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)">            MEMACT  85 90 
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(0,112,192)"># Default values<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">   
<span style="color:red">DEFAULT</span><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New"">           
<span style="color:rgb(112,48,160)">DISK    * 90 95<u></u><u></u></span></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)">            MEMSWAP 80 90<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-family:"Courier New";color:rgb(112,48,160)">            MEMACT  90 95<u></u><u></u></span></p>
<p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I have difficulties to understand, how the values would be applied. Is it that way, that it looks to the class of a host and applies the values of the class first, then the rule per hostname, and then the default? Or does it stop at the
 first match?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Regards, greetings from Germany<u></u><u></u></p>
<p class="MsoNormal">Christian<u></u><u></u></p>
</div>
</div>

_______________________________________________<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" rel="noreferrer" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
</blockquote></div>