- Timestamp:
- May 25, 2014, 8:29:03 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Generators/NetwatchImport.php
r626 r657 15 15 16 16 // Load netwatch status from all DHCP routers 17 $DbResult3 = $System->Database->query('SELECT DHCP, AddressRange, Mask FROM `NetworkSubnet` WHERE (`Configure` = 1) AND (`Member` IS NULL) GROUP BY DHCP'); 17 $DbResult3 = $System->Database->query('SELECT `DHCP`, `AddressRange`, `Mask` FROM `NetworkSubnet` '. 18 'WHERE (`Configure` = 1) AND (`Member` IS NULL) GROUP BY DHCP'); 18 19 while($Subnet = $DbResult3->fetch_assoc()) 19 20 { … … 26 27 foreach($List as $Properties) 27 28 { 28 if($Properties['status'] == 'up') 29 if($Properties['status'] == 'up') $Online = 1; 30 else $Online = 0; 31 32 $DbResult = $System->Database->select('NetworkInterface', 'Online', '`LocalIP` = "'.$Properties['host'].'";'); 33 while($DbRow = $DbResult->fetch_assoc()) 34 { 35 $LastOnline = $DbRow['Online']; 36 $Interface = $DbRow['NetworkInterface']; 37 38 // Record state changes 39 if($Online != $LastOnline) 40 { 41 $System->Database->insert('NetworkInterfaceUpDown', array( 42 'Interface' => $Interface, 'State' => $Online, 'Time' => TimeToMysqlDateTime($StartTime))); 43 } 44 }; 45 46 if($Online) 29 47 { 30 48 $DbResult = $System->Database->update('NetworkInterface', '`LocalIP` = "'.$Properties['host'].'"',
Note:
See TracChangeset
for help on using the changeset viewer.