<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On 16 Jul 2006, at 04:07, John P. Rouillard wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">In message <<A href="mailto:C35C4EDC-2D0E-47B1-85AF-A5311CEAEF92@altinity.com">C35C4EDC-2D0E-47B1-85AF-A5311CEAEF92@altinity.com</A>>,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Ton Voon writes:</DIV> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">The biggest problem that I've discovered is that the range <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">specification for -w and -c are inverted from the norm. This was <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">noticed when using the library range checking routines. check_disk -w <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">10% means alert if freespace is below 10%, but we normally mean to <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">alert if it is outside the range. So, for instance, check_procs -w <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">1:1 means alert if greater than 1 process.</DIV> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Specifying the freespace always seemed weird to me. If we defined the<SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">used space, it would work better with the -w and -c settings.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>-w 80 (-w 0:80) - warn if more than 80% of the disk used.<SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>-c 90 (-c 0:90) - critical if more than 90% of the disk used.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">However this would be an incompatible change to the command line that</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">doesn't look different from the pre-existing calling format, so it's</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">out unless we implement a flag to request this as Gavin said above.</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Hands up for guilt. I made a change in 1.4 (?) to make it more consistent, but obviously brain was not working correctly. It's only now since I'm trying to use a general library routine for parsing thresholds that I've realised it is wrong.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I've got a hack for check_disk (forcing a @ at the beginning of the <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">range, which means to alert inside), but I was wondering if we should <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">introduce a new way of defining thresholds. I'm thinking something like:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>--freespace="0:5;0:2" (warn if outside 0 to 5, crit if outside 0 <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">to 2)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>--usedspace_percent=";90:100" (no warn, crit if outside 90 to 100)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>--usedinode="100:;200:" (warn if outside 100 to infinity, crit if <SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">              </SPAN>outside 200 to infinity)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">This also matches with perfdata output.</DIV> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Just a nit first, would the new way be in addition to the old way (-w,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">-c), or replace the old way entirely and report an error if somebody</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">tries to use it? I think in addition to is the best for backwards</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">compatibility.</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>I'm going to try and retain the old syntax. However, there's only so much that can be supported backwards. There are some plugins which still try to retain backwards compatibility from the Netsaint days.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>My feeling is this (and please shout out if you think I am too harse/soft): If there are unit tests for the old syntax, and it is not too much development work to retain and it doesn't break anything we want to do moving forward, then we'll support the old syntax. Otherwise, we'll make a note in CHANGES that it will break in a future version, and then break it.</DIV><DIV><BR><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">The -w and -c flags work well if the plugin is only testing for one</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">parameter. However a lot of plugins test for multiple parameters. I</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">have a couple of home grown plugins that test 10 different parameters</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">because the overhead of getting the data is so large that calling the</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">program 10 times to just extract a single data item is nuts.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">In other cases there can be multiple tests to perform against the data</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">from the command and they must all be done at once because the data</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">needs to be synchronized for the tests to be meaningful. Using</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">tkwatcher <<A href="http://www.cs.umb.edu/~rouilj/tkwatcher/">http://www.cs.umb.edu/~rouilj/tkwatcher/</A>> I had some</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">instances where there were 30 tests on the output of a single command</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">stream.<SPAN class="Apple-converted-space">  </SPAN>I agree that the current -w -c -W -C threshold setting</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">mechanism's don't cut it. So I think something like what you propose</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">is needed. I would extend it just a bit however to allow each</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">threshold to specify:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">    </SPAN>warn_list;crit_list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">where warn/crit_list is:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>warn_list/crit_list<SPAN class="Apple-converted-space">  </SPAN>range|single[,range|single]</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">where single is a degenerate form of range implying 0:single just as</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">with the current plugins. This way we can support upper and lower</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">warning limits. E.G: warn if in the range 10-20 or 80-90, crit if in</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">the range 0-10 or 90-100:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>--freespace 0:10,20:80,90:100;10:90</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>*cough, cough* [tea flies onto keyboard]. Haven't even finished this general threshold and John's given me a new requirement!</DIV><DIV><BR class="khtml-block-placeholder"></DIV>I think multiple warn/crit ranges are doable. It will look messy, but I guess this is a fairly advanced option. The biggest problem for me, is how to specify it on the command line.</DIV><DIV><DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>A ";" as the range separator is going to cause trouble because Nagios does not easily allow ";" to get passed to the command line. I'd prefer not to use quotations because Nagios will need to invoke a shell to parse, whereas it currently just calls the executable.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I'm thinking maybe the severity separator should be "/". </DIV></DIV><BR><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">This would also work for those cases where we need to exclude the</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">middle of a range e.g. when checking discrete values from</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">snmp. E.G. 1,2,4 are warning but 3,5 are critical:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>--thresh 3:3,5:;1:2,4:4</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>When I first saw this, I thought the first threshold was the crit one. Then I thought: crit first makes sense as the crit severity would be checked first. However, this would conflict with current performance data. Thoughts?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This would not work because we'd do an "OR" for the ranges. So 4 is outside 1:2, so crit would be given. A better way would be (with crit level first):</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--thresh @3,@5/0:</DIV><DIV><BR class="khtml-block-placeholder"></DIV></DIV><DIV>The syntax looks awful, but I don't know how else it can be done, without some Nagios object type stanza definition. I'm thinking a -v -v -v will print out a human readable version of the ranges and when they would be triggered.</DIV><DIV><BR><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Quips, comments, evasions, questions, answers or suggestions</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">welcome. Although I have to say coding my standard parser for shell</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">script to deal with the current threshold processing was a bear. This</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">enhanced form may be worse.</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I find examples to be most illuminating. Looking at the basic use of check_disk, this simplifies nicely to:</DIV></DIV><DIV><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--usedspace_percent=90/80</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>for critical if usedspace is above 90%, warning if above 80%. Or even:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--usedspace_percent=90 </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>for critical above 90 only.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Other examples:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--freespace_units=@600/@400 - critical if between 0 to 600 units, warning if between 0 to 400 (warning will never appear - should this be flagged as an error?)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--usedspace_percent=/30: - warn if used space is less than 30%. No crit</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--freespace_percent=</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I'm also thinking that the plugin output and performance data depends on the thresholds specified. If you run:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>./check_disk --usedspace_percent=90/80 --freeinodes=@0:1000 -p /</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Then you will get output like:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>DISK CRITICAL - used space: / 95% (freeinodes=451658);| /=95%;0:80;0:90;0;100 i-/=451658;;@0:1000</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>(The i-/ means inodes for /. I'm guessing I don't need to prefix anything to /).</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>However, if you run:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>./check_disk --freespace_units=@10/@5 --usedspace_percent=90/80 --units=GB</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>You'll get output like:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>DISK WARNING - free space: / 7GB (usedspace=82%);| /=7GB;@0:5;@0:10;0;62</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>(Only show one set of perf data, depending on what gets specified first on command line)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I think a major blockage to understanding of the thresholds is that, intuitively, you want to alert if a value falls INTO a range, rather than OUTSIDE of the range. So I keep reading that </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>./check_disk --freespace_percent=10</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>as "alert if freespace is less than 10 percent", when in fact, it means "alert if freespace is outside 0 to 10 percent". And I HELP DEFINE THESE DAMN THINGS! I think this comes from the check_proc range where </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>./check_procs -c cron -c 1:1</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>alerts if there is not 1 process. Is this worth breaking?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Good discussion. I'll try and keep summarising as more opinions come in.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Ton</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><A href="http://www.altinity.com">http://www.altinity.com</A></DIV><DIV>T: +44 (0)870 787 9243</DIV><DIV>F: +44 (0)845 280 1725</DIV><DIV>Skype: tonvoon</DIV></SPAN></SPAN></SPAN></SPAN></SPAN><BR class="Apple-interchange-newline"></SPAN><BR class="khtml-block-placeholder"> </DIV><BR></BODY></HTML>