Nagios check_multi plugin outputs invalid $LONGSERVICEOUTPUT$ and $SERVICEPERFDATA$

367 views Asked by At

We have been using Nagios Core 4 with the nagios check_multi plugin for a while and it works good.

The only problem is that the plugin output is not splitted correctly into the Nagios macros, we have the following :

check_multi plugin raw output :

MULTIPLE CHECK OK: 0 failed 7 succeeded
6 active jails --- Ok: 679 banned IP(s) \n The bantime are = seconds \n |banned_IP=679;5000;10000;; 
OK: postfix mailq reports queue is empty|unsent=0;50;100;0 
PING OK - Packet loss = 0%, RTA = 4.82 ms|rta=4.815000ms;3000.000000;5000.000000;0.000000 pl=0%;75;90;0 
HTTP OK: HTTP/1.1 301 Moved Permanently - 459 bytes in 0.004 second response time |time=0.003745s;4.000000;10.000000;0.000000;10.000000 size=459B;;;0 
PROCS OK: 1 process with STATE = Z | procs=1;5;10;0; 
DISK OK - free space: /var/tmp 45741 MB (94% inode=97%);| /var/tmp=2537MB;40290;45326;0;50363 
OK - load average: 0.03, 0.03, 0.00|load1=0.030;15.000;30.000;0; load5=0.030;10.000;25.000;0; load15=0.000;5.000;20.000;0;  

This output is split into the following nagios macros :

$SERVICEOUTPUT$ (OK)

MULTIPLE CHECK OK: 0 failed 7 succeeded

$LONGSERVICEOUTPUT$ (KO)

6 active jails --- Ok: 679 banned IP(s)
The bantime are = seconds

$SERVICEPERFDATA$ (KO)

banned_IP=679;5000;10000;; OK: postfix mailq reports queue is empty|unsent=0;50;100;0 PING OK - Packet loss = 0%, RTA = 4.82 ms|rta=4.815000ms;3000.000000;5000.000000;0.000000 pl=0%;75;90;0 HTTP OK: HTTP/1.1 301 Moved Permanently - 459 bytes in 0.004 second response time |time=0.003745s;4.000000;10.000000;0.000000;10.000000 size=459B;;;0 PROCS OK: 1 process with STATE = Z | procs=1;5;10;0; DISK OK - free space: /var/tmp 45741 MB (94% inode=97%);| /var/tmp=2537MB;40290;45326;0;50363 OK - load average: 0.03, 0.03, 0.00|load1=0.030;15.000;30.000;0; load5=0.030;10.000;25.000;0; load15=0.000;5.000;20.000;0;  

According to the documentation we should have the following :

$LONGSERVICEOUTPUT$

6 active jails --- Ok: 679 banned IP(s)
The bantime are = seconds
OK: postfix mailq reports queue is empty
PING OK - Packet loss = 0%, RTA = 4.82 ms
HTTP OK: HTTP/1.1 301 Moved Permanently - 459 bytes in 0.004 second response time 
PROCS OK: 1 process with STATE = Z 
DISK OK - free space: /var/tmp 45741 MB (94% inode=97%);
OK - load average: 0.03, 0.03, 0.00

$SERVICEPERFDATA$

banned_IP=679;5000;10000;; 
unsent=0;50;100;0 
rta=4.815000ms;3000.000000;5000.000000;0.000000 pl=0%;75;90;0 
time=0.003745s;4.000000;10.000000;0.000000;10.000000 size=459B;;;0 
procs=1;5;10;0; 
/var/tmp=2537MB;40290;45326;0;50363 
load1=0.030;15.000;30.000;0; load5=0.030;10.000;25.000;0; load15=0.000;5.000;20.000;0;  

Does anyone have any idea about why this does not work ? It seems the raw output uses the good format. Should we fix the output format or is there any configuration to do on Nagios ?

Thank you for your help :)

1

There are 1 answers

1
AudioBubble On

Because the first two lines of the output indicate that it goes straight from

TEXT OUTPUT | OPTIONAL PERFDATA

to

LONG TEXT LINE N | PERFDATA LINE 2
PERFDATA LINE ...N...

In order for the LONGSERVICEOUTPUT macro to be filled, it needs to respect the output specified in the plugin output spec, which it does not.