- Timestamp:
- Apr 14, 2015, 10:20:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Generators/NetwatchImport.php
r697 r738 21 21 // Load netwatch status from all DHCP routers 22 22 $DbResult3 = $System->Database->query('SELECT `DHCP`, `AddressRange`, `Mask` FROM `NetworkSubnet` '. 23 23 'WHERE (`Configure` = 1) AND (`Member` IS NULL) GROUP BY DHCP'); 24 24 while($Subnet = $DbResult3->fetch_assoc()) 25 25 { … … 54 54 array('LastOnline' => TimeToMysqlDateTime($StartTime))); 55 55 56 56 if($Interface['Online'] != $Interface['NewOnline']) 57 57 { 58 58 // Online state changed 59 59 $DbResult = $System->Database->query('INSERT INTO `NetworkInterfaceUpDown` (`Interface`, 60 60 `State`, `Time`, `Duration`) VALUES ('.$Interface['Id'].', '.$Interface['NewOnline'].', "'. 61 61 TimeToMysqlDateTime($StartTime).'", NULL)'); 62 62 // Update previous record duration in UpDown table … … 64 64 '`TM`.`Time`, (SELECT `Time` FROM (SELECT * FROM `NetworkInterfaceUpDown`) AS `TA` WHERE (`TA`.`Time` > `TM`.`Time`) '. 65 65 'AND (`TA`.`Interface`=`TM`.`Interface`) ORDER BY `TA`.`Time` ASC LIMIT 1)) '. 66 66 'WHERE (`TM`.`Duration` IS NULL) AND (`TM`.`Interface` ='.$Interface['Id'].')'); 67 67 $System->Database->update('NetworkInterface', '`Id` = "'.$Interface['Id'].'"', 68 68 array('Online' => $Interface['NewOnline'])); … … 75 75 while($DbRow = $DbResult->fetch_assoc()) 76 76 { 77 77 echo('IP '.$DbRow['LocalIP'].' online but time not updated.'."\n"); 78 78 } 79 79 $DbResult = $System->Database->select('NetworkInterface', '*', '(`Online` = 0) AND '.
Note:
See TracChangeset
for help on using the changeset viewer.