Changeset 264 for trunk/system/generators/netwatch_import.php
- Timestamp:
- Nov 25, 2009, 9:20:27 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/netwatch_import.php
r248 r264 15 15 $Routerboard->HostName = $Subnet['DHCP']; 16 16 $List = $Routerboard->ListGetPrint($Path, array('host', 'status')); 17 18 17 foreach($List as $Properties) 19 18 { … … 25 24 $Online = 1; 26 25 $Values = array('Online' => $Online, 'LastOnline' => 'NOW()'); 26 //echo($Properties['host']." up\n"); 27 27 } else 28 28 { 29 29 $Online = 0; 30 30 $Values = array('Online' => $Online); 31 //echo($Properties['host']." down\n"); 31 32 } 32 33 … … 39 40 $DbResult2 = $Database->select('NetworkInterfaceStat', '*', '(NetworkInterface="'.$InterfaceId.'") AND (Time = DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))'); 40 41 if($DbResult2->num_rows == 0) $Database->query('REPLACE INTO NetworkInterfaceStat (NetworkInterface, Time) VALUES ("'.$InterfaceId.'", DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))'); 41 $Database->query('UPDATE NetworkInterfaceStat SET Count =Count + 1 WHERE (NetworkInterface="'.$InterfaceId.'") AND (Time = DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))');42 $Database->query('UPDATE NetworkInterfaceStat SET PingCount = PingCount + 1 WHERE (NetworkInterface="'.$InterfaceId.'") AND (Time = DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))'); 42 43 } 43 44 }
Note:
See TracChangeset
for help on using the changeset viewer.