Changeset 111 for system


Ignore:
Timestamp:
Nov 3, 2008, 7:48:12 PM (16 years ago)
Author:
george
Message:
  • Upraveno: GenerovacĂ­ skripty.
Location:
system
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • system/bandwidth2.php

    r103 r111  
    1717{
    1818  $Output = array();
    19   exec('iptables -t mangle -L '.$Table.' -v -x -n', $Output);
     19  exec('/sbin/iptables -t mangle -L '.$Table.' -v -x -n', $Output);
    2020  array_shift($Output);
    2121  array_shift($Output);
     
    6161      //$Hosts[$HostIp]['ports'] = array();
    6262      $Output2 = array();
    63       exec('iptables -t mangle -L '.$SubTable.' -v -x -n', $Output2);
     63      exec('/sbin/iptables -t mangle -L '.$SubTable.' -v -x -n', $Output2);
    6464      array_shift($Output2);
    6565      array_shift($Output2);
  • system/generators/dhcp_routerboard.php

    r103 r111  
    2424$Commands = array();
    2525//$MaxSubnet = 1;
    26 for($i = 1; $i <= 4; $i++)
     26$Commands[] = '/ip dhcp-server lease { remove [find]}';
     27for($i = 0; $i <= 5; $i++)
    2728{
    2829/*
     
    3536  while($Row = $DbResult->fetch_array())
    3637  {
    37     $Data = $Row['name'];
    38     if(strlen($Data) < 9) $Data .= "\t";
     38//    $Data = $Row['name'];
     39//    if(strlen($Data) < 9) $Data .= "\t";
    3940//    fputs($File, "  host ".$Data."\t{ fixed-address ".$Row['IP'].";\thardware ethernet ".$Row['MAC']."; }\n");
    40     $Commands[] = '/ip dhcp-server lease remove [/ip dhcp-server lease find mac-address='.$Row['MAC'].']';
    4141    $Commands[] = '/ip dhcp-server lease add mac-address='.$Row['MAC'].' address='.$Row['IP'].' server=dhcp'.$i.' comment='.$Row['name'];
    4242  }
     
    4646//fclose($File);
    4747$Commands = implode(';', $Commands);
    48 $Command = '/usr/bin/ssh -l admin-ssh -i /root/.ssh/id_dsa rt-hajda-5 "'.$Commands.'"';
     48$Command = '/usr/bin/ssh -l admin-ssh -i /root/.ssh/id_dsa rt-hajda-0 "'.$Commands.'"';
    4949echo($Command);
    5050exec($Command, $Output);
  • system/generators/netwatch.php

    r103 r111  
    55//$MaxSubnet = 1;
    66$Commands[] = '/tool netwatch remove [/tool netwatch find]';
    7 for($i = 0; $i <= 4; $i++)
    8 {
    9   $DbResult = $Database->select('hosts', '*', "IP LIKE '192.168.".$i."%' ORDER BY IP");
     7//for($i = 0; $i <= 4; $i++)
     8//{
     9  $DbResult = $Database->select('hosts', '*', 'IP != "" ORDER BY IP');
    1010  while($Row = $DbResult->fetch_array())
    1111  {
    1212    $Commands[] = '/tool netwatch add host='.$Row['IP'].' interval=1m comment='.$Row['name'];
    1313  }
    14 }
     14//}
    1515$Commands = implode(';', $Commands);
    16 $Command = '/usr/bin/ssh -l admin-ssh -i /root/.ssh/id_dsa rt-hajda-5 "'.$Commands.'"';
     16$Command = '/usr/bin/ssh -l admin-ssh -i /root/.ssh/id_dsa rt-hajda-0 "'.$Commands.'"';
    1717echo($Command);
    1818exec($Command, $Output);
  • system/generators/traffic_shaping.php

    r103 r111  
    2323$VoipSpeedIn = 100; //$SpeedReserve;
    2424$VoipSpeedOut = 100; //$SpeedReserve;
     25$FreeInetSpeed = 64;
    2526
    2627
     
    5051    fputs($File, "/sbin/tc class add dev imq0 parent 1:0 classid 1:1 htb rate ".$TotalMaxSpeedIn."kbit quantum 1500\n");
    5152    fputs($FileClassInfo, "1:2 Internet zdarma\n");
    52     fputs($File, "/sbin/tc class add dev imq0 parent 1:1 classid 1:".$FreeInetClass." htb rate 32kbit prio 3 quantum 1500\n");
     53    fputs($File, "/sbin/tc class add dev imq0 parent 1:1 classid 1:".$FreeInetClass." htb rate ".$FreeInetSpeed."kbit prio 3 quantum 1500\n");
    5354    fputs($File, "/sbin/tc qdisc add dev imq0 parent 1:".$FreeInetClass." handle ".$FreeInetClass.": sfq perturb 10\n");
    5455  }
     
    5960    fputs($File, "/sbin/tc qdisc add dev imq1 root handle 1:0 htb default 2\n");
    6061    fputs($File, "/sbin/tc class add dev imq1 parent 1:0 classid 1:1 htb rate ".$TotalMaxSpeedOut."kbit quantum 1500\n");
    61     fputs($File, "/sbin/tc class add dev imq1 parent 1:1 classid 1:".$FreeInetClass." htb rate 32kbit prio 3 quantum 1500\n");
     62    fputs($File, "/sbin/tc class add dev imq1 parent 1:1 classid 1:".$FreeInetClass." htb rate ".$FreeInetSpeed."kbit prio 3 quantum 1500\n");
    6263    fputs($File, "/sbin/tc qdisc add dev imq1 parent 1:".$FreeInetClass." handle ".$FreeInetClass.": sfq perturb 10\n");
    6364  }
  • system/netwatch_import.php

    r103 r111  
    88$Commands[] = '/tool netwatch print terse';
    99$Commands = implode(';', $Commands);
    10 $Command = '/usr/bin/ssh -l admin-ssh -i /root/.ssh/id_dsa rt-hajda-5 "'.$Commands.'"';
     10$Command = '/usr/bin/ssh -l admin-ssh -i /root/.ssh/id_dsa rt-hajda-0 "'.$Commands.'"';
    1111//echo($Command."\n");
    1212exec($Command, $Output);
  • system/statistic/traffic.php

    r37 r111  
    186186    'inet_down' => $NetworkStat['eth1']['down_avg'], 'inet_up' => $NetworkStat['eth1']['up_avg'],
    187187    'eth0_down' => $NetworkStat['eth0']['down_avg'], 'eth0_up' => $NetworkStat['eth0']['up_avg'],
    188     'wlan0_down' => $NetworkStat['wlan0']['down_avg'], 'wlan0_up' => $NetworkStat['wlan0']['up_avg'],
    189     'wlan1_down' => $NetworkStat['wlan1']['down_avg'], 'wlan1_up' => $NetworkStat['wlan1']['up_avg'],
    190     'wlan2_down' => $NetworkStat['wlan2']['down_avg'], 'wlan2_up' => $NetworkStat['wlan2']['up_avg'],
     188//    'wlan0_down' => $NetworkStat['wlan0']['down_avg'], 'wlan0_up' => $NetworkStat['wlan0']['up_avg'],
     189//    'wlan1_down' => $NetworkStat['wlan1']['down_avg'], 'wlan1_up' => $NetworkStat['wlan1']['up_avg'],
     190//    'wlan2_down' => $NetworkStat['wlan2']['down_avg'], 'wlan2_up' => $NetworkStat['wlan2']['up_avg'],
    191191    'eth2_down' => $NetworkStat['eth2']['down_avg'], 'eth2_up' => $NetworkStat['eth2']['up_avg']);
    192192  $Database->insert('traffic', $NewItem);
Note: See TracChangeset for help on using the changeset viewer.