- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Generators/Netwatch.php
r835 r873 13 13 14 14 $DbResult3 = $this->Database->query('SELECT DISTINCT (`DHCP`) FROM `NetworkSubnet` WHERE `Configure` = 1'); // WHERE `Member` = 0'); 15 while ($Router = $DbResult3->fetch_assoc())15 while ($Router = $DbResult3->fetch_assoc()) 16 16 { 17 17 echo($Router['DHCP']."\n"); … … 19 19 $Items = array(); 20 20 $DbResult = $this->Database->query('SELECT * FROM `NetworkSubnet` WHERE (`Configure` = 1) AND (`DHCP`="'.$Router['DHCP'].'")'); 21 while ($Subnet = $DbResult->fetch_assoc())21 while ($Subnet = $DbResult->fetch_assoc()) 22 22 { 23 23 $I = explode('.', $Subnet['AddressRange']); … … 26 26 ' LEFT JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device` WHERE CompareNetworkPrefix(INET_ATON(`LocalIP`), INET_ATON("'.$Subnet['AddressRange'].'"), '.$Subnet['Mask'].')'. 27 27 ' AND (`NetworkDevice`.`Used` = 1) ORDER BY `NetworkInterface`.`LocalIP`'); 28 while ($Interface = $DbResult2->fetch_assoc())28 while ($Interface = $DbResult2->fetch_assoc()) 29 29 { 30 30 $Name = $Interface['DeviceName']; 31 if ($Interface['Name'] != '') $Name .= '-'.$Interface['Name'];31 if ($Interface['Name'] != '') $Name .= '-'.$Interface['Name']; 32 32 echo($Name.', '); 33 33 $Items[] = array('host' => $Interface['LocalIP'], 'interval' => '00:00:10', 'comment' => $Name);
Note:
See TracChangeset
for help on using the changeset viewer.