Changeset 264


Ignore:
Timestamp:
Nov 25, 2009, 9:20:27 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Import stavu netwatch. * Opraveno: Chybné označení dokončení restartu konfigurace.
Location:
trunk/system/generators
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/system/generators/generate.php

    r213 r264  
    55
    66$Now = time();
    7 $DbResult = $Database->select('NetworkConfiguration', '*, UNIX_TIMESTAMP(LastTime)', '(Changed != 0) AND (Enabled = 1)');
     7$DbResult = $Database->select('NetworkConfiguration', '*, UNIX_TIMESTAMP(LastTime)', '(Changed = 1) AND (Enabled = 1)');
    88while($Service = $DbResult->fetch_assoc())
    99{
     
    2424    //echo("Done\n");
    2525    $ExecutionTime = time() - $ExecutionStart;
    26     $Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Changed' => 0, 'LastTime' => 'NOW()', 'ExecutionTime' => $ExecutionTime, 'Log' => implode("\n", $Output)));
     26    $Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Changed' => 0, 'LastTime' => 'NOW()', 'ExecutionTime' => $ExecutionTime));
     27    $Database->update('NetworkConfiguration', 'Id='.$Service['Id'], array('Log' => implode("\n", $Output)));
    2728  }
    2829}
  • trunk/system/generators/netwatch_import.php

    r248 r264  
    1515  $Routerboard->HostName = $Subnet['DHCP'];
    1616  $List = $Routerboard->ListGetPrint($Path, array('host', 'status'));
    17  
    1817  foreach($List as $Properties)
    1918  {
     
    2524        $Online = 1;
    2625        $Values = array('Online' => $Online, 'LastOnline' => 'NOW()');
     26        //echo($Properties['host']." up\n");
    2727      } else
    2828      {
    2929        $Online = 0;
    3030        $Values = array('Online' => $Online);
     31        //echo($Properties['host']." down\n");
    3132      }
    3233
     
    3940        $DbResult2 = $Database->select('NetworkInterfaceStat', '*', '(NetworkInterface="'.$InterfaceId.'") AND (Time = DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))');
    4041        if($DbResult2->num_rows == 0) $Database->query('REPLACE INTO NetworkInterfaceStat (NetworkInterface, Time) VALUES ("'.$InterfaceId.'", DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))');         
    41         $Database->query('UPDATE NetworkInterfaceStat SET Count = Count + 1 WHERE (NetworkInterface="'.$InterfaceId.'") AND (Time = DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))');
     42        $Database->query('UPDATE NetworkInterfaceStat SET PingCount = PingCount + 1 WHERE (NetworkInterface="'.$InterfaceId.'") AND (Time = DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))');
    4243      }
    4344    }
Note: See TracChangeset for help on using the changeset viewer.