The predecessor of SNMP (Simple network Management Protocol), the simplest web management protocol, is the simple Gateway Monitoring Protocol (SGMP), which is used to manage communication lines. In Rhel, the configuration file address for SNMP is/etc/snmp/snmpd.conf.
snmpd.conf a lot of configuration items, but the real common use of just a few, below to introduce each.
The Com2sec command, whose basic syntax is "com2sec NAME SOURCE COMMUNITY". Here to mention the SNMP security policy, in fact, the security of SNMP is not good, in this protocol use community this thing to do access control. Simple to understand is that now there is a gang of a person to find the total rudder, then how this person with the general rudder Joseph? They directly agreed to a "code", such as the meeting said "The moon light before the bed", then the main rudder will take you to the front desk to "Moonlight Light" to the corresponding place. Now look back at this line of configuration, if you have the following sentence
Com2sec Magusu Default Magus
Meaning is to do a mapping, the Magus this community string and Magusu this name to do a pair of mappings, then later in the call SNMP, as long as you declare that you are Magus, then you can get the corresponding permissions. The next thing to do when you have a map is to create a mapping from Magusu to a group, with the command group, whose basic syntax is "group NAME MODEL SECURITY"
Group MAGUSG v2c Magusu
Above the meaning of this sentence is to put Magusu into the group MAGUSG inside, with the protocol is V2C, plug a sentence, SNMP now commonly used has 3 versions. Well, what are you going to do with the formation? The basic syntax for creating a View,view is "view NAME TYPE subtree [MASK]"
View MAGUSV included. 1.3.6.1.4.1.9129
access magusg "" any noauth exact MAGUSV magusv None
As the example is used in the V2C version of the protocol, so the context must be empty, model is the version number of the protocol, in this case can be any also can be v2c, or because of v2c, so level is Noauth;read, Write and notify each need to specify a view or nothing, and the setting here is MAGUSV this view can read and write to the previously set node.
To this end, the server configuration has been completed, restart the snmpd on it, below to see how to get the data we want through SNMP
Snmpwalk-v 2c-c magus localhost 1.3.6.1.4.1.9129.1.2.2
Snmpwalk can facilitate all child nodes under the specified node, and the-v parameter specifies the protocol version of SNMP, which is the same as the version of the server we configured earlier, that is, 2c, then the-c parameter specifies the community string, which is the Magus just defined, Then is the host address, because I test in this machine, so with the localhost, the actual can be filled with IP, the last is the value of OID. Get!
For just contact with SNMP, understand the role of community is the key, in fact, the popular point is the connector code, but also a clear "code."
This article is from the "Art_hero" blog, make sure to keep this source http://curran.blog.51cto.com/2788306/1627228
snmpd.conf configuration under Linux