Class process_monitor

Description

A monitor class to check if a given process is running. This can be achieved by consulting a pidfile, or by checking the process status listing for the given process name (the default behaviour).

Located in /monitor-defs.php (line 412)

generic_monitor
   |
   --process_monitor
Variable Summary
 mixed $pidfile
 mixed $procname
 mixed $ps_all_cmd
 mixed $ps_pid_cmd
Method Summary
 process_monitor process_monitor (string $procname, [string $pidfile = ""], [string $ps_all_cmd = ""], [string $ps_pid_cmd = ""])
 integer check ()
Variables
mixed $pidfile = "" (line 422)

Path to the PID file containing a process ID for the running process. Leave

mixed $procname = "" (line 417)

Name of the process being monitored.

mixed $ps_all_cmd = "ps ax" (line 430)

The 'ps' command to use for an 'all processes list. This allows override

mixed $ps_pid_cmd = "ps --no-headers -p" (line 426)

The 'ps' command to use for a specific process ID#. This allows override

Methods
Constructor process_monitor (line 439)

Defines a new process monitoring object and provides matching info.

process_monitor process_monitor (string $procname, [string $pidfile = ""], [string $ps_all_cmd = ""], [string $ps_pid_cmd = ""])
  • string $procname: Name of the process to search for using 'ps'.
  • string $pidfile: Path to PID file, or nullstring if matching on $procname.
  • string $ps_all_cmd: The 'ps' command to use for 'all processes' listing.
  • string $ps_pid_cmd: The 'ps' command to use for a specific process.
check (line 457)

Make the check on the time the file was last modified and if this is longer than this->warnsecs ago but less than this->errsecs then issue a warning. Otherwise if it is longer than this->errsecs ago then we issue an error message.

  • return: Condition determined by this check
integer check ()

Documentation generated by phpDocumentor 1.3.0RC3