Multiple output lines in plugins?

Sean Dilda agrajag at dragaera.net
Thu Jul 8 16:33:04 CEST 2004


On Thu, 2004-07-08 at 02:38, Nicole Hähnel wrote:
> Hi,
> 
> I've written my own plugin to get more information from a server.
> I use nrpe to check the other servers with my plugin.
> The plugin is not only to get "status ok". It gives out more lines,
> something like this:
> 
> Temperatures OK
> CPU Planar	38.0 Celsius
> Ambient		26.0 Celsius
> BP Bottom Temp	23.0 Celsius
> 
> The problem is check_nrpe gets only the first line.
> All I see is "Temperatures OK", the other lines are ignored.
> 
> Is there any possibility to get more than one line?
> Or is the only thing I can do, write all output in one line?

If you read the nagios plugin guidelines:
http://nagiosplug.sourceforge.net/developer-guidelines.html
you'll see that a nagios plugin is only supposed to print one line of
text, and the rest is ignored.  So even if npre passed on more, nagios
itself would ignore everything but the first line.  You really need to
put everything on one line.

When I write a plugin to check multiple things, I have a simple Ok
message if things are good.  If something's wrong, then I'll show the
value that caused the problem.  That way its easier to keep the line
short.





-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list