- 论坛徽章:
- 0
|
回复 14# 兰花仙子
嗯,我试了用Net::SNMP模块了,执行后报错,代码如下:- use strict;
- use Net::SNMP;
- my $OID_disk='1.3.6.1.2.1.25.2.3.1.5';
- my ($session,$error) = Net::SNMP->session(
- -hostname => '192.168.1.3',
- -community => 'public',
- # -version => 'snmpv2c',
- );
- if (! defined $session) {
- printf "ERROR: %s.\n", $error;
- exit 1;
- }
- my $result = $session->get_request(-varbindlist => [$OID_disk],);
- if (!defined $result) {
- printf "ERROR: %s.\n", $session->error();
- $session->close();
- exit 1;
- }
- print "$result->{$OID_disk}";
- $session->close();
- exit 0
复制代码 执行后报一下错误:
ERROR: Received noSuchName(2) error-status at error-index 1.
错误状态在错误索引1 是怎么回事呢? |
|