X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=blobdiff_plain;f=modules%2Fprivate%2Fmonitoring%2Fplugins%2Fcheck_command;h=2b546c1f3c0ae3fa43ba36da889646f1689a54cc;hp=55779fd1a266fd187f2cc74719a082887033a6df;hb=a97118c489a59d723538292214efaa10dfcb96df;hpb=b1b8a5623d22a7ee4301afe4e7b9d368ef7ded8f diff --git a/modules/private/monitoring/plugins/check_command b/modules/private/monitoring/plugins/check_command index 55779fd..2b546c1 100755 --- a/modules/private/monitoring/plugins/check_command +++ b/modules/private/monitoring/plugins/check_command @@ -57,30 +57,30 @@ if ($other_command ne '') { chomp($cmd_result); if ($cmd_result =~ /sudo/i) { - print "$command CRITICAL - No sudo right to run the command\n"; + print "$command CRITICAL - No sudo right to run the command | result=1;;;;\n"; exit($STATE_UNKNOWN); } elsif ($expected_status ne '') { if ($? != $expected_status) { - print "$command CRITICAL - Response status $?\n"; + print "$command CRITICAL - Response status $? | result=1;;;;\n"; exit($STATE_CRITICAL); } else { - print "$command OK - Response status $?\n"; + print "$command OK - Response status $? | result=0;;;;\n"; exit($STATE_OK); } } elsif ($other_command ne '') { if ($cmd_result ne $other_cmd_result) { - print "$command CRITICAL - Expected output not matching other command output\n"; + print "$command CRITICAL - Expected output not matching other command output | result=1;;;;\n"; exit($STATE_CRITICAL); } else { - print "$command OK - Expected output matching other command output\n"; + print "$command OK - Expected output matching other command output | result=0;;;;\n"; exit($STATE_OK); } } else { if ($cmd_result !~ /$expected_output/) { - print "$command CRITICAL - Expected output not matching\n"; + print "$command CRITICAL - Expected output not matching | result=1;;;;\n"; exit($STATE_CRITICAL); } else { - print "$command OK - Expected output matching\n"; + print "$command OK - Expected output matching | result=0;;;;\n"; exit($STATE_OK); } }