I recently started a discussion on how to Monitor hardware using SNMPTraps in Foglight by using the SNMP TrapAgent.
Then someone asked me how to reuse the trap variables in Foglight Alarm Messages
FYI, the SNMPTrap Agent is part of the Foglight Integration Cartridge and can also be used to monitor your network devices.
Start to edit a Trap Variable via: Dashboards> Integration> SNMP Trap Administration> Configuration
Select a variable, click Format and you will see the SNMP variables available at the top of the Edit Trap window.
In this example:
- acctngFileName
- acctngFileMaximumSize
- acctngFileNameSuffix
You are then able to reuse these variables in the Message Format box like:
- ${acctngFileName}
- ${acctngFileMaximumSize}
- ${acctngFileNameSuffix}
This allows you to get a more descriptive error message in a Foglight Alarm.
In addition to the trap specific variables, you can also use variables ${host}, ${trapname} and ${technologyMonitor}. The ${host} is where the trap came from.
When you set up the SNMP Trap variable EXACTLY as above, you can execute on the host where your Foglight SNMPTrap Agent is running the following script in a windows command prompt:
@echo off
set DIR=C:\Quest_Software\Foglight\fglam\state\default\agents\OSCartridge\5.5.4\tools\bin\win32
set CMD=snmptrap -v2c -c public
set TRAPHOST=127.0.0.1
set UPTIME=''
set OID_acctngFileFull=1.3.6.1.2.1.60.2.0.2
set OID_acctngFileName=1.3.6.1.2.1.60.1.2.1.1.2 s "MyFileName"
set OID_acctngFileNameSuffix=1.3.6.1.2.1.60.1.2.1.1.3 s "sfx"
set OID_acctngFileMaximumSize=1.3.6.1.2.1.60.1.2.1.1.6 i 9999
%DIR%\%CMD% %TRAPHOST% %UPTIME% %OID_acctngFileFull% %OID_acctngFileName% %OID_acctngFileNameSuffix% %OID_acctngFileMaximumSize%
You will then get the following Foglight alarm:
Hope you will find this usefull
Cheers,Bart