Trap Receiver Reference

Trap Receiver Diagram

Links

Trap Receiver (top level object)

The top level object in this interface is called "UnbrowseSNMP.TrapReceiver".
This provides scripting access to start, stop, pause, resume the Unbrowse SNMP passive trap receiver. You can set filters, select adapters, and process traps as they arrive using the events mechanism.

Creating the top level object 

VBScript

Set TrapRcvr = CreateObject("UnbrowseSNMP.TrapReceiver")

Ruby

trapRcr = WIN32OLE.New("UnbrowseSNMP.TrapReceiver")

Events

Event Name Parameters Description
TNF_NewTrap Numeric - Trap ID

Trap Object - The newly arrived trap
This event is fired whenever the trap receiver gets a new trap from the network. You can use this event to process the traps as they arrive.
TNF_Error Numeric - Error Code

String - Error Message
Fired whenever the trap receiver encounters an error. You can mostly ignore the error number, unless you want to contact Unleash Networks for help. The error message is quite descriptive and will give you more information about the error.

Methods and Properties

Name Parameters Access Description
Stop
NA Stop the trap receiver
Start NA Start the trap receiver. You must call NewDatabase or Load prior to this method.
NewDatabase
NA Creates a new trap database in the temp folder to store incoming traps. You can then call SaveAs to move it to your preferred location.
Save
NA Save the trap database
SaveAs
String - Filename NA Saves the trap database in the specified file.
Close NA Close the trap database without saving.
Load String - Filename NA Load an existing trap database.
TrapCount Numeric Read The number of traps present in the trap database.
GetTrapByIdx Numeric - Index
Trap Object - Trap
NA Returns the specified trap within the database. The traps are numbered 0 to TrapCount - 1.

Example:
Set MyTrap = TrapRcvGetTrapByIdx 39
SetHostFilter String - allow these hosts (Allow List)

String - block these hosts (Block List)
NA Specify list of management stations or trap targets as a filter. 

Allow List = comma separated list of IP addresses of management stations 
Block List  = comma separated list of IP addresses of management stations

Example:
TrapRcv.SetHostFilter "192.168.1.1, 200.219.10.1",""
SetAgentFilter String - allow these agents (Allow List)

String - block these agents (Block List)
Na Specify list of agents as a filter.

AllowList = comma separated list of SNMP agents.
Block List  = comma separated list of IP addresses SNMP agents

Example:
TrapReceiver.SetAgentFilter "","192.168.1.0"
SetTrapFilter String - allow these trap OIDs (Allow List)

String - block these trap OIDs (Block List)
NA Specify list of traps as filter.

Allow List = comma separated list of trap OIDs to allow
Block List = comma separated list of trap OIDs to block

Example:
TrapRcv.SetTrapFilter "",".1.3.6.1.6.1.2.2.1"
SetVersionFilter
Bool - allow SNMPv1

Bool - allow SNMPv2

Bool - allow SNMPv3 
NA Filter out traps based on SNMP version

Example:
TrapRcv.SetVersionFilter True, False, True

The above line allows v1, and v3 traps 
SetFormatFilter
Bool - allow TRAPs

Bool - allow NOTIFYs

Bool - allow INFORMs
NA Filter out traps based on message  format

Example:
TrapMgr.SetVersionFilter False, True, True
The above line allows NOTIFY and INFORMs only
IsRunning Bool  NA Is the trap receiver currently running
Pause NA Pause the trap receiver
Resume NA Resume the trap receiver after a Pause
SetPortFilter String - allow these ports (Allow List)

String - block these ports (Block List)
NA Specify list of UDP ports as filter. This is useful in deployments where traps are sent to ports other than the standard UDP 162

Allow List - Comma separated list of ports to allow
Block List - Command separated list of ports to block
AdapterIndex
Numeric Read
Write
The active network adapter number  for the trap receiver. If your computer has multiple network adapters, then the adapter index corresponds to the order in which they appear on the Tools->Customize->Trap Console->Select adapter window.
UsePromiscuousMode Bool Read
Write
The trap receiver will put the network adapter in promiscuous mode if this is true. In most cases, set this to True (the default).
AdapterName String Read
Write
The adapter name. This is a GUID that Windows uses to identify the adapter. To see the name for the adapters on your system, go to Tools->Customize->Trap Console and then click on the Details button next to the selected adapter combo box.

Example :
TrapMgr.AdapterName = "{7727-AA8A-88374777-AB33}"
PreferRawOverPcap Bool Read
Write
The Unbrowse SNMP trap receiver can work with multiple providers. The two standard ones are "Windows Raw Sockets" and "Winpcap". If both are available then Unbrowse SNMP prefers Winpcap.

However, if the PreferRawOverPcap property is set to True, then the trap receiver will always use Windows Raw Sockets, even if the superior Winpcap is available.
IsWinpcapAvailable Bool Read Is Winpcap available for use ?
IsPaused Bool Read Is the trap receiver paused ?
Note that a paused trap receiver can be restarted by Resume. A Stopped trap receiver can be restarted by a Start.
AutoSave Bool Read Put the trap receiver in autosave mode.
ResetFilter NA Removes all filters

The Trap Object

Access the details of an individual trap object.

Events

None

Methods and Properties

Name Type / Access Parameters Description
SourceAddress
String Read The source IP addess in the trap message. Note: If using a proxy forwarding application, this is the address of the proxy forwarder.See AgentAddress for more.
DestinationAddress String Read The destination IP address in the trap message. Usually the address of the trap target or management application such as OpenView, CiscoWorks DFM, etc.
AgentAddress String Read The IP address of the agent sending the trap.
UserCommunity String Read For SNMPv1, v2c - this is the community string contained in the trap.
For SNMPv3 - this is the user name (USM) contained in the trap.
SnmpVersion 1 = v1
2 = v2c
3 = v3
Read The SNMP version
SysUpTime Numeric Read The value of the sysUpTime contained in the trap
GenericTrap Numeric Read The generic trap number
SpecificTrap Numeric Read The value of the specific trap number
EnterpriseOID
String Read The enterprise OID
VarbindCount Numeric Read Number of variable bindings (varbinds) contained sent along with the trap
TrapFormat
1 = TRAP
2 = NOTIFY
3 = INFORM
Read The type of trap
ContextName String Read The context name for SNMPv3 traps
TimestampLocal String Read Trap reception timestamp in the local timezone (at the machine running Unbrowse SNMP)
TimestampUTC String Read Trap reception timestamp (UTC)
TrapID Numeric Read Trap ID - Unbrowse SNMP assigns a unique number of each trap received
TrapOID String Read The OID of the trap
GetVarbindByIdx
Numeric - Index

Varbind Object
NA Returns the varbind at the specified index. Call VarbindCount to get the total number of varbinds sent along with the trap.
EffectiveTrapOID String Read Unbrowse SNMP can present a unified view of TRAPs, NOTIFYs, and INFORMs. The effective trap OID is equal to the Trap OID in NOTIFY and INFORM messages.
The effective trap OID is the enterprise OID followed by the specific trap number in TRAP messages.
AuxInfo String Read
Write
The auxiliary information attached to the trap. See the Unbrowse SNMP help for more details about this advanced feature.
VLANID Numeric Read The IEEE 802.1Q VLAN ID on which the trap message is sent.

The Varbind Object

A SNMP variable binding. An association of an OID with a value.

Events

None

Methods and Properties

Name Type / Access Parameters Description
OID
String Read The OID part of the variable binding
Value String Read The Value part


[sitemap]
Copyright (c) 2006-08, Unleash Networks, All rights reserved