Nagios plugin output length


#1

I found that the default value that Nagios uses just isn’t long enough for plugin output (namely check_disk). In include/objects.h I found the following line:
#define MAX_PLUGINOUTPUT_LENGTH
I believe it’s default is 334, but I raised it to 1024 in order to function with check_disk properly. A max length of 334 is pretty limited especially considering that this also include performance data. I’ve compiled and tested the changes on my test box and everything seems to be working fine.

My question is whether or not this is going to cause any problems and why was such a small limit chosen in the first place? It seems like a better option would be to have this value configurable in nagios.cfg.


#2

For one thing, imagine looking at the output of over 1000 service checks with each one taking up 15 lines on the webpage. I hate to say it, but this seems very odd to me. All I want to know, is if there is any space left on Disk C and how much. I don’t really want to see a full length novel on disc space.
If I have more that one volume to check, I will make a seperate service check. Plus I graph the plugin output of disc checks, and having to parse 1024 characters plus write the regex for this parse, seems kinda troublesome too.

I’m sure you have your reason’s for wanting such an output, and I’m sure others would love to share your code change.


#3

I know this could be changed by writing another plugin, but by default when using NRPE, you’d have a separate connection and separate request per service entry. In our case, that could be 5 different NRPE connections per host just to check the disk. That can add a whole lot of overhead in terms of extra active checks.

In any case, I think it is easier to have the check_disk plugin check all the partitions at once (which it does by default) in only one active check. This is especially true if you modify the partition table–you’d have to change the arguments to check_disk and/or add a new service to Nagios. When all disk checks are in one service, it’s a lot simpler.

Currently, check_disk does not have the features to do it the way I would need it done (such as checking all partitions with certain thresholds and providing exceptions for certain partitions), but I’ve also submitted some bug fixes and feature additions to sourceforge in hopes that they will make it into the standard package (after they clean up my code, of course :wink: ).

It looks like Nagios 3.0 will support $LONGSERVICEOUTPUT$ though.


#4

I need output long!!!
I write a plugin for nrpe but output is long but now only have one line. How to correct this ?