Table of Contents:
Using AppFirst to collect data via SNMP
You may have a device that can be managed using SNMP, but cannot support an AppFist collector, such as a router or a switch. You can still obtain data from such a device and store and display that data using AppFirst’s big data store and visualization tools.
A Linux server that has an AppFirst collector installed will act as a proxy for the device.
The standard Linux SNMP tools need to be installed on that server. If they are installed, a command like this should execute, but with errors:
If the SNMP tools are not installed, a command like this should suffice:
sudo yum install net-snmp net-snmp-utils
Make sure the snmpget command now executes.
The managed device probably has custom metrics described in an MIB file that can be obtained from the manufacturer. This file needs to be installed on the server. As a first step, find out where your installation of snmp is looking for mibs. This command will tell you what directories snmp will search:
snmpget -Dparse-mibs 2>&1 | grep directory
Copy the MIB file to that directory:
cp SKYERA-MIB.txt /usr/share/snmp/mibs
To add the MIB to your snmp config, edit the file /etc/snmp/snmp.conf (which might not exist), and add this line:
*Note: It’s NOT snmpd.conf, and don’t include .txt at the end.
SNMP requires a command line option called a community string, which is similar to a password. When no security is enabled, the community string ‘public’ is used. Try to contact your device with this command:
snmpget -v 1 -c public 192.168.101.139 sysLocation.0
Substitute the correct IP address of the device, of course. There are many reasons this could fail:
- If the community string is incorrect, the device will not respond at all, and the request will time out.
- Make sure there are no firewalls between the server and the device. Port number to enable is UDP 161.
- Make sure SNMP is enabled on the device.
- If the variable name sysLocation causes an error such as (noSuchName), then the standard MIBs are not installed. Try the using numeric equivalent:
snmpget -v 1 -c public 192.168.101.139 .18.104.22.168.22.214.171.124.0
All of these issues are standard Linux issues, having nothing to do with AppFirst.
Once it has been established that data from the managed device can be obtained using the SNMP tools on the server, we can now proceed to send that data through the collector to your AppFirst account. This is done using Polled data. All that is required is a Nagios utility called check_snmp. This is distributed with the AppFirst collector, and should already be installed in the usual location:
Find the server in your AppFirst account by choosing Administration | Collectors, and locate your server. Click on the green pencil icon to edit the config file for this collector. Choose the Polled Data Config tab. Insert a line that uses the check_snmp plugin, which might resemble this (but all on one line):
command[skyera_system_status]=/usr/share/appfirst/plugins/libexec/check_snmp 192.168.101.139 -C public -o skyeraSystemStatus
Note the capital ‘C’ for the community string parameter, and the lowercase ‘o’ for the variable name. Note also that since the server is acting as a proxy for the managed device, the name of that device should be reflected in the command name. Repeat this command for each metric to be monitored. Save the file, and it will be downloaded to the collector. Polled data runs on 5 minute intervals by default (change this in collector config, ‘Nagios Frequency’).
After the polled data commands have had time to execute, the SNMP data should be available in your visualization tools. For example, under Workbench | Servers, select the server, and look for the data in the Polled Data status panel. The data is also available in Correlate, the Dashboard, or Workbench | Polled Data.