"/path/to/mycommand -param", -> commandline which is executed * 'ok' => 0, -> threshold of exit code for status ok * 'warning' => 99, -> threshold of exit code for status warning * -> any other exit code will change the status to critical * ); * */ $CONFIG = array( 'command' => "/path/to/mycommand -param", 'ok' => 0, 'warning' => 99, ); // exec command exec($CONFIG['command'], $output, $code); if (isset($CONFIG['ok']) and $code == $CONFIG['ok']) { echo 'OK'; } elseif (isset($CONFIG['warning']) and $code == $CONFIG['warning']) { echo 'WARNING'; } else { echo 'FAILURE'; } ?>