You can use Linux's graphical tools to easily monitor your system's network performance. In this article, you will learn how to use the MRTG (SNMP-based, monitoring http://www.aliyun.com/zixun/aggregation/10374.html "" Network traffic tools) and Webalizer (the tool that analyzes the site hit Ratio).
Many servers, routers, and firewalls keep track of their operational statistics in their object markers (OIDs), and you can retrieve them carefully by using Simple Network Management Protocol (SNMP). For ease of use, device manufacturers provide a management information base file MIB for their devices that defines the capabilities of the device object identifier OID. There are many new terms that need to be understood in these two sentences, so let's take a moment to figure them out.
OIDs and MIBs
OIDs is determined by the structured management information tree defined by the SNMP standard. The tree begins with the root node root, which is inherited through branches and leaves, and each child node adds their own reference value to a path distinguished by a separate time. The OID structure is shown in the figure, the path of the Enterprise OID Branch is first passed through org,dod,internet, and private branches, so the corresponding OID path is 1.3.6.1.4.1.
SNMP OID Structure
The Management Information Base (MIBS) is the text that defines each OID branch. The table shows the corresponding relationship between the commonly used OIDs and their MIBs. For example, the Org MIB defines all the highest levels of OIDs required by the DOD layer. The DoD downlevel Internet MIB defines the highest level OIDs in directory, MGMT, experimental, and private branches. This MIB information is useful for SNMP management programs, and you can click an OID to see its value, type, and description.
OIDs and corresponding MIBs
OID MIB 1.3 org 1.3.6 dod 1.3.6.1 internet 1.3.6.1.1 directory 1.3.6.1.2 Mgmt 1.3.6.1.3 Experimental Private 1.3.6.1.4.1 Enterprises
You can better identify the OID by replacing the number in the OID branch with a more readable MIB alias. For example, you can use the OID 1.3.6.1.4.1.9.9.109.1.1.1.1.5 as enterprises.9.9.109.1.1.1.1.5. That is, you can replace the OID number (1.3.6.1.4.1) with the name of the enterprises branch.
Remember, only the bottom of the branch, the OID value of the leaf, is actually readable. Treat OIDs as a directory structure on your hard disk. Each branch is equivalent to a subdirectory, and the bottom (leaf) is like a file.
The Snmpget command in Linux outputs the value of a single leaf, and the snmpwalk command outputs the values of all the leaves below the branch. Discuss these commands later; now all you need to know is that the output of the command usually does not list the entire OID, only the MIB file it belongs to and the alias in that file, for example:
snmpv2-mib::sysuptime.0
Here the OID value belongs to the Snmpv2-mib file, using the 0-bit in the Sysuptime alias
Device vendors typically assign their own OID branches under the enterprises MIB, and they must also provide information that is represented globally OIDs for ease of management. For example, NIC interface data throughput should be placed in a predefined location on the common tree, but the memory usage value on a custom processor card is defined in a MIB that is under the vendor's own OID branch.
As a security measure, you need to know the SNMP password, the community string, to query the OID. There are multiple community strings, and the most common is a read-only string to provide access to statistics and system parameters. In most cases, set to public; To avoid being guessed you should modify it. Read-write community strings are used not only to view statistical data and system parameters, but also to modify system parameters.