Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: changing localaddr

by Khen1950fx (Canon)
on Nov 02, 2011 at 17:30 UTC ( #935454=note: print w/replies, xml ) Need Help??

in reply to changing localaddr

I was thinking along the same lines as NetWallah, but I discovered that -agentaddr isn't recognized by SNMPv2c. Maybe this is closer to what you need.
#!/usr/bin/perl use strict; use warnings; use Net::SNMP::XS; use Net::SNMP qw(:ALL); my ( $session, $error ) = Net::SNMP->session( -hostname => '', -community => 'public', -localaddr => '', -port => SNMP_TRAP_PORT, -version => 'snmpv2c', -community => 'public', -debug => '0x02', -nonblocking => 0, ); if ( not defined $session ) { printf "ERROR: %s.\n", $error; exit 1; } my $result = $session->snmpv2_trap( -varbindlist => [ '', TIMETICKS, 600, '', OBJECT_IDENTIFIER, '', '', OCTET_STRING, 'Hub', '', OCTET_STRING, 'Closet Hub', ], ); if ( not defined $result ) { printf "ERROR: %s.\n", $session->error(); } else { printf "SNMPv2-Trap-PDU sent.\n"; }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935454]
[chickenman]: Thank you, I am looking for enlightenment! ;)
[chickenman]: Unfortunatly no standard, Its the Output of some command
[Discipulus]: ouch! it outputs always same fields?
[harishnv]: Can someone give me a solution fast

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2018-02-20 08:17 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (268 votes). Check out past polls.