On Fri, Aug 17, 2012 at 10:18 AM, Eric Schoeller <span dir="ltr"><<a href="mailto:eric.schoeller@colorado.edu" target="_blank">eric.schoeller@colorado.edu</a>></span> wrote:<br><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div>> I would love such a patch. Sounds like a generally awesome idea. In order<br>
> to sanely implement it, I suggest supporting only simple math that can be<br>
> parsed easily and unambiguously. It's likely to cover 99% of the cases,<br>
> and for the rest, people will have to write their own plugins.<br></div></div></blockquote><div><br></div><div>At some point I wrote a bit weird plugin/plugin-library. It implements internally something similar to Forth machine but also with support for overloading operators and auto-typing, and all in perl of all languages :)</div>


<div>  <a href="http://exchange.nagios.org/directory/Plugins/%2A-Plugin-Development-Tools/check_snmp_attributes-2Epl--2D-experimental-plugin-base-%26-library/details" target="_blank">http://exchange.nagios.org/directory/Plugins/%2A-Plugin-Development-Tools/check_snmp_attributes-2Epl--2D-experimental-plugin-base-%26-library/details</a></div>


<div><br></div><div>Read what I wrote in description and how it started from trying to more comprehensive expression to make something more general than check_snmp_temperature. Of course I've over-done it a little :) </div>


<div><br></div><div>I'm still undecided what will happen to this code, most likely I'll use expression part of it for a perl plugin library I'm working with. You can already see what this library would be from check_memcached and check_redis plugins: <a href="https://github.com/willixix/WL-NagiosPlugins/blob/master/check_redis.pl" target="_blank">https://github.com/willixix/WL-NagiosPlugins/blob/master/check_redis.pl</a> Check_snmp_temperature will use it as most of my other plugins. Probably 6 months before it becomes a full library.</div>


<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
> You'd possibly want some "power of 2 to percent" thing though, since a<br>
> lot of snmp-capable devices use all available precision to report<br>
> some available resource, so "--formula=pct(256)" would transform "128"<br>
> into "50".<br>
><br>
> I'd implement the math part as macros if I were you. That way they'll be<br>
> type-agnostic and work well in a wide range of scenarios.<br>
><br>
<br>
</div></div>Great, I'm glad you are interested in the idea. We will take a look at<br>
submitting a patch.<br>
<br>
William,<br>
<br>
I just deployed your check_snmp_temperature plugin across 19 of our Dell<br>
servers. Looks really good so far. Looks like this plugin will cover<br>
about 30% of our needs - the 'formula' option to check_snmp will be<br>
useful for things other than temperature. Some examples are UPS runtime,<br>
RAID latency, differential pressure, % valve opening, humidity, voltage,<br>
amperage, watts ... etc.<br></blockquote><div><br></div><div>Those are all environmental data very similar to temperature. I will mostly likely extend check_snmp_temperature to handle things other than just temperature and rename it check_env (or something like it) in the future. Basically plans are to merge it with Patrick Proy's check_snmp_env as well as support getting environment data directly on linux machine. Voltage is most important of what I want to support in addition to temperature.</div>

<div><br></div><div>And you can just use check_snmp_temperature directly as is for other environmental data. I also extended it to support voltage, amperage and power (watts) for a specific device:</div><div>    <a href="http://exchange.nagios.org/directory/Plugins/Hardware/Environmental/Baytech-PDU-Monitoring-Plugin/details">http://exchange.nagios.org/directory/Plugins/Hardware/Environmental/Baytech-PDU-Monitoring-Plugin/details</a></div>


<div>You're welcome to use this as a base for some other device you may have. Properly supporting every type of device with just one plugin is really difficult.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


One suggestion, and this may sound crazy, but it might be nice to have a<br>
range implemented for check_snmp_temperature similar to how check_snmp<br>
handles ranges. Strangely enough, in some cases I would like to know if<br>
devices get TOO cold !<br></blockquote><div><br></div><div>This plugin is being used at a hadron collider in Switzerland (hopefully only for network equipment there), so apparently you're not the first to want it :)</div>


<div><br></div><div>And it actually does support it. 0.4 beta of check_snmp_temperature supports ranges in full:</div><div>  <a href="https://github.com/willixix/WL-NagiosPlugins/blob/master/check_snmp_temperature.pl">https://github.com/willixix/WL-NagiosPlugins/blob/master/check_snmp_temperature.pl</a></div>

<div><br></div><div>You're welcome to test it, the range code should be working, through I've not extensively tested it myself. And its no longer the best code, I'll replace it with newest generation of functions from check_redis when I get to it. Don't know when though - check_snmp_temperature is not a priority right now, I'll work on enhancing check_mysqld first after I've done with bunch of other things.</div>

<div><br></div><div>To include support for APC OIDs you should send me a patch for it. But please do test it. And my experience with APC though is that they are hard to support with a general plugin and would require a custom-coded plugin, i.e. its better to write a plugin similar to one I pointed above for baytech.</div>

<div><br></div><div>William</div></div>