in reply to Re: Send SNMP trap
in thread Send SNMP trap
I am including the full code so anyone can take a look at what is going on:Unknown ASN.1 type [0x01]
Also I don't know if this is of importance but the script is running on a Windows 2000 machine with perl 5.8use strict; use Net::SNMP qw(:snmp); my ($session, $error) = Net::SNMP->session( -hostname => shift || '$ +host', -community => 'public', -version => 'snmpv1', -port => shift || 16 +2 ); if (!defined($session)) { printf("ERROR: %s.\n", $error); exit 1; } my $svSvcName = '1.3.6.1.4.1.77.1.2.3.1.1'; my $message = "THIS IS AN SNMP TEST"; my @oids = ($svSvcName, "OCTET_STRING", $message); #my @oids; my $result = $session->trap( -agentaddr => '$monitor', -varbindlist => \@oids #-varbindlist => [$svSvcName, OCTET_STRIN +G, "$message"] ); if (!defined($result)) { printf("ERROR: %s.\n", $session->error); $session->close; exit 1; } $session->close;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Send SNMP trap
by zengargoyle (Deacon) on Sep 23, 2003 at 22:37 UTC | |
by tertullian01 (Acolyte) on Sep 23, 2003 at 22:58 UTC |