in reply to Net::SNMP ASN1 Type error

Please put <code>...</code> tags around your code (see Writeup Formatting Tips) - this is very hard to read. (code tags added as requested)

Can you show your use Net::SNMP line. You may have blocked INTEGER from being exported.

Also, private in -community =>private should be quoted.

-- Ken

Replies are listed 'Best First'.
Re^2: Net::SNMP ASN1 Type error
by jbumsted (Initiate) on Oct 11, 2010 at 19:47 UTC

    Thanks for the response Ken. I updated the original post to make it more readable. My use line is below.

    use Net::SNMP;

      That line looks fine. INTEGER should be exported by default. Please do the following:

      Add:

      use strict; use warnings;

      before that line.

      Quote the bareword private.

      Run it again and post any error output.

      -- Ken

        Ok, I have changed the code to this:

        use strict; use warnings; use Net::SNMP; my $ip = XXX.XXX.XXX.XXX; my $SESSION = Net::SNMP->session (-hostname=>$ip, -community=>"private +"); $SESSION->set_request(-varbindlist=> ['1.3.6.1.4.1.6080.3.1.2.4.0", IN +TEGER, 1]); print $SESSION->error();

        When I run that I get the following error: Bareword "INTEGER" not allowed while "strict subs" in use at line 19. If I put quotes around INTEGER, I get the original error of ASN.1 Type Integer unknown.