Changeset 824 for trunk/Modules


Ignore:
Timestamp:
Apr 4, 2016, 8:41:19 PM (9 years ago)
Author:
chronos
Message:
  • Added: Network latency periodic measurement of network interfaces with local IP.
Location:
trunk/Modules
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Network/Network.php

    r822 r824  
    208208        'Wireless' => array('Type' => 'TNetworkInterfaceWirelessListInterface', 'Caption' => 'Bezdrátové spoje', 'Default' => ''),
    209209        'Ports' => array('Type' => 'TDevicePortListInterface', 'Caption' => 'Síťové porty', 'Default' => ''),
     210        'Latency' => array('Type' => 'TDeviceInterfaceLatencyListInterface', 'Caption' => 'Odezva sítě', 'Default' => ''),
    210211      ),
    211212      'AfterInsert' => array($this, 'AfterInsertNetworkInterface'),
     
    257258        'LastOnline' => array('Type' => 'DateTime', 'Caption' => 'Naposledy běželo', 'Default' => '', 'ReadOnly' => true),
    258259        'UpDown' => array('Type' => 'TNetworkPortUpDown', 'Caption' => 'Změny stavu', 'Default' => ''),
     260      ),
     261    ));
     262    $this->System->FormManager->RegisterClass('NetworkInterfaceLatency', array(
     263      'Title' => 'Sťová odezva',
     264      'Table' => 'NetworkInterfaceLatency',
     265      'Items' => array(
     266        'Time' => array('Type' => 'DateTime', 'Caption' => 'Čas', 'Default' => ''),
     267        'Interface' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní', 'Default' => ''),
     268        'Value' => array('Type' => 'Float', 'Caption' => 'Hodnota', 'Default' => '0', 'Suffix' => 'ms'),
    259269      ),
    260270    ));
     
    583593      'Type' => 'ManyToOne',
    584594      'Table' => 'NetworkPort',
     595      'Id' => 'Id',
     596      'Ref' => 'Interface',
     597      'Filter' => '1',
     598    ));
     599    $this->System->FormManager->RegisterFormType('TDeviceInterfaceLatencyListInterface', array(
     600      'Type' => 'ManyToOne',
     601      'Table' => 'NetworkInterfaceLatency',
    585602      'Id' => 'Id',
    586603      'Ref' => 'Interface',
  • trunk/Modules/NetworkConfigLinux/NetworkConfigLinux.php

    r815 r824  
    33include_once(dirname(__FILE__).'/Generators/DNS.php');
    44include_once(dirname(__FILE__).'/Generators/CheckPorts.php');
     5include_once(dirname(__FILE__).'/Generators/Latency.php');
    56
    67class ModuleNetworkConfigLinux extends AppModule
     
    2930    $this->System->ModuleManager->Modules['NetworkConfig']->RegisterConfigItem('linux-dns', 'ConfigDNS');
    3031    $this->System->ModuleManager->Modules['NetworkConfig']->RegisterConfigItem('linux-checkports', 'ConfigCheckPorts');
     32    $this->System->ModuleManager->Modules['NetworkConfig']->RegisterConfigItem('linux-latency', 'ConfigLatency');
    3133  }
    3234}
  • trunk/Modules/Notify/Notify.php

    r813 r824  
    7373      }
    7474    }
    75    
     75
    7676    // Send content to users
    7777    $DbResult = $this->Database->query('SELECT `NotifyUser`.`Id`, `NotifyUser`.`LastTime`, `User`.`Name`, `Contact`.`Value`, `Contact`.`Category` FROM `NotifyUser` '.
     
    8282      $Time = time();
    8383      $Output .= 'User '.$User['Name'].'<br/>';
    84      
     84
    8585      $this->Database->update('NotifyUser', '`Id`='.$User['Id'], array('LastTime' => TimeToMysqlDateTime($Time)));
    8686
     
    8989        $Mail->Subject = 'Notification';
    9090        $Mail->AddTo($User['Value'], $User['Name']);
    91         //$Mail->AddBody(strip_tags($Content), 'text/plain');
     91        $Mail->AddBody(strip_tags($Content), 'text/plain');
    9292        $Mail->AddBody('<style>
    9393table { border-collapse: collapse; }
Note: See TracChangeset for help on using the changeset viewer.