Skip to content

Commit d73810d

Browse files
author
Till Brehm
committed
Outdated warning for clamav is only shown with warning level in monitor when the daily.cfd update failed as well.
1 parent 20e0153 commit d73810d

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

server/lib/classes/cron.d/100-monitor_clamav_log.inc.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,20 @@ public function onRunJob() {
132132
* Now we have the last log in the array.
133133
* Check if the outdated-string is found...
134134
*/
135+
$clamav_outdated_warning = false;
136+
$clamav_bytecode_updated = false;
135137
foreach ($lastLog as $line) {
136-
if (strpos(strtolower($line), 'outdated') !== false) {
137-
/*
138-
* Outdatet is only info, because if we set this to warning, the server is
139-
* as long in state warning, as there is a new version of ClamAv which takes
140-
* sometimes weeks!
141-
*/
142-
$state = $this->_tools->_setState($state, 'info');
138+
if (stristr($line,'outdated')) {
139+
$clamav_outdated_warning = true;
143140
}
141+
if(stristr($line,'main.cld is up to date')) {
142+
$clamav_bytecode_updated = true;
143+
}
144+
}
145+
146+
//* Warn when clamav is outdated and main.cld update failed.
147+
if($clamav_outdated_warning == true && $clamav_bytecode_updated == false) {
148+
$state = $this->_setState($state, 'info');
144149
}
145150

146151
$res = array();

0 commit comments

Comments
 (0)