Extenal command file limitation
Martin Pozdílek
pozda at mfservis.cz
Mon Nov 5 13:42:27 CET 2007
Hello
It's still problem with max plugin output length in 3.0b6. The increase
of max plugin output length cap from 4kb to 8kb was announce in Changelog.
The maximum of output is defined by these constants in common.h nagios.h
/*
NOTE: Plugin length is artificially capped at 8k to prevent runaway
plugins from returning MBs/GBs of data
back to Nagios. If you increase the 8k cap by modifying this value,
make sure you also increase the value
of MAX_EXTERNAL_COMMAND_LENGTH in common.h to allow for passive
checks results received through the external
command file. EG 10/19/07
*/
#define MAX_PLUGIN_OUTPUT_LENGTH 8192 /* max length of
plugin output (including perf data) */
#define MAX_EXTERNAL_COMMAND_LENGTH 8192 /* max length of
an external command */
But the maximum length of message pushed to nagios through external
command file is limited to 4kb.
You can use this simple bash skript for test this bug.
#!/bin/bash
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
host='host'
service='service'
string='aaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrsssssssssssttttttttttt
uuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklll
llllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeeffffffffff
fggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxx
xxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrr
rrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiij
jjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddd
dddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuu
vvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnoooooooooooppppppp
ppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffgggggggggg
ghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbb
bbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrsssssssss
sstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzzaaaaaaaaaaabbbbbbbbbbbcccccccccccdddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhhiiiiiiiiiiijjjjjjjjjjjkkkkkkkkkkklllllllllllmmmmmmmmmmmnnnnnnnnnnnooooooooooopppppppppppqqqqqqqqqqqrrrrrrrrrrrssssssssssstttttttttttuuuuuuuuuuuvvvvvvvvvvvwwwwwwwwwwwxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzz'
/usr/bin/printf "[%lu]
PROCESS_SERVICE_CHECK_RESULT;$host;$service;0;$string\n" $now > $commandfile
Martin
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
More information about the Developers
mailing list