[Nagiosplug-devel] Plugin output format

Holger Weiss holger at CIS.FU-Berlin.DE
Tue Jul 24 01:12:52 CEST 2007

The development guidelines state:

| Output should be in the format:
| SERVICE STATUS: Information text

[ http://nagiosplug.sf.net/developer-guidelines.html#AEN34 ]

I don't remember having seen exactly this format, but, as you all know,
most plugin output is in the format "SERVICE STATUS - Information text".
Some output is in some arbitrary other format.  Anyway, my question is:
Why do we print out SERVICE and STATUS at all?  AFAICS, when a plugin is
called via Nagios in order to perform a service check, adding SERVICE
and STATUS to the output is completely redundant.  At least, I'm not
aware of a place where Nagios prints the plugin output without (being
able to) also printing the service_description and the symobolic name of
the exit status the plugin returned.  And when a plugin is called on the
command line for testing, I see no use in printing out the SERVICE
string, either.  If I call check_http, I know it does HTTP.  However,
for debugging, it does of course make sense to print out the STATUS so
that the user won't have to check and interpret the exit code manually.
But IMO it would be perfectly reasonable to print such debug output only
when called with "--verbose", not in production.

The reason I'm concerned about this is that the space for plugin output
is sometimes scarce, so that we should try to keep the output "short and
to the point" (as the guide states) and not waste space with redundant
information.  For example, when sending alerts via SMS, the number of
characters which can be sent is sometimes limited.  If the notification
message exceeds this number, the alert will at best be truncated, or, at
worst, the SMS software will refuse to send the alert.  To give another
example, we use nsc[*], a curses-based tool which displays the status of
all monitored services using one line per service.  Assuming an
80-character-width terminal, the line for a CRITICAL LDAP service looks
similar to this one:

Host       Service       Status    Upd/Chg  Try  Plugin Output
foobar     LDAP          CRITICAL  12s/4m   3/3  LDAP CRITICAL - interesting plu

Here, some of the "interesting plugin output" is truncated.  Yes, I
could resize my XTerm, but still, repeating the SERVICE and STATUS
within the plugin output seems neither nice nor useful to me.  While the
standard web interface normally won't truncate the plugin output, I'd
personally still prefer not to display duplicated information within
that field in the web interface, either.  At least, I don't see any
benefit in doing so.

So, my suggestion would be to change the standard plugin output to print
only the "Information text" and to print "STATUS: Information text" when
the plugin was called with "--verbose".  Opinions?


[*] http://nsc-gothix.sf.net/

PGP fingerprint:  F1F0 9071 8084 A426 DD59  9839 59D3 F3A1 B8B5 D3DE

More information about the Devel mailing list