How to set up monitoring with SNMP Polling

WAS THIS PAGE HELPFUL? Leave Feedback

Overview

This page shows how to apply SNMP polling checks in your GroundWork Monitor system to monitor status and availability of a many different types of IT equipment. The appropriate service profile needs to be made available for use, you can then create a host definition for your managed host and attach the profile to the definition. Make sure you are using the same community string, test your work, and if all is well the monitoring should begin.

Steps
Import the SNMP service profile

In these first steps you'll configure the GroundWork server side.

  • Import the SNMP service profile:
    • Go to Configuration > Profiles > Profile Importer > Import > SNMP, and check the box for Windows 2003 Service Profile 6.1-1, or other SNMP profiles depending on your needs, and import.
  • Create a new host:
    • Add a host definition for your the monitored system providing the host vitals and the host-profile-service-ping host profile. Make your way to the Host Properties 3 screen and select the profile for SNMP (e.g.,snmp-win2k3) and make sure to click Add Profile. You should see the profile added under the Service Profiles section.
    • Continue by selecting ;Next>>, then Continue, and Cancel since you're finished.
Verify the SNMP community string

Now you should check the community string stored in a Nagios Resource Macro. This standard way of configuring depends on the notion that you can have one community string for all SNMP devices to be monitored. If that is not possible there are alternative ways to specify it, but for now lets continue with the steps below.

  • Go to Configuration > Control > Nagios resource macros. Verify/change the macro USER7 to the community string, it's set to public by default. A change would require selecting the macro, updating, and committing the change. If no change click Close.
Test services

The configuration tool has a feature to do testing of checks before they are committed. If you receive an error you can test the argument from a command line. To test check:

  • In Configuration open the target host you created for polling. Select the snmp_w2k3_if_1 service and open the Service Check tab. Then click the Test button. If everything is correctly set up, the result will appear as a successful check.
Debugging from the command line

Suppose you got an error and it's not immediately clear to you what the problem is. Here's a troubleshooting technique you might employ.

  • You can start by copying and executing a command string. From the Test area in the user interface highlight the command string and copy it. Then in a terminal session to your GroundWork server, as the nagios user, paste and execute the command in the libexec subdirectory.
    The display below has breaks in the command due to screen space.
    nagios@ip-10-30-2-10:~$ /usr/local/groundwork/nagios/libexec/check_snmp -H 10.30.2.70 -C public -o "IF-MIB:
    :ifInOctets.1,IF-MIB::ifOutOctets.1 ,IF-MIB::ifInDiscards.1,IF-MIB::ifOutDiscards.1,IF-MIB::ifInErrors.1,
    IF-MIB::ifOutErrors.1"
    SNMP OK - 0 0 0 0 0 0 | IF-MIB::ifInOctets.1=0c IF-MIB::ifOutOctets.1=0c IF-MIB::ifInDiscards.1=0c IF-MIB:
    :ifOutDiscards.1=0c IF-MIB::ifInErrors.1=0c IF-MIB::ifOutErrors.1=0c
    nagios@ip-10-30-2-10:~$
  • Now, add an argument to the command to turn up some debugging by adding -v at the end and run it again.
    The display below has breaks in the command due to screen space.
  • You should see more details broken out.
    nagios@ip-10-30-2-10:~$ /usr/local/groundwork/nagios/libexec/check_snmp -H 10.30.2.70 -C public -o "IF-MIB:
    :ifInOctets.1,IF-MIB::ifOutOctets.1 ,IF-MIB::ifInDiscards.1,IF-MIB::ifOutDiscards.1,IF-MIB::ifInErrors.1,
    IF-MIB::ifOutErrors.1" -v
    /usr/local/groundwork/common/bin/snmpget -t 1 -r 5 -m ALL -v 1 [authpriv] 10.30.2.70:161 IF-MIB::ifInOctets.1 IF-MIB:
    :ifOutOctets.1 IF-MIB::ifInDiscards.1 IF-MIB::ifOutDiscards.1 IF-MIB::ifInErrors.1 IF-MIB::ifOutErrors.1
    IF-MIB::ifInOctets.1 = Counter32: 0
    IF-MIB::ifOutOctets.1 = Counter32: 0
    IF-MIB::ifInDiscards.1 = Counter32: 0
    IF-MIB::ifOutDiscards.1 = Counter32: 0
    IF-MIB::ifInErrors.1 = Counter32: 0
    IF-MIB::ifOutErrors.1 = Counter32: 0
    SNMP OK - 0 0 0 0 0 0 | IF-MIB::ifInOctets.1=0c IF-MIB::ifOutOctets.1=0c IF-MIB::ifInDiscards.1=0c IF-MIB:
    :ifOutDiscards.1=0c IF-MIB::ifInErrors.1=0c IF-MIB::ifOutErrors.1=0c
    nagios@ip-10-30-2-10:~$
  • And this time we run the SNMP snmpget utility, outside the plugin wrapper. You should get the same result but without the formatting that the plugin would return. Other service checks use different plugins than check_snmp so the debug argument may be different, but the principle is the same.

    Don't forget to use the correct IP address for target machine.
    /usr/local/groundwork/common/bin/snmpget -t 1 -r 5 -m ALL -v 1 -c public 10.30.2.70
    IF-MIB::ifInOctets.1 IF-MIB::ifOutOctets.1 IF-MIB::ifInDiscards.1 IF-MIB::ifOutDiscards.1
    IF-MIB::ifInErrors.1 IF-MIB::ifOutErrors.1
    Code is shown above as multiple lines and is actually one line.
    nagios@ip-10-30-2-10:~$ /usr/local/groundwork/common/bin/snmpget -t 1 -r 5 -m ALL -v 1 -c public 10.30.2.70
    IF-MIB::ifInOctets.1 IF-MIB::ifOutOctets.1 IF-MIB::ifInDiscards.1 IF-MIB::ifOutDiscards.1
    IF-MIB::ifInErrors.1 IF-MIB::ifOutErrors.1
    IF-MIB::ifInOctets.1 = Counter32: 0
    IF-MIB::ifOutOctets.1 = Counter32: 0
    IF-MIB::ifInDiscards.1 = Counter32: 0
    IF-MIB::ifOutDiscards.1 = Counter32: 0
    IF-MIB::ifInErrors.1 = Counter32: 0
    IF-MIB::ifOutErrors.1 = Counter32: 0
    nagios@ip-10-30-2-10:~$
Commit new configuration and view status and events
  • You can then put the new configuration into play. In the portal select Configuration > Control > Pre flight test > Commit and watch for the status to show that it was successful. After a little while check in the Status view where you will see the services and the host state begin to fill in.
  • Further down you can view the graphs as they start to populate. The performance graphs are automatically built because the profile included a performance configuration table entry for each service check. You can see this by going to Configuration > Performance.
  • In the Event Console, you can select the NAGIOS application filter to view the polling events. You can see the polling server listed, and In time you will see the status change from PENDING.
    Make sure your target machine has the SNMP service installed, configured, and started.

Labels

snmp snmp Delete
polling polling Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.