ipforward.pl

来自「包含一下内容: * An extensible agent * An SNM」· PL 代码 · 共 31 行

PL
31
字号
use SNMP;$SNMP::use_enums = 1;my $host = shift;my $comm = shift;$sess = new SNMP::Session(DestHost => $host, Community => $comm);$vars = new SNMP::VarList( ['ipRouteIfIndex'], ['ipRouteType'],                           ['ipRouteProto'], ['ipRouteMask'],                           ['ipRouteNextHop'], ['ipRouteAge'],			   ['ipRouteMetric1']);format STDOUT_TOP =  Destination      Next Hop          Mask       Proto    Age    Metric--------------- --------------- -------------- ------- -------- ------.format STDOUT =@<<<<<<<<<<<<<< @<<<<<<<<<<<<<< @<<<<<<<<<<<<< @|||||| @||||||| @|||||$dest,          $nhop,          $mask,         $proto, $age,    $metric.for (($index,$type,$proto,$mask,$nhop,$age,$metric) = $sess->getnext($vars);     $$vars[0]->tag eq 'ipRouteIfIndex' and not $sess->{ErrorStr};     ($index,$type,$proto,$mask,$nhop,$age,$metric) = $sess->getnext($vars)) {    $dest = $$vars[0]->iid;    write;}print "$sess->{ErrorStr}\n";

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?