Ignore:
Timestamp:
Apr 29, 2016, 11:54:31 PM (9 years ago)
Author:
chronos
Message:
  • Added: Experimental metod for calculating maximum speed limit according network links.
  • Modified: Lowered routeros netwatch period to 30 seconds.
File:
1 edited

Legend:

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

    r825 r829  
    100100{
    101101  var $MinNotifyTime;
    102  
     102
    103103  function __construct($System)
    104104  {
     
    110110    $this->Description = 'Networking related tools';
    111111    $this->Dependencies = array('Notify');
    112    
     112
    113113    // TODO: Make notify time configurable
    114     $this->MinNotifytime = 2 * 60;
     114    $this->MinNotifyTime = 2 * 60;
    115115  }
    116116
     
    125125  function DoStart()
    126126  {
    127     $this->System->ModuleManager->Modules['Notify']->RegisterCheck('NetworkReachability', 
     127    $this->System->ModuleManager->Modules['Notify']->RegisterCheck('NetworkReachability',
    128128      array($this, 'ReachabilityCheck'));
    129     $this->System->ModuleManager->Modules['Notify']->RegisterCheck('NetworkPort', 
     129    $this->System->ModuleManager->Modules['Notify']->RegisterCheck('NetworkPort',
    130130      array($this, 'PortCheck'));
    131    
    132    
     131
     132
    133133    $this->System->RegisterPage('network', 'PageNetwork');
    134134    $this->System->RegisterPage(array('network', 'administration'), 'PageNetworkAdministration');
     
    297297      'Items' => array(
    298298        'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''),
     299        'MaxLinkSpeed' => array('Type' => 'Integer', 'Caption' => 'Maximální spojová rychlost', 'Default' => '0', 'Suffix' => 'bits/s'),
     300        'MaxRealSpeed' => array('Type' => 'Integer', 'Caption' => 'Maximální reálná rychlost', 'Default' => '0', 'Suffix' => 'bits/s'),
     301        'FullDuplex' => array('Type' => 'Boolean', 'Caption' => 'Plně duplexní', 'Default' => '0'),
     302        'Color' => array('Type' => 'Color', 'Caption' => 'Barva', 'Default' => '0'),
    299303      ),
    300304    ));
     
    669673      'Filter' => '1',
    670674    ));
    671    
     675
    672676    $this->System->ModuleManager->Modules['IS']->RegisterDashboardItem('Network',
    673677      array('ModuleNetwork', 'ShowDashboardItem'));
     
    680684    ));
    681685  }
    682  
     686
    683687  function AfterInsertNetworkDevice($Form)
    684688  {
     
    690694    $this->System->Models['NetworkDevice']->DoOnChange();
    691695  }
    692  
     696
    693697  function AfterInsertNetworkInterface($Form)
    694698  {
     
    700704    $this->System->Models['NetworkInterface']->DoOnChange();
    701705  }
    702  
     706
    703707  function BeforeDeleteNetworkInterface($Form, $Id)
    704708  {
     
    734738  {
    735739  }
    736  
     740
    737741  function OnlineList($Title, $OnlineNow, $OnlinePrevious, $MinDuration)
    738742  {
     
    748752      '(`NetworkInterface`.`LocalIP` != "") AND (`NetworkInterface`.`Enabled`=1)'.
    749753      'ORDER BY `Name` ASC');
    750     if($DbResult3->num_rows > 0) 
     754    if($DbResult3->num_rows > 0)
    751755    {
    752756      $Output .= $Title.'<br/>';
     
    780784    return($Output);
    781785  }
    782  
     786
    783787  function PortCheckList($Title, $OnlineNow, $OnlinePrevious, $MinDuration)
    784788  {
     
    808812        $Days = floor($Duration / (60 * 60 * 24));
    809813        if($Days > 0) $DurationText = $Days.' dnů '.$DurationText;
    810  
     814
    811815        $Output .= '<tr><td>'.$Item['Name'].'</td><td>'.$OnlineText[$Item['Online']].
    812816          '</td><td>'.$Item['LastOnline'].'</td><td>'.$DurationText.'</td></tr>'."\n";
     
    818822    return $Output;
    819823  }
    820  
     824
    821825  function PortCheck()
    822826  {
Note: See TracChangeset for help on using the changeset viewer.