- Timestamp:
- Mar 16, 2016, 10:20:36 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigLinux/Generators/CheckPorts.php
r818 r819 7 7 $Timeout = 1; 8 8 $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://'; 11 11 else throw new Exception('Unsupported protocol "'.$Protocol.'"'); 12 12 if($Socket = @fsockopen($Prefix.$IP, $Port, $ErrorNumber, $ErrorString, $Timeout)) … … 56 56 '`TM`.`Time`, (SELECT `Time` FROM (SELECT * FROM `NetworkPortUpDown`) AS `TA` WHERE (`TA`.`Time` > `TM`.`Time`) '. 57 57 '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'].')'); 59 59 } 60 60 } 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)); 62 63 63 64 // Set offline all ports which were not updated as online
Note:
See TracChangeset
for help on using the changeset viewer.