登录  | 加入社区

黑狼游客您好!登录后享受更多精彩

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

查看: 564|回复: 0

zabbix-3.4.1_snmptrap设置指南

[复制链接]

180

主题

180

帖子

0

现金

黑狼菜鸟

Rank: 1

积分
0
发表于 2019-2-21 02:07:35 | 显示全部楼层 |阅读模式 来自 江苏徐州
一、体系情况:
操纵体系版本:CentOS Linux
release 7.3.1611 (Core)
内核版本:3.10.0-514.el7.x86_64
软件版本:zabbix-3.4.1
Zabbserver: 192.168.15.128
Agent:192.168.15.60


二、zabbix情况设置
请参考之前的《zabbix-3.4.1情况摆设.docx》


三、安装epel-release
epel是社区猛烈打造的免费开源发行软件包版本库。
EPEL,即Extra Packages for
Enterprise Linux的简称,是为企业级Linux提供的一组高质量的额外软件包,包罗但不限于Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL),
Oracle Enterprise Linux (OEL)。(关于 : EPEL)
方法一:yum下令安装 
保举
yum install epel-release -y
方法二:手动安装
针对体系架构选择相应的范例:http://dl.fedoraproject.org/pub/epel/7/。我们利用的x86_64,就要进入该目次下探求相应包,安装方法如下:
# rpm -vih http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm


大概:
# wget
http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
# rpm -vih epel-release-7-2.noarch.rpm


二、SNMPTrap、snmptt安装
# yum install -y net-snmp net-snmp-libs
net-snmp-utils net-snmp-perl

设置snmptrap服务
# cat /etc/snmp/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

traphandle default /usr/sbin/snmptt 

perl do"/usr/bin/zabbix_trap_receiver.pl"

authCommunity   log,execute,net zmz


阐明:snmptrapd.conf和zabbix_trap_receiver.pl详见文档地点目次

Traplog吸收文件/tmp/zabbix_traps.tmp,在zabbix_trap_receiver.pl有设置

设置完毕,重启snmptrapd

# systemctl restart snmptrapd.service

agent端测试:
# snmptrap -v 2c -c zmz 192.168.15.128:162 ''
1.3.6.1.4.1.2345 SNMPv2-MIB::sysLocation.0 s "This is zabbix traps
test"
server端检察:
xYEuvYyvoeUbBuyn.jpg



# cat /tmp/zabbix_traps.tmp

10:59:47 2019/01/17 ZBXTRAP 192.168.15.60

PDU INFO:

  notificationtype               TRAP

  version                        1

  receivedfrom                   UDP: [192.168.15.60]:39146->[192.168.15.128]:162

  errorstatus                    0

  messageid                      0

  community                      zmz

  transactionid                  4

  errorindex                     0

  requestid                      2062263877

VARBINDS:

  DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (24583501) 2 days, 20:17:15.01

  SNMPv2-MIB::snmpTrapOID.0      type=6  value=OID: SNMPv2-SMI::enterprises.2345

  SNMPv2-MIB::sysLocation.0      type=4  value=STRING: "This is zabbix traps test"[size=0em]  

点击下方标题阅读出色内容:
fc6QqccEGcMg06Ac.jpg R740xd_iDRAC9_snmptrap设置实例
gLYWFrzux2umX2Mf.jpg idrac 7-8 用户及ipmitool设置权限
T3g3PGwFEzDPSV65.jpg MD3200直连MD1200重组Raid 步调详解


———— / END / ————



YoJfnOqoSFCtcdbC.jpg




上一篇:基因学苑2018年文章目次
下一篇:对不起,我不会Git
您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

 

QQ|申请友链|小黑屋|手机版|Hlshell Inc. ( 豫ICP备16002110号-5 )

GMT+8, 2024-5-2 23:16 , Processed in 0.076679 second(s), 47 queries .

HLShell有权修改版权声明内容,如有任何爭議,HLShell將保留最終決定權!

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表