Re: Calling SNMP.pm from snmptrapd using embedded perl

Wes Hardaker <[email protected]>
Newsgroups gmane.network.net-snmp.user
Organization Sparta
Message-ID <[email protected]>
>>>>> On Thu, 30 Mar 2006 12:45:32 +0100 (BST), "Peter Hicks" <[email protected]> said:

Peter> my $snmp_handle = new SNMP::Session(
Peter> DestHost =>
Peter> $device_info->{'ip_address'},
Peter> Community =>
Peter> $device_info->{'passwords'}->{$community_string_type'},
Peter> Version =>
Peter> $device_info->{'snmp_version'}
Peter> );
Peter> Everything else works fine.

Peter> Am I doing something wrong, or is SNMP.pm not suitable for
Peter> calling under embedded perl?

You probably can do what you're trying to do, but the problem may be
that you need to do a copy of the data rather than send it directly
from the above hash...

You might try:

  $addr = "$device_info->{'ip_address'}";
  $comm = "$device_info->{'passwords'}->{$community_string_type'}";
  $ver =  "$device_info->{'snmp_version'}";

...
  DestHost => $addr,
  Community => $comm,
  Version => $ver

I don't know that's your problem, as I can't see all the code (and it
may not help if I could), but the above might work.
-- 
Wes Hardaker
Sparta, Inc.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.