Zabbix agentd和 Zabbix Server 開(kāi)機(jī)自動(dòng)運(yùn)行實(shí)現(xiàn)方法
Zabbix支持ping,snmp等很多的監(jiān)控,但是大部分的監(jiān)控任務(wù)需要客戶端agentd的支持才能用。如何讓 Zabbix agentd 和 Zabbix Server 開(kāi)機(jī)自動(dòng)運(yùn)行,免得每次都要手動(dòng)運(yùn)行,步驟如下:
1. 復(fù)制 zabbix 源程序 misc/init.d/redhat 下的啟動(dòng)腳本到 /etc/init.d 目錄下
cp /zabbix/zabbix-1.6.6/misc/init.d/redhat/zabbix_server_ctl /etc/init.d/zabbix_server
cp /zabbix/zabbix-1.6.6/misc/init.d/redhat/zabbix_agentd_ctl /etc/init.d/zabbix_agentd
2. 修改啟動(dòng)腳本使其支持 redhat 的 chkconfig,分別在兩個(gè)腳本的 #!/bin/sh 后加入如下兩行注釋,注意要行前要加“#” 哦
# chkconfig: - 95 95
# description: Zabbix Server
3. Zabbix agentd修改啟動(dòng)腳本中 BASEDIR 和 ZABBIX_SUCKERD ,制定到 zabbix_server 和 zabbix_agentd 的安裝位置,如:
BASEDIR=/usr/local/sbin
ZABBIX_SUCKERD=$BASEDIR/zabbix_server
4. Zabbix agentd使用 chkconfig 將其加入 init 的啟動(dòng)服務(wù)
chkconfig --add zabbix_server
chkconfig --add zabbix_agentd
chkconfig --level 345 zabbix_server on
chkconfig --level 345 zabbix_agentd on
5. 使用 chkconfig --list 檢查一下
chkconfig --list | grep zabbix
輸出如下:
zabbix_agentd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
zabbix_server 0:off 1:off 2:off 3:on 4:on 5:on 6:off
【編輯推薦】