The purpose of this article is to outline steps to easily deploy a trap listener in your
infrastructure to drive SNMP trap alerts into up.time. Although the article utilizes Trap Receiver
to receive SNMP Traps and execute scripts, one can use any SNMP trap receiver as long as it can execute scripts when traps are received.
Trap Receiver is a utility for Windows. If the up.time Monitoring Station is on Windows, you may choose to install it on the same server.
Here is a brief summary of what happens when an SNMP trap is sent:
- the SNMP-enabled device sends an SNMP trap to the SNMP Trap Receiver
- Trap Receiver reviews the list of configured Actions and executes Action(s) if the trap meets the filter
- the Trap Receiver Action executes the Trap_Receiver.bat script, which is a wrapper for Trap_Receiver.vbs
- Trap_Receiver.vbs calls up.time API to update the status of the External Check monitor associated with the device
- if an Alert Profile is associated with the monitor, an alert notification is sent out
Below is a diagram depicting the process:
SNMP Trap Scripts Configuration
- Download the SNMP Trap Receiver Scripts
- Extract Trap_Receiver_Scripts.zip file
- Put the files in an appropriate directory (e.g. C:uptime)
- Open Trap_Receiver.bat and look for the â€œSCRIPT_DIRâ€ variable. Change it to where you have put the scripts in step 2.
- Open Trap_Receiver.vbs and modify a few variables if needed:
â€¦this is where the up.time Monitoring Station is installed. Make certain the hostname/IP used can communicate from where the scripts are to the Monitoring Station.
â€¦this is the port up.time uses for the API. By default itâ€™s 9996.
â€¦this is the severity of the alert in up.time when an SNMP trap is received.
The value can be one of the following integers:
Trap Receiver Configuration
- Download Trap Receiver from the following website:
- Install Trap Receiver
- Launch the Trap Receiver UI
- Click on the â€œConfigureâ€ button:
- You should be at the â€œActionsâ€ tab. Click â€œAddâ€:
- Since the IP of the device sending out SNMP traps might be displayed differently in up.time, a separate action should be created for each device so that the proper hostname can be passed to up.time.
To add a new action tied to a particular IP:
- Under â€œWatchâ€, select â€œSender IPâ€.
- Under â€œEqualsâ€, input the IP Address of the device that will be sending the SNMP Traps.
- Check the â€œExecuteâ€ checkbox and click â€œConfigureâ€
- Click on the â€œâ€¦â€ button and select the â€œTrap_Receiver.batâ€ from SNMP Trap Scripts Configuration Step 2
- In the Arguments box, type the following:
â€¦where â€œyourDeviceNameâ€ is the â€œHost Nameâ€ in up.time. The â€œHost Nameâ€ can be found under the â€œInfoâ€ tab in up.time. For example:
- Check the â€œInclude Trap Dataâ€ checkbox. See below:
- Click â€œOKâ€
- Click â€œUpdateâ€ to get back to the Configure Trap Receiver window.
- Go to the â€œTrap Dataâ€ tab
- Check the â€œPass to Command Lineâ€ checkbox
- Click â€œSpecify Parametersâ€
- Make sure the following lines are checked and the Command Line Flags are as follow:
The end result should look like this:
||Command Line Flags
- Click â€œOKâ€ when complete
- The SNMP variables, by default, will be shown as numbers (e.g. 1.3.6â€¦). To show more meaningful variable names, you will need to load the appropriate MIBs from your devices.
Go to the â€œMibsâ€ tab in the â€œConfigure Trap Receiverâ€ window
- Check the â€œTranslate OIDsâ€ checkbox
- Obtain vendor-specific MIBs and load them by clicking the â€œLoad MIBâ€ button
- Click â€œOKâ€ when finish loading MIBs
Add an â€œExternal Checkâ€ Service Monitor in up.time:
- Click on the â€œServicesâ€ button at the top
- Click â€œAdd Service Monitorâ€ on the left
- Select â€œExternal Checkâ€ from the list of available Service Monitors and click â€œContinueâ€¦â€
- Input â€œSNMP-Trapâ€ as the Service Name
- From the drop down menu where it says "Select a System", select the host/device that will be sending the SNMP trap
- Click â€œFinishâ€