Monitor module: Some monitor function are never executed.
The time dependent functions: _monitorEmailQuota (every 15minutes) _monitorSystemUpdate (every hour on the hour) _monitorRkHunter (once a day at 11pm)
that are called in _doMonitor() could sometimes be falsly omitted from an execution run.
In my case some of these functions, depending on their sequence, are never executed. Whilst debugging the issue I timed each of the function calls in _doMonitor and with one of my SMTP cluster's the first call to _monitorEmailQuota() took two minutes due to the volume of mail data. Because the time that is calculated is the current time at each function and not the time at which the job was first executed, the time it takes to complete a monitoring function effects the next functions in the sequence.
For example: _monitorEmailQuota() will always execute with and before _monitorSystemUpdate as every 15minutes would also be on the hour. Because _monitorEmailQuota() is executed first and takes longer than one minute by the time _monitorSystemUpdate is called the time check in _monitorSystemUpdate will never be true. Snippet:
$min = @date('i');
if ($min != 0)
return;
I found other systems behaved more randomly depending on time of day and available bandwidth. In these cases _monitorRkHunter would not be executed consistently. As it's executed on the hour it is always paired with _monitorEmailQuota and _monitorSystemUpdate (which can take some time to complete) which meant the time check some times did not evaluate to true when the process took longer than a minute. Snippet:
$min = @date('i');
$hour = @date('H');
if (!($min == 0 && $hour == 23))
return;
Attached is a patch against the current svn version of monitor_core_module.inc.php that captures the unix timestamp before _doMonitor is called and uses the timestamp when doing date('i') checks.