Work around for ClamAV out of date issue?

Discussion in 'General' started by mattltm, Jan 15, 2014.

  1. mattltm

    mattltm Member

    I know the clamav out of date thing has been covered many times before but I can't find any suggested work around.

    Could there be a work around for the out of date warning? Maybe something in ISPConfig that will parse the warning and ignore it if the "WARNING: Local version: x.xx.x Recommended version: 0.xx.x" line is the only error found?

    It's a real pain to keep checking what the warning is just to make sure there are no others.

    Otherwise, is there a way to install clamav from source without upsetting ISPConfig?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no action required as its basically only a false positive message.

    The message occurs because ClamAV does not recognize that it gets updated and patched by the Linux distribution.

    I've added a feature request in the bugtracker to ignore clamav warnings.
     
  3. mattltm

    mattltm Member

    Great.

    It would be nice and tidy if the message was just ignored as it is a common issue :)

    Great work Till.
     
  4. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    It should help, if you change line 1616 in server/lib/classes/monitor_tools.inc.php from
    Code:
    $state = $this->_setState($state, 'info');
    to
    Code:
    $state = $this->_setState($state, 'ok');
    But keep in mind, that you will get no warnings in ispconfig if your clamd is outdated.

    Since the most distros need a long time to update clamav i didnĀ“t use apt or zypper to install clamav. i build it from source.
     
  5. mattltm

    mattltm Member

    I don't have that line in my file.

    Using ISPConfig V3.0.5.3
     
  6. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    Sorry, I used my patched file. Look at line 1579.
     
  7. mattltm

    mattltm Member

    Yup, that's done the job :)

    Much better.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    I've changed the test logic for this warning now in the git version, so that the warning level is reached when clamav is outdated and the daily signature updates failed.
     
  9. mattltm

    mattltm Member

    Thanks Till, great work.

    Is there an idiots guide on how to update to the git version?
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

  11. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    Hi Till,

    I think checking daily.cvd is a better solution. The lastest main.cvd was released in 2013. Only the daily.cvd is updated and main.cvd stays at it is. This file changes for major updates only.
     
  12. mattltm

    mattltm Member

    I'm now running 3.0.5.4p1 and still have the warning showing. Was the change dropped or do I have something else wrong?
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    This fix must have been lost somehow, I'll have to check that.
     
  14. mattltm

    mattltm Member

    Much appreciated.

    I know it's just a notice but it is annoying!
     
  15. mattltm

    mattltm Member

    Looks like this change has also been lost in 3.0.5.4p5.

    Any chance of getting it put back?
     
  16. mattltm

    mattltm Member

    Went to edit the monitor_tools.inc.php file and found this...
    Code:
    //* Warn when clamav is outdated and main.cld update failed.
                    if($clamav_outdated_warning == true && $clamav_bytecode_updated == false) {
                            $state = $this->_setState($state, 'info');
                    }
    
                    /*
                     * Return the Result
                     */
    
    I assume that it's got an eronious '*' on the first line and that is should be this...
    Code:
    // Warn when clamav is outdated and main.cld update failed.
                    if($clamav_outdated_warning == true && $clamav_bytecode_updated == false) {
                            $state = $this->_setState($state, 'info');
                    }
    
                    /*
                     * Return the Result
                     */
    
    Is that right?
     
  17. mattltm

    mattltm Member

    I've got it working by doing this in monitor_tools.inc.php
    Code:
                     /*
                     * 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 (stristr($line,'outdated')) {
                                    $clamav_outdated_warning = true;
                            }
                            // Changed to look at daily.cld insted of main.cld
                            if(stristr($line,'daily.cld is up to date')) {
                                    $clamav_bytecode_updated = true;
                            }
    
                    }
    
                    // Warn when clamav is outdated and daily.cld update failed.
                    if($clamav_outdated_warning == true && $clamav_bytecode_updated == false) {
                            $state = $this->_setState($state, 'info');
                    } else {
                            $state = $this->_setState($state, 'ok');
                    }
    
                    /*
                     * Return the Result
                     */
    
     

Share This Page