Changeset 815


Ignore:
Timestamp:
Mar 9, 2016, 10:38:13 PM (9 years ago)
Author:
chronos
Message:
  • Added: Linux periodic network ports check command.
Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r814 r815  
    11<?php
    22
    3 $Revision = 814; // Subversion revision
     3$Revision = 815; // Subversion revision
    44$DatabaseRevision = 814; // SQL structure revision
    55$ReleaseTime = strtotime('2016-03-09');
  • trunk/Modules/Network/Network.php

    r814 r815  
    667667  }
    668668 
    669   function CheckPortStatus($Ip, $Port)
    670   {
    671     $Timeout = 1;
    672     if($Socket = @fsockopen($Ip, $Port, $ErrorNumber, $ErrorString, $Timeout))
    673     {
    674       fclose($Socket);
    675       return(1);
    676     } else
    677     {
    678       return(0);
    679     }
    680   }
    681 
    682669  function PortCheckList($Title, $OnlineNow, $OnlinePrevious, $MinDuration)
    683670  {
     
    687674    $Condition = 'WHERE (`NetworkPort`.`Online` = '.$OnlineNow.') AND (`NetworkPort`.`OnlineNotify` = '.$OnlinePrevious.') '.
    688675      'AND (`NetworkPort`.`LastOnline` <= "'.TimeToMysqlDateTime($Time - $MinDuration).'")';
    689     $DbResult3 = $this->Database->query('SELECT CONCAT(CONCAT_WS("-", `NetworkDevice`.`Name`, NULLIF(`NetworkInterface`.`Name`, "")), ":", `NetworkPort`.`Number`) AS `Name`, '.
     676    $DbResult3 = $this->Database->query('SELECT CONCAT(CONCAT_WS("-", `NetworkDevice`.`Name`, NULLIF(`NetworkInterface`.`Name`, "")), ":", `NetworkPort`.`Number`, "(", `NetworkPort`.`Name`, ")") AS `Name`, '.
    690677      '`NetworkPort`.`Online`, `NetworkPort`.`LastOnline` FROM `NetworkPort` '.
    691678      'LEFT JOIN `NetworkInterface` ON `NetworkInterface`.`Id` = `NetworkPort`.`Interface` '.
     
    694681      '(`NetworkInterface`.`LocalIP` != "") AND (`NetworkPort`.`Enabled` = 1)'.
    695682      'ORDER BY `Name` ASC');
    696     echo($this->Database->LastQuery);
    697683    if($DbResult3->num_rows > 0)
    698684    {
  • trunk/Modules/NetworkConfigLinux/NetworkConfigLinux.php

    r781 r815  
    22
    33include_once(dirname(__FILE__).'/Generators/DNS.php');
     4include_once(dirname(__FILE__).'/Generators/CheckPorts.php');
    45
    56class ModuleNetworkConfigLinux extends AppModule
     
    2728  {
    2829    $this->System->ModuleManager->Modules['NetworkConfig']->RegisterConfigItem('linux-dns', 'ConfigDNS');
     30    $this->System->ModuleManager->Modules['NetworkConfig']->RegisterConfigItem('linux-checkports', 'ConfigCheckPorts');
    2931  }
    3032}
Note: See TracChangeset for help on using the changeset viewer.