[Nagiosplug-devel] New threshold syntax (New thread)

Thomas Guyot-Sionnest dermoth at aei.ca
Sat Apr 5 10:45:58 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

My intent is to provide my suggestion on the latest RFC specification
(dated 17 March 2008 - 5:07pm) so to make thing clear I'm starting a new
thread. These suggestion have been discussed a bit on the #nagios-devel
irc channel and this email will formalize them.

Everithing in thes imail relates to the "Thresholds" section, although
the proposed changes will reflect in many of the subsequent sections.

http://nagiosplugins.org/rfc/new_threshold_syntax#thresholds

Issue #1:

The current specification of thresholds says the new system will use
"--{metric} {definition}" to define new thresholds. The definition is a
getsubopt(3) list . In regard to this method the new specification will
cause conflicts because some plugins already us similar longopt names
for thresholds that will be converted to the new format.

Instead, I suggest using "--threshold" (or the shorter "--thresh" if
it's too long) to specify the threshold string, and add the suboption
"metric" to define which metric we're setting the threshold against.

For example, to check the SSL certificate using check_tcp (that already
has "--certificate") I could use:

check_tcp -H myhst -S --thresh metric=certificate,warn=<...>,crit=<...>

The plugin --help output would print a table of all supported metrics,
descriptions, etc.


Issue #2:

The specs should clearly state what uom is and also add uom_prefix (or
just prefix if it's preferred). The current meaning of uom should
actually be uom_prefix. Both would be optionnal.

uom shouldn't be needed in almost all plugins because the plugin already
know that the thresholds is. It would be useful for checks that are more
generic like check_snmp and check_nt as they can retrieve value they
have no knowledge about. uom is generally a single character (although
it can be more than one) that defines the type of value. It is used in
printing the plugin output _and_ the performance data.

Some example of uom units:
http://physics.nist.gov/cuu/Units/units.html
http://physics.nist.gov/cuu/Units/outside.html


uom_prefix (or prefix) defined a multiplier for:
  a. defining the threshold level (the value are multiplied/divided by
the prefix)
  b. printing the retrived value in the _plugin_ output.
No matter what prefix is used the performance data should remain the same.
Plugins may define a default prefix fro any threshold. Prefixes are
strictly defined by the prefix tables found on these pages:
http://physics.nist.gov/cuu/Units/prefixes.html
http://physics.nist.gov/cuu/Units/binary.html
One cannot "invent" new prefixes as the plugin needs to know what the
multiplier/divider is.

For example, to send a warning when a page size isn't between 60KiB and
80KiB with check_http, one could use:

- --threshold metric=size,ok=60..80,warn=inf..inf,uom_prefix=Ki

Note that uom is not defined - check_http know it's in bytes (B)

The plugin would return the data in KiB. ex.:
HTTP OK HTTP/1.1 - 70.99KiB in 0.018 seconds

However the perfdata will stay in bytes:
time=0.18082s;;;0.000000 size=72694B;61440;81920;0



This new specs seems very good to me and outside the aforementioned
issues I fully support the latest RFC.

I also wish to give special thanks to everyone who participated in the
discussion and helped make the new syntax better and simpler.


Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH9zxG6dZ+Kt5BchYRAjqdAJ9fVQ6A7SvgzvY+eai8Qwj+jKZoBwCg72xy
cuV6cs6l6/6kAS5zEgTujR4=
=c6tc
-----END PGP SIGNATURE-----




More information about the Devel mailing list