[Nagiosplug-devel] check_snmp: Anyone ever used per-oid labels?
Thomas Guyot-Sionnest
dermoth at aei.ca
Sat Aug 1 01:35:11 CEST 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Seems like that highly undocumented and unintuitive feature actually exists.
I was trying to decipher the code parsing the label string (which at
first glance seems to be overcomplicated). I'm still unsure how it was
meant to work, but here's my findings so far (given a command with 3
oids and 3 thresholds):
- --label "foo,bar,baz,bad"
Sets only the first label to "foo", the rest is ignored. Seems like
commas could be used to specify multiple labels
- --label "'foo bar baz bad'"
- --label "'foo' bar baz bad"
A string starting with a single quote sets the label to an empty string,
no matter what follow. If the first character is not a single quote any
quote that follow is printed in the label.
- --label "foo" --label "bar" --label "baz" --label "bad"
The first label is "bad" (always the last one), then each oid result is
prefixed by the labels in order. ex:
bad OK - foo 2.6 bar 4 baz 6371090
- --label "foo" --label "bar"
Since there's less labels than the number of OIDs, no oid is prefixed
and the front label is "bar".
My thoughts:
1. The single quote thing is nonsense
2. The front label should be the first passed label, not the last one
3. Any subsequent labels should be used for prefixing the OIDs
4. Labels should be used even if there more OIDs than labels
5. Commas should be another way of passing multiple labels
6. The whole thing should be documented!
2 and 3 would break backwards compatibility, but I doubt there are many
users that figured out yet without any doc, and IMHO it would be much
more intuitive.
Any thoughts?
- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFKc3+v6dZ+Kt5BchYRApj/AKDa6oGfOdB/1GsQKc/bybXEFD3p0gCfVM4a
msHjNWTVKAJ2XCD8GQI0cAs=
=E+Ng
-----END PGP SIGNATURE-----
More information about the Devel
mailing list