]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/monitoring/plugins/check_command
Add status engine website
[perso/Immae/Config/Nix.git] / modules / private / monitoring / plugins / check_command
index 55779fd1a266fd187f2cc74719a082887033a6df..2b546c1f3c0ae3fa43ba36da889646f1689a54cc 100755 (executable)
@@ -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);
   }
 }