1.基础环境配置
为了防止防火墙及selinux等的影响,需关闭防火墙及selinux等,具体参考:
2.安装snmp
yum源配置,具体参考:
snmp安装命令:
yum install -y net-snmp net-snmp-utils
[root@logstash ~]# yum install -y net-snmp net-snmp-utils
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
CentOS7 | 3.6 kB 00:00:00
nginx-stable | 2.9 kB 00:00:00
Package matching 1:net-snmp-5.7.2-49.el7.x86_64 already installed. Checking for update.
Package matching 1:net-snmp-utils-5.7.2-49.el7.x86_64 already installed. Checking for update.
Nothing to do
[root@logstash ~]#
3.监控端配置snmp v3 inform
1.编辑/etc/snmp/snmptrapd.conf文件,添加如下信息并保存
createUser watcher SHA "abcd1234" AES "abcd1234"
authuser log,execute,net watcher
[root@logstash snmp]# cat snmptrapd.conf
# Example configuration file for snmptrapd
#
# No traps are handled by default, you must edit this file!
#
# authCommunity log,execute,net public
# traphandle SNMPv2-MIB::coldStart /usr/bin/bin/my_great_script cold
createUser watcher SHA &#