Changeset 824


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
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/UpdateTrace.php

    r818 r824  
    20052005   $Manager->Execute('ALTER TABLE `NetworkPortUpDown`
    20062006     ADD CONSTRAINT `NetworkPortUpDown_ibfk_1` FOREIGN KEY (`Port`) REFERENCES `NetworkPort` (`Id`);');
     2007}
     2008
     2009function UpdateTo824($Manager)
     2010{
     2011  $Manager->Execute('CREATE TABLE IF NOT EXISTS `NetworkInterfaceLatency` (
     2012    `Id` int(11) NOT NULL AUTO_INCREMENT,
     2013    `Time` datetime NOT NULL,
     2014    `Interface` int(11) NOT NULL,
     2015    `Value` float NOT NULL,
     2016    PRIMARY KEY (`Id`),
     2017    KEY `Interface` (`Interface`)
     2018    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;');
     2019  $Manager->Execute('ALTER TABLE `NetworkInterfaceLatency`
     2020    ADD CONSTRAINT `NetworkInterfaceLatency_ibfk_1` FOREIGN KEY (`Interface`) REFERENCES `NetworkInterface` (`Id`);');
    20072021}
    20082022
     
    20982112      814 => array('Revision' => 817, 'Function' => 'UpdateTo817'),
    20992113      817 => array('Revision' => 818, 'Function' => 'UpdateTo818'),
     2114      818 => array('Revision' => 824, 'Function' => 'UpdateTo824'),
    21002115    ));
    21012116  }
  • trunk/Application/Version.php

    r820 r824  
    11<?php
    22
    3 $Revision = 820; // Subversion revision
    4 $DatabaseRevision = 818; // SQL structure revision
    5 $ReleaseTime = strtotime('2016-03-20');
     3$Revision = 824; // Subversion revision
     4$DatabaseRevision = 824; // SQL structure revision
     5$ReleaseTime = strtotime('2016-04-04');
  • trunk/Common/Global.php

    r803 r824  
    365365    if($Delay < 0) $Delay = 0;
    366366
    367     echo('Waiting '.$Delay.' seconds...'."\n");
     367    echo('Waiting remaining '.$Delay.' of '.$Period.' seconds...'."\n");
    368368    sleep($Delay);
    369369  }
  • 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.