WAS THIS PAGE HELPFUL? Leave Feedback
This page shows how to set up trap handling for a device to be monitored by your GroundWork system.
If you've configuring the SNMP service and enabled forwarding, traps should begin arriving on the GroundWork server.
- In a terminal session for your GroundWork server, login and become user nagios.
- You can see the traps by tailing from the /usr/local/groundwork/logs directory, the snmptrapd.log file, and see that each message is just a numeric set of codes.
- The translation of these requires the knowledge of the same trap MIBs as the devices being monitored. These trap MIBs are available as text files, which can generally find on the manufacturer's site. There may be multiple MIBs to obtain, because the definitions are hierarchical. You would put the trap MIB file for a new device into a place like /tmp.
- From a command line on your target machine, and from the \Windows\system32 directory, copy a mib file (we use a MIB file included with Windows) to your GroundWork server /home/groundwork directory.
- From your GroundWork server, as user root, change to the /home/groundwork directory and run the script with the MIB text file as the argument.
- You should see a status scroll by for each trap, ending with the total, successful, and failed translations found.
- And it should end with the total, successful, and failed translations found. The failures might come from references to definitions in MIB files not present on the system. You will need to identify them and put them in the /usr/local/groundwork/common/share/snmp/mibs directory and try the conversion again.
- When you succeed, copy the output file (with the .conf extension) to the snmp directory.
- Then, in the same directory edit the snmptt.ini file, and include the new file with the appropriate path, at the bottom of the file. Don't forget to save the file.
- You may want to view the MIB .conf file. It has an entry for each kind of trap that might be sent. If you open the .conf file with an editor you can see the structure of each section, which is really a block of directions for the translator.
- Do you see the string at the end of each EVENT line? It serves two purposes, it shows up as the Severity code in the Event Console, and it informs Nagios of the State to be assigned to the snmptraps_last service. For the console the string is used as is, and for Nagios the string is translated as follows:
- NORMAL, OK, or INFORMATIONAL becomes OK
- MINOR or WARNING becomes WARNING
- MAJOR or CRITICAL becomes CRITICAL
- Any edits would require you to save the file and restart the snmptt service.
In this section we focus on Nagios and Foundation and how to show the originating host correctly in Status and in notifications. You'll need to import the SNMP Trap Receiver profile, add a host definition for the host sending the traps, and add the appropriate service to the host.
- Import the SNMP Trap Receiver service profile making the snmptraps_last service available for use:
- Go to Configuration > Profiles > Profile importer > Import > SNMP, and check the box for the SNMP Trap Receiver service profile and import.
- Create a new host:
- Add a host definition for the originating host adding the host vitals and the service-ping host profile. Make your way to the Host Properties 3 screen and select and add the snmptraps_last service to the host using Add to list, you'll see it displayed.
- Click Next and Continue, then click Cancel. And go ahead and commit these changes to the running Nagios and to Foundation, (Configuration > Control > Pre flight test > Commit). A pre-flight and annotation should always be a part of a commit process.
- To generate the traps you may need to stop and restart the SNMP Service on your monitored machine.
- Then within Event Console under Applications, select the SNMPTRAP filter. After a bit of time passes, you should see events listed with the Application Type SNMPTRAP. You should also see NAGIOS events, under the host for the snmptraps_last service. The state will reflect any changes you previously made in the .conf file.
- Also, if you go to the Status viewer and drill down to the monitored host service snmptraps_last, as the traps come in the detail on this will change. If you had set up notifications you'd be getting them as well.