Skip to content

Commit 18b050c

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 ddbbaaf commit 18b050c

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

server/lib/classes/monitor_tools.inc.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,15 +1571,20 @@ public function monitorFreshClamLog() {
15711571
* Now we have the last log in the array.
15721572
* Check if the outdated-string is found...
15731573
*/
1574+
$clamav_outdated_warning = false;
1575+
$clamav_bytecode_updated = false;
15741576
foreach ($lastLog as $line) {
1575-
if (strpos(strtolower($line), 'outdated') !== false) {
1576-
/*
1577-
* Outdatet is only info, because if we set this to warning, the server is
1578-
* as long in state warning, as there is a new version of ClamAv which takes
1579-
* sometimes weeks!
1580-
*/
1581-
$state = $this->_setState($state, 'info');
1577+
if (stristr($line,'outdated')) {
1578+
$clamav_outdated_warning = true;
15821579
}
1580+
if(stristr($line,'main.cld is up to date')) {
1581+
$clamav_bytecode_updated = true;
1582+
}
1583+
}
1584+
1585+
//* Warn when clamav is outdated and main.cld update failed.
1586+
if($clamav_outdated_warning == true && $clamav_bytecode_updated == false) {
1587+
$state = $this->_setState($state, 'info');
15831588
}
15841589

15851590
/*

0 commit comments

Comments
 (0)