Submit a ticketCall us

Don’t fall victim to a ransomware attack
Backups are helpful, but sometimes that’s not enough to protect your business against ransomware. At our live webcast we will discuss how to protect against ransomware attacks with SolarWinds® Patch Manager and how to leverage log data to detect ransomware. Register now for our live webcast.

Home > Success Center > Network Performance Monitor (NPM) > How to set SNMP for Linux

How to set SNMP for Linux

Table of contents
Created by Alexander Aguilar, last modified by Con Finucane on Jul 11, 2017

Views: 85 Votes: 3 Revisions: 13

Overview

This article describes how to configure SNMP on Linux/UNIX type systems. 

 

the most common SNMP configuration on Linux/UNIX is by using the net-snmp package maintained 
by http://www.net-snmp.org/  (aka "the nice BSD foks")

 

installing and configuring net-snmp vary slightly depending on 
the specific Linux/UNIX distribution you are working with. 

 

keep in mind that as your OS changes over time so does the documentation. if something stops working its always worth to see if there has been changes in the documentation as well as important changes are usually updated  before new packages are release.  

Environment

 

All supported versions of SolarWinds Orion Core / Platform, NPM and SAM, more details here:

https://support.solarwinds.com/Succe...tware_Versions 

Steps

 

1. first you need to identify what UNIX/LINUX system you are using. To check what unix/linux version you have you can run any of the bellow commands

 

# cat /etc/*-release

 

# uname -a

 

# cat /proc/version

once distribution and version is established you need to check the distribution specific documentation.

bellow is a table of 8 common UNIX and Linux distributions and links to its documentation. 

 

Distribution Name  Documentation URL
   
centOS 7  See RedHat 7 documentation
centOS 6 See RedHat 6 Documentation
centOS 5 and older  https://www.centos.org/docs/
   
RedHat (all versions) https://access.redhat.com/documentat...erprise-linux/ 
   
ubuntu (all versions)  https://help.ubuntu.com/ 
   
SUSE (all versions) https://www.suse.com/documentation/ 
   
ESXi 6   https://pubs.vmware.com/vsphere-60/index.jsp 
ESXi 5.5  https://pubs.vmware.com/vsphere-55/index.jsp  
ESXI 5 https://pubs.vmware.com/vsphere-50/index.jsp
   
AIX 7.2 https://www.ibm.com/support/knowledg...welcome_72.htm
AIX 7.1 https://www.ibm.com/support/knowledg...welcome_71.htm 
IBM CMM Modules  http://flexsystem.lenovofiles.com/he...duct_page.html
   
HP-UX 11i  https://h20565.www2.hpe.com/portal/s...4ts.oid=417289   
   
Arch Linux https://wiki.archlinux.org/index.php/snmpd
   

 

if you want to see a SNMPv3 configuration example on CentOS 7 click here 

 

 More Resources

https://www.youtube.com/watch?v=RAQNEIEKpVY

http://www.net-snmp.org/wiki/index.php/Tutorials 

 

 

 

Simple Configuration Example 

 

the main configuration file for net-snmp is /etc/snmp/snmpd.conf

 

some distributions or administrators themselves might choose a different location

for this file but the content and syntax is the same. 

 

here is a working SNMPv2 example from one of our labs. 

 

# Map 'idv90we3rnov90wer' community to the 'ConfigUser'
# Map '209ijvfwer0df92jd' community to the 'AllUser'
#       sec.name        source          community
com2sec ConfigUser      default         idv90we3rnov90wer
com2sec AllUser         default         209ijvfwer0df92jd
# Map 'ConfigUser' to 'ConfigGroup' for SNMP Version 2c
# Map 'AllUser' to 'AllGroup' for SNMP Version 2c
#                       sec.model       sec.name
group   ConfigGroup     v2c             ConfigUser
group   AllGroup        v2c             AllUser
# Define 'SystemView', which includes everything under .1.3.6.1.2.1.1 (or .1.3.6.1.2.1.25.1)
# Define 'AllView', which includes everything under .1
#                       incl/excl       subtree
view    SystemView      included        .1.3.6.1.2.1.1
view    SystemView      included        .1.3.6.1.2.1.25.1.1
view    AllView         included        .1
# Give 'ConfigGroup' read access to objects in the view 'SystemView'
# Give 'AllGroup' read access to objects in the view 'AllView'
#                       context model   level   prefix  read            write   notify
access  ConfigGroup     ""      any     noauth  exact   SystemView      none    none
access  AllGroup        ""      any     noauth  exact   AllView         none    none

The above text is noted with basic information on the function of each configuration line. In short, we’re creating two scenarios for polling information from SNMP version 2c.

 

In the first scenario: ConfigUser is assigned to ConfigGroup and may only use SNMP security model 2cConfigGroup can use the SystemViewSystemView is assigned to two OID sub-trees, and all of this is referenced in an SNMP poll by the secret, and unique community string idv90we3rnov90wer.

In the second scenario: AllUser is assigned to AllGroup and may only use SNMP security model 2cAllGroup can use the AllViewAllView is assigned to the entire OID tree, and all of this is referenced in an SNMP poll by the secret, and unique community string 209ijvfwer0df92jd.

 

( for further information about allowed syntax in this file please see officilal documentation from net-snmp maintainers 

http://www.net-snmp.org/docs/readmefiles.html )

 

any changes of this file require a restart of the snmpd service 

# service snmpd restart

to ensure net-snmp service is running across restarts 

 

#' chkconfig snmpd on

 

 

 

Disclaimer: Please note, any content posted herein is provided as a suggestion or recommendation to you for your internal use. This is not part of the SolarWinds software or documentation that you purchased from SolarWinds, and the information set forth herein may come from third parties. Your organization should internally review and assess to what extent, if any, such custom scripts or recommendations will be incorporated into your environment.  You elect to use third party content at your own risk, and you will be solely responsible for the incorporation of the same, if any.

 

Last modified
03:02, 11 Jul 2017

Tags

Classifications

Internal Use Only