自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Zabbix中snmp-traps的設(shè)置

運(yùn)維 系統(tǒng)運(yùn)維
Zabbix中snmp-traps設(shè)置:Zabbix能監(jiān)視各種網(wǎng)絡(luò)參數(shù),保證服務(wù)器系統(tǒng)的安全運(yùn)營(yíng);而且提供柔軟的通知機(jī)制以讓系統(tǒng)管理員快速定位/解決存在的各種問(wèn)題。Zabbix由2部分構(gòu)成,zabbix server與可選組件zabbix agent。本文講述的是Zabbix中snmp-traps設(shè)置。

  zabbixsnmp-traps設(shè)置

  工作方式

  1.   (SNMP Trap) -> snmptrapd -> snmptrap.sh -> zabbix_sender -> (Zabbix)  
  2.  

  在/etc/snmp/snmptrapd.conf文件添加

  1.   traphandle default /bin/bash /path/to/zabbix/bin/snmptrap.sh  
  2.  

  啟動(dòng)snmptrapd服務(wù):

  1.   snmptrapd -C -c /etc/snmp/snmptrapd.conf -Lf /var/log/net-snmptrap.log  
  2.  

  修改/path/to/zabbix/bin/snmptrap.sh. 如果不正確的話,堅(jiān)持zabbix 樹(shù),復(fù)制到zabbix/bin下.:

  1.   ZABBIX_SERVER="zabbix-host"; # hostname of zabbix server  
  2.  
  3.   ZABBIX_PORT="nnnn"; # nnnn=same as 'Listen Port' in zabbix_server.conf  
  4.  
  5.   ZABBIX_SENDER="/path/to/zabbix/bin/zabbix_sender"; # insert you path  
  6.  
  1.   #According to the snmpdtrapd.conf man page, these  
  2.  
  3.   # fields should be received in the following order:  
  4.  
  1.   # there may be several more payload fields, but one is all I need.  
  2.  
  3.   # read more if it suits you.  
  4.  
  5.   hostname=`echo $hostname|cut -f1 -d'.'` # trim off the fluff  
  6.  
  7.   trapoid=`echo $trapoid|cut -f3 -d' '` # ditto  
  8.  
  9.   # I don't need uptime or ip right now ...  
  10.  
  11.   payload=`echo $payload1|cut -f3- -d' '` # ditto ditto  
  12.  
  13.   ### This section records all traps under a 'dummy' host in zabbix, for debugging  
  14.  
  15.   ### Delete if you don't need to do this.  
  16.  
  17.   ### I use it to verify the OID of traps before using them as keys on specific hosts  
  18.  
  19.   # create a string to send to zabbix.  
  20.  
  21.   str="HOST=$hostname TRAP OID=$trapoid PAYLOAD=$payload" 
  22.  
  23.   # now set the key and host name for zabbix  
  24.  
  25.   KEY="alltraps";  
  26.  
  27.   HOST="trapperjohn";  
  28.  
  29.   #now call the zabbix_sender program with all parameters.  
  30.  
  31.   $ZABBIX_SENDER $ZABBIX_SERVER $ZABBIX_PORT $HOST $KEY "$str"  
  32.  
  33.   ### End dummy host section  
  34.  
  35.   ### This section records traps for specific for specific hosts.  
  36.  
  37.   ### Edit as needed for you situation.  
  38.  
  39.   KEY="$trapoid";  
  40.  
  41.   HOST="$hostname";  
  42.  
  43.   str="$payload";  
  44.  
  45.   $ZABBIX_SENDER $ZABBIX_SERVER $ZABBIX_PORT $HOST $KEY "$str"  
  46.  

  調(diào)試可:

  1.   echo $ZABBIX_SENDER $ZABBIX_SERVER $ZABBIX_PORT $HOST:$KEY "$str" > /tmp/testtrap.txt  
  2.  

  測(cè)試:

  1.   snmptrap -v1 -cpublic localhost .1.3.6.1.6.3.1.1.5.2 0 0 "" "" .1.3.6.1.4.1 s "aaa"  
  2.  

  在zabbix服務(wù)器端:

  1. Added host:

  1.   name=snmpTraps 
  2.  
  3.   ip address = (didn't enter an ip address)  
  4.  
  5.   port = 10005 (port which zabbix server is on) - do i need to set this to 162?  
  6.  
  7.   Set status to monitored....didn't add anything else eg IP address, group etc  
  8.  

  2. Added item to host (i.e to snmpTraps)

  1.   key=snmpTraps 
  2.  
  3.   type=zabbix trapper  
  4.  
  5.   type of info=numeric 
  6.  
  7.   store value=As is  
  8.  
  9.   Allowed host= (i have left this line blank)  
  10.  

  Zabbix中snmp-traps的設(shè)置完成。

【編輯推薦】

Zabbix批量添加主機(jī)

Zabbix下數(shù)據(jù)庫(kù)升級(jí)

Zabbix代理安裝介紹

責(zé)任編輯:zhaolei 來(lái)源: itpub
相關(guān)推薦

2011-04-01 15:14:01

zabbixsnmp trap

2010-07-01 14:05:43

SNMPMIB

2010-07-09 12:11:31

SNMP服務(wù)

2010-07-01 12:30:42

SNMP trap

2011-04-02 15:30:20

Cacti安裝

2011-03-29 16:07:32

CACTISNMP

2010-07-13 14:44:11

SNMP服務(wù)設(shè)置

2010-06-29 13:58:17

SNMPMIB

2011-03-31 11:12:37

CACTINet-SNMP

2010-01-08 14:29:58

華為交換機(jī)snmp

2012-04-09 11:23:20

ibmdw

2011-03-31 11:29:24

CACTISNMP服務(wù)

2010-07-09 12:08:36

設(shè)置SNMP協(xié)議

2011-04-01 16:24:39

zabbix報(bào)警

2010-06-30 10:39:45

Linux SNMP

2010-06-30 17:07:41

SNMP Trap

2010-07-01 14:53:09

SNMPMIBUCD-SNMP

2010-05-24 18:19:44

SNMP報(bào)文

2010-07-05 10:16:31

ucd-snmpSNMP Agent

2011-03-29 15:30:20

ZABBIXWEB
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)