- Timestamp:
- Sep 8, 2009, 9:03:14 AM (15 years ago)
- Location:
- trunk/system
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/dhcp_routerboard.php
r239 r248 9 9 $Routerboard->UserName = $Config['MainRouter']['UserName']; 10 10 $Routerboard->Timeout = $Config['MainRouter']['ConnectTimeout']; 11 $Routerboard->Debug = true; 11 12 12 13 $DbResult = $Database->query('SELECT * FROM `NetworkSubnet` WHERE `Member` = 0'); -
trunk/system/generators/nat_routerboard.php
r240 r248 9 9 $Routerboard->UserName = $Config['MainRouter']['UserName']; 10 10 $Routerboard->Timeout = $Config['MainRouter']['ConnectTimeout']; 11 $Routerboard->Debug = true; 11 12 12 13 $InetInterface = $Config['MainRouter']['InetInterface']; -
trunk/system/generators/netwatch.php
r239 r248 9 9 $Routerboard->UserName = $Config['MainRouter']['UserName']; 10 10 $Routerboard->Timeout = $Config['MainRouter']['ConnectTimeout']; 11 $Routerboard->Debug = true; 11 12 12 13 $DbResult3 = $Database->query('SELECT DISTINCT (`DHCP`) FROM `NetworkSubnet` WHERE `Member` = 0'); -
trunk/system/generators/netwatch_import.php
r247 r248 16 16 $List = $Routerboard->ListGetPrint($Path, array('host', 'status')); 17 17 18 //print_r($List);19 18 foreach($List as $Properties) 20 19 { 21 20 if(IsAddressInSubnet($Properties['host'], $Subnet['AddressRange'], $Subnet['Mask'])) 22 21 { 22 //echo($Properties['host'].', '); 23 23 if($Properties['status'] == 'up') 24 24 { … … 36 36 $DbResult = $Database->select('NetworkInterface', 'Id', 'LocalIP = "'.$Properties['host'].'"'); 37 37 $DbRow = $DbResult->fetch_assoc(); 38 $ HostId = $DbRow['Id'];39 $DbResult2 = $Database->select(' stat_hosts', '*', '(host_id="'.$HostId.'") AND (time = DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))');40 if($DbResult2->num_rows == 0) $Database->query('REPLACE INTO stat_hosts (host_id, time) VALUES ("'.$HostId.'", DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))');41 $Database->query('UPDATE stat_hosts SET count = count + 1 WHERE (host_id="'.$HostId.'") AND (time = DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))');38 $InterfaceId = $DbRow['Id']; 39 $DbResult2 = $Database->select('NetworkInterfaceStat', '*', '(NetworkInterface="'.$InterfaceId.'") AND (Time = DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))'); 40 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 42 } 43 43 } -
trunk/system/generators/traffic_shaping_routerboard.php
r243 r248 14 14 $Routerboard->Timeout = $Config['MainRouter']['ConnectTimeout']; 15 15 $Routerboard->HostName = $Config['MainRouter']['HostName']; 16 $Routerboard->Debug = true; 16 17 17 18 $Finance = &$System->Modules['Finance']; -
trunk/system/routerboard.php
r242 r248 10 10 var $PrivateKey = 'id_dsa'; 11 11 var $MaxBurstLineCount = 100; 12 12 var $Debug = false; 13 13 14 function __construct($HostName = 'localhost', $UserName = 'admin', $Password = '') 14 15 { … … 52 53 $Commands = str_replace('$', '\$', $Commands); 53 54 $Command = $this->SSHPath.' -o ConnectTimeout='.$this->Timeout.' -l '.$this->UserName.' -i '.$this->PrivateKey.' '.$this->HostName.' "'.$Commands.'"'; 54 echo($Command);55 if($this->Debug) echo($Command); 55 56 exec($Command, $Output); 56 57 } else $Output = ''; 57 print_r($Output);58 if($this->Debug) print_r($Output); 58 59 return($Output); 59 60 } … … 235 236 } 236 237 } 237 print_r($Commands);238 if($this->Debug) print_r($Commands); 238 239 return($this->Execute($Commands)); 239 240 }
Note:
See TracChangeset
for help on using the changeset viewer.