chrism01 has asked for the wisdom of the Perl Monks concerning the following question:
and got the following result:#!/usr/bin/perl -w use strict; use Net::SNMP; my ($session, $error) = Net::SNMP->session( -hostname => shift || '1.2.3.4', -community => shift || 'passwd', -port => shift || 6 ); if (!defined($session)) { printf("Session ERROR: %s.\n", $error); exit 1; } #my $octets_out = '1.3.6.1.2.1.1.3.0'; my $octets_out = 'interfaces.ifTable.ifEntry.ifOutOctets'; my $result = $session->get_request( -varbindlist => [$octets_out] ); if (!defined($result)) { printf("get_req ERROR: %s.\n", $session->error); $session->close; exit 1; } printf("octets_out for host '%s' is %s\n", $session->hostname, $result->{$octets_out} ); $session->close;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SNMP get_request problem
by pg (Canon) on Sep 29, 2005 at 02:43 UTC | |
|
Re: Net::SNMP get_request problem
by spiritway (Vicar) on Sep 29, 2005 at 01:59 UTC | |
|
Re: Net::SNMP get_request problem
by chrism01 (Friar) on Sep 29, 2005 at 03:59 UTC | |
by insaniac (Friar) on Sep 30, 2005 at 17:37 UTC | |
|
Re: Net::SNMP get_request problem
by insaniac (Friar) on Sep 30, 2005 at 08:57 UTC |