有V1 V2c V3
V1使用明文community,The biggest downsides are that it does not support 64 bit counters, only 32 bit counters, and that it has little security.
V2c和V1使用明文community,it adds support for 64 bit counters. SNMPv2c is a sub-version of SNMPv2. Its key advantage over previous versions is the Inform command. Unlike Traps, which are simply received by a manager, Informs are positively acknowledged with a response message. If a manager does not reply to an Inform, the SNMP agent will resend the Inform.

常用的是Get, GetNext, Set, Trap
ro(read only)的community/username password不能使用set方法
rw(read write)可以使用全部方法

SNMP使用UDP(IP 17) 161
SNMP trap使用UDP 162 (部分系统组件/配置发生变更,SNMP daemon主动发送消息通知网管平台)

SNMP OID结构 [图片来源Paessler AG]

SNMP v1 defines a special TRAP message format, different from other messages (such as GET).
This message format is not used any more in SNMP v2 and v3. If an SNMP agent sends out such TRAP messages for v2 or v3, that can be a bug. Since v2, TRAP starts to use the common message format (the same as GET and so on). So it is called SNMPv2-Trap-PDU. SNMP v3 introduces the security model to all messages, so TRAP receives such update too. It is still based on SNMPv2-Trap-PDU.

Debian系 SNMP trap配置一些问题
启动snmp daemon,日志提示

  /etc/snmp/snmpd.conf: line 145: Warning: Unknown token: defaultMonitors.
  /etc/snmp/snmpd.conf: line 147: Warning: Unknown token: linkUpDownNotifications.
Edit /etc/default/snmpd:
comment the "export MIBS=" line:
#export MIBS=
remove ",mteTrigger,mteTriggerConf" from the SNMPDOPTS line:
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /run/'
install snmp-mibs-downloader. It will download abunch of MIBs in its postinst:
sudo apt install snmp-mibs-downloader


Network Interface Statistics
List NIC names: .
Get Bytes IN: .
Get Bytes IN for NIC 4: .
Get Bytes OUT: .
Get Bytes OUT for NIC 4: .

CPU Statistics
1 minute Load: .
5 minute Load: .
15 minute Load: .

CPU times
percentage of user CPU time: .
raw user cpu time: .
percentages of system CPU time: .
raw system cpu time: .
percentages of idle CPU time: .
raw idle cpu time: .
raw nice cpu time: .

Memory Statistics
Total Swap Size: .
Available Swap Space: .
Total RAM in machine: .
Total RAM used: .
Total RAM Free: .
Total RAM Shared: .
Total RAM Buffered: .
Total Cached Memory: .

Disk Statistics
Add the following line to snmpd.conf and restart:
includeAllDisks 10% for all partitions and disks
Disk OID's
Path where the disk is mounted: .
Path of the device for the partition: .
Total size of the disk/partion (kBytes): .
Available space on the disk: .
Used space on the disk: .
Percentage of space used on disk: .
Percentage of inodes used on disk: .

System Uptime: .


标签: none