环境:centos 6.5、httpd 2.4、zabbix 2.4
1、修改apache配置文件
1
2
3
4
5
6
7
8
|
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
1
2
3
4
5
6
7
|
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
1
2
|
vim
/usr/local/zabbix/etc/zabbix_agentd
.conf.d
/userparameter_zapache
.conf
UserParameter=zapache[*],
/usr/local/zabbix/scripts/zapache
\$1
|
4、修改zabbix_agentd.conf
1
2
3
4
5
6
7
8
|
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服务
1
|
service zabbix_agentd restart
|
6、在zabbix server上验证
1
|
zabbix_get -s 192.168.100.162 -k zapache[
ping
]
|
7、通过浏览器导入模板Template App Apache Web Server zapache
参考博文:http://jaychang.iteye.com/blog/2215945
本文转自1321385590 51CTO博客,原文链接http://blog.51cto.com/linux10000/1728194:,如需转载请自行联系原作者