Changeset 264 for trunk/system
- Timestamp:
- Nov 25, 2009, 9:20:27 PM (15 years ago)
- Location:
- trunk/system/generators
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/generate.php
r213 r264 5 5 6 6 $Now = time(); 7 $DbResult = $Database->select('NetworkConfiguration', '*, UNIX_TIMESTAMP(LastTime)', '(Changed != 0) AND (Enabled = 1)');7 $DbResult = $Database->select('NetworkConfiguration', '*, UNIX_TIMESTAMP(LastTime)', '(Changed = 1) AND (Enabled = 1)'); 8 8 while($Service = $DbResult->fetch_assoc()) 9 9 { … … 24 24 //echo("Done\n"); 25 25 $ExecutionTime = time() - $ExecutionStart; 26 $Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Changed' => 0, 'LastTime' => 'NOW()', 'ExecutionTime' => $ExecutionTime, 'Log' => implode("\n", $Output))); 26 $Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Changed' => 0, 'LastTime' => 'NOW()', 'ExecutionTime' => $ExecutionTime)); 27 $Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Log' => implode("\n", $Output))); 27 28 } 28 29 } -
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.