A monitor class to exec a script/program on the OS. This allows you
to hook up an external script or program to the monitoring system with the flexibility to determine success/failure by return code, or by comparing output with an expected (regex) pattern. The default test is to test the return code of the script/program and if it is zero (0), then the check is deemed to be successful, otherwise not. There is also a flag, in the constructor ($publish_output) which, if true, directs the monitor to include any output lines returned from the script in the email/SMS messages. This can sometimes be useful for providing extra information in error reports.
Located in /monitor-defs.php (line 198)
generic_monitor | --exec_monitor
Define a new exec check object.
Make the check by executing the script/program which has been
specified. We check that this exists and is executable, and raise warnings if not. The success/failure of the check is determined by the settings, but is either done via return code or by returned output matching.
Allows you to specify an integer code which, if returned by the called script/program, will designate success.
NOTES: 1) The default code for success is already zero (0), so no need to specify it in that particular case. 2) This code will be over-ridden if you specify a regular expression with the set_success_pattern() method.
Allows you to specify a regular expression which will be applied to the output of the executed script/program and if matched will be taken to mean the check was successful. If specified, this takes the place of the default behaviour of checking the return code.
Documentation generated by phpDocumentor 1.3.0RC3