Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Re: Send SNMP trap

by zengargoyle (Deacon)
on Sep 23, 2003 at 22:37 UTC ( [id://293711]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Send SNMP trap
in thread Send SNMP trap

use Net::SNMP qw(:asn1); # missing $monitor? my $monitor = '192.168.254.1'; # remove quotes from OCTET_STRING, it's a constant. my @oids = ($svSvcName, OCTET_STRING, $message);

the above changes make it work for me.

# snmptrapd -f -P 2003-09-23 15:20:06 NET-SNMP version 5.0.6 Started. 2003-09-23 15:20:25 192.168.254.1(via 192.168.254.1) TRAP, SNMP v1, co +mmunity public SNMPv2-SMI::enterprises Enterprise Specific Trap (0) Uptime: 0 +:00:01.00 SNMPv2-SMI::enterprises.77.1.2.3.1.1 = STRING: "THIS IS AN SNM +P TEST" 2003-09-23 15:20:48 192.168.254.1(via 192.168.254.1) TRAP, SNMP v1, co +mmunity public SNMPv2-SMI::enterprises Enterprise Specific Trap (0) Uptime: 0 +:00:01.00 SNMPv2-SMI::enterprises.77.1.2.3.1.1 = STRING: "THIS IS AN SNM +P TEST" 2003-09-23 15:21:08 192.168.254.1(via 192.168.254.1) TRAP, SNMP v1, co +mmunity public SNMPv2-SMI::enterprises Enterprise Specific Trap (0) Uptime: 0 +:00:00.00 SNMPv2-SMI::enterprises.77.1.2.3.1.1 = STRING: "THIS IS AN SNM +P TEST"

Replies are listed 'Best First'.
Re: Re: Re: Re: Send SNMP trap
by tertullian01 (Acolyte) on Sep 23, 2003 at 22:58 UTC
    That worked perfectly. I don't remember when I added the quotes to OCTET_STRING but that ridded me of the error. However what fixed the true proble was changing THIS: use Net::SNMP qw(:snmp); TO: use Net::SNMP qw(:asn1); Thanks for your help.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-25 02:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found