Send SNMP Traps from Solarwinds

Send SNMP Traps from Solarwinds Orion
This project started to integrate Solarwinds and Netcool. I will be writing this as a two-part piece one for sending the traps from Solarwinds and one to receive in Netcool. This should work for other aggregators as well though. Anything that accepts SNMP Traps should be able to work with Solarwinds when the following actions are taken.

Create a file in the $Solarwinds_Home dir, in this case we called it “netcool.trap”. You could create a file for different alert types, or for different aggregators, but in general the file is going to be the same.

BOF netcool.trap

## Do not modify
<SNMPTrap>
<Application Name="SolarWinds SNMP Trap Engine" Version="1.0.28" Copyright="Copyright 1995-2003 SolarWinds.Net All rigths reserved." ReleaseDate="October 2003" TimeStamp="16-Sep-04 01:06 PM"></Application>
<Trap SourceHostname="" SourceIPAddress="" DestinationHostname="" DestinationIPAddress="" CommunityString="" DateTime="12:00:00 AM 12:00 AM">
<OIDs>

<OID OID="1.3.6.1.2.1.1.3.0" MIB="RFC1213-MIB" Name="sysUpTime.0" Value="0" DataType="67" ValueName="0" HexValue=""></OID>
<OID OID="1.3.6.1.6.3.1.1.4.1.0" MIB="SNMPv2-MIB" Name="snmpTrapOID.0" Value="1.3.6.1.4.1.11307.10" DataType="6" ValueName="SOLARWINDS-TRAPS" HexValue=""></OID>
<OID OID="1.3.6.1.6.3.1.1.4.3.0" MIB="SNMPv2-MIB" Name="snmpTrapEnterprise.0" Value="1.3.6.1.4.1.11307" DataType="6" ValueName="SolarWinds" HexValue=""></OID>


<OID OID="1.3.6.1.4.1.11307.10.1" MIB="SNMPv2-SMI" Name="enterprises.11307.10.1" Value="${AlertName}" DataType="4" ValueName="AlertName" HexValue=""></OID>
<OID OID="1.3.6.1.4.1.11307.10.2" MIB="SNMPv2-SMI" Name="enterprises.11307.10.2" Value="${NodeName}" DataType="4" ValueName="NodeName" HexValue=""></OID>
<OID OID="1.3.6.1.4.1.11307.10.3" MIB="SNMPv2-SMI" Name="enterprises.11307.10.3" Value="${Node.IP_Address}" DataType="4" ValueName="Node.IP_Address" HexValue=""></OID>

## Custom Settings:  The following can be modified in the following format.  Each OID must increment the last number.  1.3.6.1.4.1.11307.10.14 then 1.3.6.1.4.1.11307.10.15…
Add whatever values you need here and then create the rules in Netcool to translate.

<OID OID="1.3.6.1.4.1.11307.10.4" MIB="SNMPv2-SMI" Name="enterprises.11307.10.4" Value="${Node.NodeID}" DataType="4" ValueName="Node.NodeID" HexValue=""></OID>
<OID OID="1.3.6.1.4.1.11307.10.5" MIB="SNMPv2-SMI" Name="enterprises.11307.10.5" Value="${NetObjectID}" DataType="4" ValueName="NetObjectID" HexValue=""></OID>
<OID OID="1.3.6.1.4.1.11307.10.6" MIB="SNMPv2-SMI" Name="enterprises.11307.10.6" Value="${NetObjectName}" DataType="4" ValueName="NetObjectName" HexValue=""></OID>
<OID OID="1.3.6.1.4.1.11307.10.7" MIB="SNMPv2-SMI" Name="enterprises.11307.10.7" Value="${ObjectName}" DataType="4" ValueName="ObjectName" HexValue=""></OID>
<OID OID="1.3.6.1.4.1.11307.10.8" MIB="SNMPv2-SMI" Name="enterprises.11307.10.8" Value="${ObjectType}" DataType="4" ValueName="ObjectType" HexValue=""></OID>
<OID OID="1.3.6.1.4.1.11307.10.9" MIB="SNMPv2-SMI" Name="enterprises.11307.10.9" Value="${Node.Team}" DataType="4" ValueName="Team" HexValue=""></OID>
<OID OID="1.3.6.1.4.1.11307.10.10" MIB="SNMPv2-SMI" Name="enterprises.11307.10.10" Value="${Node.Contact}" DataType="4" ValueName="Contact" HexValue=""></OID>
<OID OID="1.3.6.1.4.1.11307.10.11" MIB="SNMPv2-SMI" Name="enterprises.11307.10.11" Value="${Node.Location}" DataType="4" ValueName="Location" HexValue=""></OID>
<OID OID="1.3.6.1.4.1.11307.10.12" MIB="SNMPv2-SMI" Name="enterprises.11307.10.12" Value="${Node.Severity}" DataType="4" ValueName="Severity" HexValue=""></OID>
<OID OID="1.3.6.1.4.1.11307.10.13" MIB="SNMPv2-SMI" Name="enterprises.11307.10.13" Value="${Node.Device_Type}" DataType="4" ValueName="Device_Type" HexValue=""></OID>
<OID OID="1.3.6.1.4.1.11307.10.14" MIB="SNMPv2-SMI" Name="enterprises.11307.10.14" Value="${AlertMessage}" DataType="4" ValueName="AlertMessage" HexValue=""></OID>
<OID OID="1.3.6.1.4.1.11307.10.15" MIB="SNMPv2-SMI" Name="enterprises.11307.10.15" Value="${Node.MachineType}" DataType="4" ValueName="MachineType" HexValue=""></OID>


</OIDs></Trap></SNMPTrap>

EOF netcool.trap

Then in the Advanced Alerts manager open the alert you wish to forward or create a new alert. Go to the Trigger Actions Tab and click the Add New Action button. Configure the new alert by adding the IP or hostname of the Destination Server in the SNMP Trap Destinations box. Multiple hosts can be separated by a comma. Select “netcool” from the Trap Template. In the alert message field, enter something like the following:

5&1&High Receive Percent&${NetObjectName}&Interface ${NetObjectName} on ${NodeName} received at ${Interface.InPercentUtil}% of its utilization, which triggered this alert. ${SQL:SELECT Macro FROM NetFlowAlertMacros WHERE ID='InInterfaceDetailsLink'}

To break this down:

Each field in Netcool is delimited by &. You can choose whatever delimiter you wish, just helps to split the fields in once it gets to Netcool.

5 is a hard coded Severity in Netcool.
1 is a hard coded Type in Netcool.
Any text you want to see in the message and variables that Solarwinds will fill are enclosed in ${}. You can find a list of variables in the admin documentation for Solarwinds.

The next thing you will want to do is set the Reset Actions. Repeat the same steps, only this time you will enter something more like the following in the alert message field:

0&2&High Receive Percent&${NetObjectName}&Interface ${NetObjectName} on ${NodeName} received at ${Interface.InPercentUtil}% of its utilization, which triggered this alert. ${SQL:SELECT Macro FROM NetFlowAlertMacros WHERE ID='InInterfaceDetailsLink'}

0 equates to a Severity of Clear in Netcool.
2 equates to an Alert Type of Clear in Netcool.
Everything else remains the same.

Happy Trapping.

Category: 
Share: 

GuardianMS
Guarding your IT Experience!

Add new comment