Mike,

I get the same error from the original code.
Please test the 2 changes shown in-line below.

Martin

> -----Original Message-----
> From: Mike Singleton [mailto:[EMAIL PROTECTED]]
> Sent: December 10, 2001 11:10 AM
> To: [EMAIL PROTECTED]
> Subject: Net::SNMP error
> 
> 
> Code:
> 
> use Net::SNMP
use Net::SNMP;  # Add a semi-colon.
> 
> my ($session, $error) = Net::SNMP->session(
> 
>       -hostname  => shift || 'localhost',
> 
>       -community => shift || 'public',
> 
>       -port      => shift || 161 
> 
>    );
> 
>    if (!defined($session)) {
> 
>       printf("ERROR: %s.\n", $error);
> 
>       exit 1;
> 
>    }
> 
>    my $sysUpTime = '1.3.6.1.2.1.1.3.0';
> 
>    my $result = $session->get_request(
> 
>       -varbindlist => [$sysUpTime]
$sysUpTime              # Use just the variable.
> 
>    );
> 
>    if (!defined($result)) {
> 
>       printf("ERROR: %s.\n", $session->error);
> 
>       $session->close;
> 
>       exit 1;
> 
>    }
> 
>    printf("sysUpTime for host '%s' is %s\n",
> 
>       $session->hostname, $result->{$sysUpTime} 
> 
>    );
> 
>    $session->close;
> 
>    exit 0;
> 
> 
> 
> 
> 
> Error:
> 
> "Net::SNMP=HASH(0x1c30cbc)" is not exported by the Net::SNMP 
> module at showusers.pl line 17
> 
> "" is not exported by the Net::SNMP module at showusers.pl line 17
> 
> Can't continue after import errors at showusers.pl line 17
> 
> BEGIN failed--compilation aborted at showusers.pl line 21.
> 
> 
> 
> 
> 
> ===
> 
> Mike Singleton CCNA, CNE, MCSE
> 
> Network Analyst
> 
> (253) 272-1916  x1259
> 
> (253) 405-1968 (cellular)
> 
> [EMAIL PROTECTED]
> 
> 
> 
> DaVita Inc.
> 
> 
> 
> _______________________________________________
> Perl-Win32-Admin mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
> 
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin


Reply via email to