0
通常我使用Python,但我有一个Perl项目。那么:将snmpwalk的结果指向字符串的过程是什么?我想搜索字符串以查看它是否包含较小的字符串。perl snmpwalk到字符串
这是我到目前为止有:
foreach (@list){
chomp($_);
system("snmpwalk -v 2c -c community-string $_ oid-hidden");
if (index($string, $substring) != -1) {
print "'$string' contains '$substring'\n";
}
}
我会推荐使用一个模块,或者[Net :: SNMP](https://metacpan.org/pod/Net: :SNMP),纯Perl模块或[SNMP.pm](http://www.net-snmp.org/docs/perl-SNMP-README.html),Perl绑定到net-snmp库。 – ThisSuitIsBlackNot