Sending SNMP Traps
You send SNMP traps to network management solutions to be able to report the status of specific processes. SNMP is frequently used to monitor network devices and is more and more used to monitor applications, as the monitoring infrastructure is already present, no new solution has to be implemented.
Procedure
Sending a trap with a Chain Definition
- Navigate to "Definitions > Chains".
- Choose Edit from the context-menu of an existing chain definition.
- From the context-menu of the top-level chain definition, choose Add Step, give the step a user-friendly name to be able to easily locate it later.
- From the context-menu of the step, choose New Chain Process and fill
SNMP
into the Process Definition field, select System_SNMP_SendTrap, specify default values for the parameters. - On every step, select Goto Step in the Action field and select the notification step for On Canceled, On Error, and On Killed.
- Additionally, on the before last step, select Mark Chain Completed in the On Completed field.
- Choose Save & Close.
Example
Creating a chain definition to send a trap
- Navigate to "Definitions > Chains".
- Choose New Chain Definition from the context-menu, fill
JC_SendTrap
into the Name field on the Chain Definition tab. - On the Chain Definition tab, choose Add Step from the context-menu of the chain definition and give the step the name Retrieve System Info.
- Choose Add Chain Process from the context-menu of the step and fill
System_Info
into the Process Definition field. - From the context-menu of the chain definition, choose Add Step, give the step the name Send Trap On Error.
- From the context-menu of the step, choose New Chain Process and fill
System_SNMP_SendTrap
into the Process Definition field. - Fill
snmp.example.com
into Host,162
into Port,PUBLIC
into Community, =jobId into ID and='The chain process '+jobId+' failed, upper-most chain ID is:'+topLevelJobId
into the Data field. - On the step Retrieve System Info, select Goto Step in the Action field and select the Send Trap On Error step for On Canceled, On Error, and On Killed.
- Additionally, select Mark Chain Completed in the On Completed field of the Retrieve System Info step.
- Choose Save & Close.
Sending a test trap
- Choose Submit from the context-menu of the chain definition JC_SendTrap (created in previous example).
- On the Times and Dates tab, set the Requested Start Time 5 minutes in the future and choose Submit.
- Navigate to "Monitoring > Processes" and locate the chain you submitted previously, expand it fully and cancel the Generate an overview of the system chain process.
- Wait for the chain to finish and open your network management solution to inspect the trap.