Changeset 865 for trunk/Modules/Network/Network.php
- Timestamp:
- Dec 23, 2019, 12:31:52 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Network/Network.php
r859 r865 193 193 'ShowOnline' => array('Type' => 'Boolean', 'Caption' => 'Ukázat online', 'Default' => '0'), 194 194 'IconName' => array('Type' => 'String', 'Caption' => 'Jméno ikony', 'Default' => '0'), 195 ), 195 'Devices' => array('Type' => 'TNetworkDeviceListType', 'Caption' => 'Síťová zařízení', 'Default' => ''), 196 ), 197 )); 198 $this->System->FormManager->RegisterFormType('TNetworkDeviceListType', array( 199 'Type' => 'ManyToOne', 200 'Table' => 'NetworkDevice', 201 'Id' => 'Id', 202 'Ref' => 'Type', 203 'Filter' => '1', 196 204 )); 197 205 $this->System->FormManager->RegisterClass('NetworkDeviceLog', array( … … 748 756 $this->Database->query('DELETE FROM `NetworkInterfaceLatency` WHERE `Interface`='.$Id); 749 757 } 750 758 751 759 function ImportNetworkLog($Parameters) 752 760 { 753 761 global $Config; 754 762 755 763 $DbResult = $this->System->Database->select('NetworkDeviceLog', 'Time', 756 764 '1 ORDER BY Time DESC LIMIT 1'); … … 762 770 763 771 $RemoteDb = new Database(); 764 $RemoteDb->Connect($Config['NetworkLog']['Host'], $Config['NetworkLog']['User'], 772 $RemoteDb->Connect($Config['NetworkLog']['Host'], $Config['NetworkLog']['User'], 765 773 $Config['NetworkLog']['Password'], $Config['NetworkLog']['Database']); 766 774 $DbResult = $RemoteDb->select('SystemEvents', '*', '`ReceivedAt`>"'. TimeToMysqlDate($StartTime).'"'.$WhereTime.' ORDER BY `Time` DESC'); … … 768 776 { 769 777 $DbResult2 = $this->System->Database->select('NetworkInterface', 'Device, CONCAT(CONCAT_WS("-", `NetworkDevice`.`Name`, NULLIF(`NetworkInterface`.`Name`, "")), ".") AS `Name` ', '`Name` LIKE "'.$DbRow['FromHost'].'"'); 770 if ($DbResult2->num_rows > 0) 778 if ($DbResult2->num_rows > 0) 771 779 { 772 780 $DbRow2 = $DbResult2->fetch_assoc(); 773 781 $DeviceID = $DbRow2['Device']; 774 $this->System->Database->insert('NetworkDeviceLog', array('Time' => $DbRow['ReceivedAt'], 782 $this->System->Database->insert('NetworkDeviceLog', array('Time' => $DbRow['ReceivedAt'], 775 783 'Device' => $DeviceId, 'Message' => $DbRow['Message'], 'Tags' => $DbRow['SysLogTag'])); 776 784 } else echo('Host '.$DbRow['Host'].' not paired with network device.'."\n");
Note:
See TracChangeset
for help on using the changeset viewer.