c has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use Net::SNMP; my $router = "10.8.10.133"; my $community = "secretstring"; my $tftpdir = "/company/configs/"; my $tftpserver = "10.15.145.15"; my $oid = ".1.3.6.1.4.1.9.2.1.55."; $oid = "$oid$tftpserver"; my $s; my $e; ($s, $e) = Net::SNMP->session( -hostname => $router -community => $com +munity ); my @param = qw($oid OCTET_STRING "host.cfg"); $s->set_request(@param); $s->close;
When I run this code, I receive the following errors:
Argument "community" isn't numeric in subtraction (-) at ./tftp.pl lin +e 14. Argument "57.8.10.133" isn't numeric in subtraction (-) at ./tftp.pl l +ine 14. Odd number of elements in hash assignment at /usr/lib/perl5/site_perl/5.6.0/Net/SNMP.pm line 196. Can't call method "set_request" on an undefined value at ./tftp.pl lin +e 20.
I am thinking that I am putting an incorrect ASN.1 value in my @param, but I am not sure. The errors I am seeing seem to imply that they are expecting a numeric value.
Can anyone comment on the right path to correct this?
humbly -c
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ASN.1 errors with Net::SNMP?
by mugwumpjism (Hermit) on Aug 10, 2001 at 01:33 UTC | |
|
Re: ASN.1 errors with Net::SNMP?
by traveler (Parson) on Aug 10, 2001 at 01:39 UTC |