[Nagiosplug-devel] check_snmp multiplier / divisor

William Leibzon william at leibzon.org
Fri Aug 17 21:24:58 CEST 2012


On Fri, Aug 17, 2012 at 10:18 AM, Eric Schoeller <
eric.schoeller at colorado.edu> wrote:


> > 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.
>

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 :)

http://exchange.nagios.org/directory/Plugins/%2A-Plugin-Development-Tools/check_snmp_attributes-2Epl--2D-experimental-plugin-base-%26-library/details

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 :)

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:
https://github.com/willixix/WL-NagiosPlugins/blob/master/check_redis.pl
Check_snmp_temperature
will use it as most of my other plugins. Probably 6 months before it
becomes a full library.

> 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.
>

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.

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:

http://exchange.nagios.org/directory/Plugins/Hardware/Environmental/Baytech-PDU-Monitoring-Plugin/details
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.

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 !
>

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 :)

And it actually does support it. 0.4 beta of check_snmp_temperature
supports ranges in full:

https://github.com/willixix/WL-NagiosPlugins/blob/master/check_snmp_temperature.pl

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.

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.

William
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20120817/48d26cc2/attachment.html>


More information about the Devel mailing list