安装snmptraped 和 snmptt

yum install net-snmp

编辑/etc/snmp/snmptrapd.conf,添加SNMPTT作为trap处理程序:

添加“traphandle default snmptt”

完成配置后,添加启动服务

image.png



yum install snmptt

Can't locate Sys/Syslog.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/bin/collectl line 169.

缺 Sys/Syslog.pm的主文件

yum -y install perl-Sys-Syslog

 

编辑vim /etc/snmp/snmptt.ini,配置输出文件和时间格式

vim /etc/snmp/snmptt.ini
log_file = /var/log/snmptt/snmptt.log    #指定日志文件
date_time_format = %H:%M:%S %Y/%m/%d  #制定时间格式
 

image.png

 

image.png

yum install net-snmp-perl ? 不知道应不应该安装

配置数据处理格式

编辑snmptt.conf - 定义默认trap格式

vim /etc/snmp/snmptt.conf
EVENT general .* "General event" Normal
FORMAT ZBXTRAP $aA $ar
 

image.png

同样默认设置好

image.png

启动服务

posted @ 2018-11-02 11:02  liulj0713  阅读(3161)  评论(0编辑  收藏  举报