From a03a840bfd8bb1743a9e75b934b1ce9f6505f80d Mon Sep 17 00:00:00 2001 From: Marius Cramer <m.cramer@pixcept.de> Date: Tue, 06 May 2014 13:38:59 -0400 Subject: [PATCH] Implemented ftp user auto-expire --- server/lib/classes/cron.d/100-monitor_clamav_log.inc.php | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/server/lib/classes/cron.d/100-monitor_clamav_log.inc.php b/server/lib/classes/cron.d/100-monitor_clamav_log.inc.php index 4bc9a1b..25f7448 100644 --- a/server/lib/classes/cron.d/100-monitor_clamav_log.inc.php +++ b/server/lib/classes/cron.d/100-monitor_clamav_log.inc.php @@ -132,15 +132,20 @@ * Now we have the last log in the array. * Check if the outdated-string is found... */ + $clamav_outdated_warning = false; + $clamav_bytecode_updated = false; foreach ($lastLog as $line) { - if (strpos(strtolower($line), 'outdated') !== false) { - /* - * Outdatet is only info, because if we set this to warning, the server is - * as long in state warning, as there is a new version of ClamAv which takes - * sometimes weeks! - */ - $state = $this->_tools->_setState($state, 'info'); + if (stristr($line,'outdated')) { + $clamav_outdated_warning = true; } + if(stristr($line,'main.cld is up to date')) { + $clamav_bytecode_updated = true; + } + } + + //* Warn when clamav is outdated and main.cld update failed. + if($clamav_outdated_warning == true && $clamav_bytecode_updated == false) { + $state = $this->_tools->_setState($state, 'info'); } $res = array(); -- Gitblit v1.9.1