Class file_monitor

Description

A monitor class to check when files/directories were last modified.

This is a general class which can be used to set limits on how long a file or directory can remain un-modified before warnings and/or errors are issued.

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

generic_monitor
   |
   --file_monitor
Variable Summary
 mixed $critsecs
 mixed $filepath
 mixed $warnsecs
Method Summary
 file_monitor file_monitor (string $filepath, integer $warnmins, integer $critmins)
 integer check ()
Variables
mixed $critsecs = 0 (line 338)

Seconds before error condition

mixed $filepath = "" (line 332)

Path to the file to monitor

mixed $warnsecs = 0 (line 335)

Seconds before warning message

Methods
Constructor file_monitor (line 346)

Define a new file check object.

file_monitor file_monitor (string $filepath, integer $warnmins, integer $critmins)
  • string $filepath: Path to file or directory to check
  • integer $warnmins: Minutes file can be idle before warning issued
  • integer $critmins: Minutes file can be idle before critical error raised
check (line 359)

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