[Nagiosplug-devel] RFC: Plugin API Changes

Ethan Galstad nagios at nagios.org
Tue Feb 28 10:11:04 CET 2006


Hi all -

I'm looking for some comments on proposed extensions to the current 
plugin API for Nagios 3.x.  For a long time, people have been 
requesting multiline output for host and service checks.  I currently 
have this feature working in the Nagios CVS HEAD (3.x) code and would 
like some feedback as to how this should work.  

The multiline output changes that I am proposing would remain 
compatible with the existing (single line) plugin output.  Take this 
sample plugin output as an example:  

Line1: "Short output | Perf1"
Line2: "Long output 1"
Line3: "Long output 2"
Line4: "Long output3 | Perf2"
Line5: "Perf3"
Line6: "Perf4"

Nagios would interpret the six lines out of above plugin output and 
make it avaiable in macros it like this:  

$SERVICEOUTPUT$="Short output"
$PERFDATA$="Perf1 Perf2 Perf3 Perf4"
$LONGSERVICEOUTPUT$="Long output 1\nLong output2\nLong output3\n"

The proposed format would allow for: 1.  Multiple lines of output to 
be optional, rather than required 2.  Multiple lines of perfdata can 
follow the long output if seperated by a pipe (|) symbol, as can be 
done of the first line 3.  Multiple lines of perfdata are 
concatenated together, seperated by a space (newlines are not 
included) 4.  Long output would have newlines escaped as shown above  


The proposed changes are nice in that they allow for multiline (and 
longer) output and perf data, while remaining compatible with the 
current plugin API.  What are people's thoughts on this?  

FYI, there will be no inherent limitations on the length of plugin 
output in Nagios 3.x.  IPC is handled slightly differently in the CVS 
code, which allows us to have longer output without bumping into the 
512-byte PIPE_BUF Posix limitation for pipes. I'll probably cap the 
output at 2K or so to prevent runaway plugins from spewing megs of 
data back to Nagios. You wouldn't want that much data sent to your 
pager or cellphone. :-)  



Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org





More information about the Devel mailing list