View Source

WAS THIS PAGE HELPFUL? {html}<a href="mailto:training@gwos.com?subject=How to set up monitoring with SNMP Polling">Leave Feedback</a>{html}\\
\\

h5. Overview

{section}{column:width=68%}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.{column}
{column:width=32%}{column}{section}

h5. Steps

h6. 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.

h6. 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_.

h6. 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.

h6. 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.
{note}The display below has breaks in the command due to screen space.{note}
{noformat}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:~${noformat}
* Now, add an argument to the command to turn up some debugging by adding {{\-v}} at the end and run it again.
{note}The display below has breaks in the command due to screen space.{note}
* You should see more details broken out.
{noformat}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:~${noformat}
* 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.
\\
\\ {note}Don't forget to use the correct IP address for target machine.{note}
{noformat}/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{noformat}
{note}Code is shown above as multiple lines and is actually one line.{note}
{noformat}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:~${noformat}

h6. 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_.
{note}Make sure your target machine has the SNMP service installed, configured, and started.{note}