[Nagiosplug-devel] check_snmp multiplier / divisor

Eric Schoeller eric.schoeller at Colorado.EDU
Fri Aug 17 19:18:25 CEST 2012


On 08/17/12 03:15, Andreas Ericsson wrote:
> On 08/17/2012 03:41 AM, Eric Schoeller wrote:
>> Hello list,
>>
>> We have a fair number of checks using check_snmp, and it is very common
>> that an INTEGER is reported in 'tenths' or even 'hundredths'. To use
>> check_snmp natively against these OIDs we are forced to set thresholds
>> such as '700' to represent '70.0' Fahrenheit. This isn't too big of a
>> problem except when tired admins get pages about temperatures reaching
>> (what appears to be) 700 degrees Fahrenheit.
>>
>> In such cases we could simply write our own plugins, but there are a lot
>> of these cases. It would be far more desirable to just use check_snmp. I
>> was considering developing and submitting a patch for options such as
>> --multiplier or --divisor ... or even perhaps --mangle where in you
>> could perform a bit of math on any values returned from the SNMP agent.
>> Thresholds would then be applied to the "mangled" value of the OID.
>>
>> Would there be support for such a change if we submitted a patch? Is
>> there a reason why it would be unnecessary?
>>
> I would love such a patch. Sounds like a generally awesome idea. In order
> to sanely implement it, I suggest supporting only simple math that can be
> parsed easily and unambiguously. It's likely to cover 99% of the cases,
> and for the rest, people will have to write their own plugins.
>
> You'd possibly want some "power of 2 to percent" thing though, since a
> lot of snmp-capable devices use all available precision to report
> some available resource, so "--formula=pct(256)" would transform "128"
> into "50".
>
> I'd implement the math part as macros if I were you. That way they'll be
> type-agnostic and work well in a wide range of scenarios.
>

Great, I'm glad you are interested in the idea. We will take a look at 
submitting a patch.

William,

I just deployed your check_snmp_temperature plugin across 19 of our Dell 
servers. Looks really good so far. Looks like this plugin will cover 
about 30% of our needs - the 'formula' option to check_snmp will be 
useful for things other than temperature. Some examples are UPS runtime, 
RAID latency, differential pressure, % valve opening, humidity, voltage, 
amperage, watts ... etc.

One suggestion, and this may sound crazy, but it might be nice to have a 
range implemented for check_snmp_temperature similar to how check_snmp 
handles ranges. Strangely enough, in some cases I would like to know if 
devices get TOO cold !

Thanks,

Eric




More information about the Devel mailing list