使用zabbix 2.4监控httpd

环境:centos 6.5、httpd 2.4、zabbix 2.4

1、修改apache配置文件

vim /etc/httpd/httpd.conf
ExtendedStatus On 
<location /server-status>
   SetHandler server-status
   Order allow,deny
   Allow from localhost
   Allow from 192.168.100.1
</location>

2、下载解压zapache-master.zip 

wget https://github.com/lorf/zapache/archive/master.zip
unzip zapache-master.zip 
cd zapache-master
mkdir /usr/local/zabbix/scripts
cp zapache /usr/local/zabbix/scripts/
chmod +x /usr/local/zabbix/scripts/zapache 
cp userparameter_zapache.conf.sample /usr/local/zabbix/etc/zabbix_agentd.conf.d/userparameter_zapache.conf

3、修改userparameter_zapache.conf

vim /usr/local/zabbix/etc/zabbix_agentd.conf.d/userparameter_zapache.conf
UserParameter=zapache[*],/usr/local/zabbix/scripts/zapache \$1

4、修改zabbix_agentd.conf

vim /usr/local/zabbix/etc/
LogFile=/tmp/zabbix_agentd.log
Server=192.168.100.161
ServerActive=192.168.100.161
Hostname=Zabbix server
Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
EnableRemoteCommands=1
UnsafeUserParameters=1

5、重启zabbix_agentd服务

service zabbix_agentd restart

6、在zabbix server上验证

zabbix_get -s 192.168.100.162 -k zapache[ping]

7、通过浏览器导入模板Template App Apache Web Server zapache

参考博文:http://jaychang.iteye.com/blog/2215945


你可能感兴趣的:(localhost,配置文件,监控)