Ignore:
Timestamp:
Mar 16, 2016, 10:20:36 PM (9 years ago)
Author:
chronos
Message:
  • Fixed: Checking network port states.
  • Modified: Check only state of enabled interfaces.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkConfigLinux/Generators/CheckPorts.php

    r818 r819  
    77    $Timeout = 1;
    88    $State = 0;
    9     if($Protocol = 'tcp') $Prefix = '';
    10       else if($Protocol = 'udp') $Prefix = 'udp://';
     9    if($Protocol == 'tcp') $Prefix = '';
     10      else if($Protocol == 'udp') $Prefix = 'udp://';
    1111      else throw new Exception('Unsupported protocol "'.$Protocol.'"');
    1212    if($Socket = @fsockopen($Prefix.$IP, $Port, $ErrorNumber, $ErrorString, $Timeout))
     
    5656          '`TM`.`Time`, (SELECT `Time` FROM (SELECT * FROM `NetworkPortUpDown`) AS `TA` WHERE (`TA`.`Time` > `TM`.`Time`) '.
    5757          'AND (`TA`.`Port`=`TM`.`Port`) ORDER BY `TA`.`Time` ASC LIMIT 1)) '.
    58           'WHERE (`TM`.`Duration` IS NULL) AND (`TM`.`Interface` ='.$Port['Id'].')');
     58          'WHERE (`TM`.`Duration` IS NULL) AND (`TM`.`Port` ='.$Port['Id'].')');
    5959      }
    6060    }
    61     $DbResult = $this->Database->update('NetworkDevice', '`LastOnline` < "'.TimeToMysqlDateTime($StartTime).'"', array('Online' => 0));
     61    $DbResult = $this->Database->update('NetworkPort', '`LastOnline` < "'.
     62      TimeToMysqlDateTime($StartTime).'"', array('Online' => 0));
    6263
    6364    // Set offline all ports which were not updated as online
Note: See TracChangeset for help on using the changeset viewer.