#!/apps/rebol/rebol -qw

REBOL [

Title: "Send SNMP v1 Trap"

Date: 30-Oct-2000

Author: "Phil Hayes"

Version: 0.1

Owner: "The Cnut Archetype Ltd - www.cnut.dircon.co.uk"

Rights: "Copyright (C) The Cnut Archetype Ltd 2000"

Purpose: {

This script shows how SNMP v1 MIB II traps can be generated

utilising the model defined in snmpv1trap.r .

}

]

; Include SNMP object model

do %/apps/rebol/snmpv1trap.r

; Define trap object

trap1: make snmp-msg []

; Set varbinding length to ZERO

trap1/sm-pdu/varbindings/vb-size/SetLength 0

; Timeticks arbitrarily set to ZERO

trap1/sm-pdu/SetTimeTicks 0

; Define generic trap type !

trap1/sm-pdu/generic-trap/SetValue warmStart

; specific trap value arbitrarily set to ZERO

trap1/sm-pdu/specific-trap/SetValue 0

; Set IPv4 address of agent reporting

trap1/sm-pdu/agent-addr/SetValue 158.230.99.99

; Set Enterprise OID ( NB no need to enter 1.3.6.1.4.1 prefix )

trap1/sm-pdu/enterprise/SetValue #4404.1.1

; Now set size of PDU

trap1/sm-pdu/SetSize

; Define SNMP community

trap1/sm-community/SetValue "public"

; Set SNMP version ( 0 equiv to SNMP v1 )

trap1/sm-version/SetValue 0

; Set overall trap size

trap1/SetSize

; Send trap to snmp manager 'heathrow' standard port 162

udp: open udp://heathrow:162

insert udp trap1/GetData

close udp

quit




**********************************************************************
This email and any attachments may be confidential and the subject of 
legal professional privilege.  Any disclosure, use, storage or copying 
of this email without the consent of the sender is strictly prohibited.
Please notify the sender immediately if you are not the intended 
recipient and then delete the email from your inbox and do not 
disclose the contents to another person, use, copy or store the 
information in any medium. 
**********************************************************************
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to