Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Net::SNMP ASN1 Type error

by kcott (Archbishop)
on Oct 11, 2010 at 19:33 UTC ( [id://864680]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://864680]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (None)
    As of 2024-04-25 01:31 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found