tablewalk.pl
来自「Snmp(简单网管协议)软件包。」· PL 代码 · 共 20 行
PL
20 行
# snmpwalk of a single table# getnext of 3 columns from ipAddrEntry table# stop after last row in tableuse SNMP 1.8;my $host = shift || localhost;my $comm = shift || public;my $sess = new SNMP::Session ( DestHost => $host, Community => $comm );my $vars = new SNMP::VarList([ipAdEntAddr],[ipAdEntIfIndex],[ipAdEntNetMask]);for (@vals = $sess->getnext($vars); $vars->[0]->tag =~ /ipAdEntAddr/ # still in table and not $sess->{ErrorStr}; # and not end of mib or other error @vals = $sess->getnext($vars)) { print " ($vals[1]) $vals[0]/$vals[2]\n";}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?