randomspam has asked for the wisdom of the Perl Monks concerning the following question:
this has been changed so normally the values are unique and all that :Pmy( $session, $error ); ( $session, $error ) = Net::SNMP->session( -hostname=>'1.1.1.1', -community=>'silly', -port=>162 ); if( length( $session->error())) { print "Session Error $session->error()\n"; return; } my( $result ); $result = $session->trap( -enterprise=>'.3.1.4.1.5', -specifictrap=>1000, -varbindlist=>['.3.1.4.1.5', UNSIGNED32, $resu +lt{1}, '.3.1.4.1.5', UNSIGNED32, $resu +lt{2}, '.3.1.4.1.5', UNSIGNED32, $resu +lt{3}, '.3.1.4.1.5', UNSIGNED32, $resu +lt{4}, '.3.1.4.1.5', UNSIGNED32, $resu +lt{5}, '.3.1.4.1.5', UNSIGNED32, $resu +lt{6}, '.3.1.4.1.5', UNSIGNED32, $resu +lt{7}, '.3.1.4.1.5', UNSIGNED32, $resu +lt{8} ] ); if (!defined($result)) { printf ("SCript error: %s.\n", $session->error); $session->close; return; } $result = $session->trap( -enterprise=>'.1.3.6.1.3.42', -specifictrap=>999, -varbindlist=>['.3.1.4.1.5', UNSIGNED32, $resu +lt{9}, '.3.1.4.1.5', UNSIGNED32, $resu +lt{10}] ); if (!defined($result)) { printf("ERROR: %s.\n", $session->error); $session->close; return; } $session->close(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SNMP Trap Help
by shmem (Chancellor) on Mar 22, 2007 at 09:11 UTC | |
|
Re: SNMP Trap Help
by randomspam (Initiate) on Mar 22, 2007 at 09:50 UTC |