Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Getting readable results from Net::SNMP get_table method

by srawls (Friar)
on May 16, 2001 at 03:36 UTC ( [id://80752]=note: print w/replies, xml ) Need Help??


in reply to Getting readable results from Net::SNMP get_table method

Whenever you see code like this: HASH(0x82753ec) then you are referencing the entire hash, this is obviosly not what you want, so try this:
print "$result{$_}\n" for keys $result;
I am not familiar with the module you are using, but I think this code should work; if you have any more questions - just ask.

UPDATE: Thanks Ovid, I missed that one.

The 15 year old, freshman programmer,
Stephen Rawls

Replies are listed 'Best First'.
Re: Re: Getting readable results from Net::SNMP get_table method
by Ovid (Cardinal) on May 16, 2001 at 03:52 UTC
      When I use
      print "$result->{$_}\n" for keys %$result;
      I get output that looks like
      HASH(0x82a08e0)->(1.3.6.1.4.9.9.23.1.2.1.1.8.4.2)
      when I use the Data::Dumper module you suggest I get results that look like.
      '1.3.6.1.4.9.9.23.1.2.1.1.8.4.2' => 'WS-C6509'
      I assume that the oid is the key and the WS-C6509 is the object in the hash.

      How would I pull that all into hash that I would be able to manipulate?
        You asked for the contents of OID 1.3.6.1.4.9.9.23.1.2.1.1.8.4.2 and got it back, 'WS-C6509'.

        That data is in a hash, $result. You would access the data ala

        $result->{'1.3.6.1.4.9.9.23.1.2.1.1.8.4.2'}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-28 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found