zabbix3.4安装apache监控

本文共有3118个字。 # zabbix/ a

基于Centos 7.2 lnmp lamp环境

1、开启apache Server Status状态

vim /usr/local/apache/conf/extra/httpd-info.conf

ExtendedStatus On
<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Allow from localhost
    #Require host .example.com
    #Require ip 127
</Location>

vim /usr/local/apache/conf/httpd.conf
#Include conf/extra/httpd-info.conf
#将前面的#号去掉

重启apache,访问http://IP/server-status,正常会反馈状态信息

Apache Server Status for IP (via IP)
Server Version: Apache/2.4.33 (Unix) OpenSSL/1.0.2o PHP/7.2.6
Server MPM: event
Server Built: Jul 7 2018 20:13:34
Current Time: Thursday, 09-Aug-2018 15:15:43 CST
Restart Time: Thursday, 09-Aug-2018 15:15:40 CST
Parent Server Config. Generation: 1
Parent Server MPM Generation: 0
Server uptime: 2 seconds
Server load: 0.00 0.00 0.00
Total accesses: 0 - Total Traffic: 0 kB
CPU Usage: u0 s0 cu0 cs0
0 requests/sec - 0 B/second -
1 requests currently being processed, 74 idle workers
Slot    PID Stopping    Connections Threads Async connections
total   accepting   busy    idle    writing keep-alive  closing
0   29545   no  0   yes 1   24  0   0   0
1   29546   no  0   yes 0   25  0   0   0
2   29554   no  0   yes 0   25  0   0   0
Sum 3   0   0       1   74  0   0   0
____W___________________________________________________________
___________.....................................................
................................................................
................................................................
................................................................
................................................................
................
Scoreboard Key:
"_" Waiting for Connection, "S" Starting up, "R" Reading Request,
"W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
"C" Closing connection, "L" Logging, "G" Gracefully finishing,
"I" Idle cleanup of worker, "." Open slot with no current process
Srv PID Acc M   CPU SS  Req Conn    Child   Slot    Client  Protocol    VHost   Request
0-0 29545   0/0/0   W   0.00    0   0   0.0 0.00    0.00    14.127.249.62   http/1.1    _:80    GET /server-status HTTP/1.1

2、下载配置文件

git clone https://github.com/rookiesky/zabbix-config.git

3、安装配置文件

cd zabbix-config/apache
cp userparameter_zapache.conf /etc/zabbix/zabbix_agentd.d
cat userparameter_zapache.conf
#
# This is a sample zabbix_agentd config file.
# Put it to /etc/zabbix_agentd.conf.d or otherwise integrate into agent config.
# Edit to your needs.
#
UserParameter=zapache[*],/var/lib/zabbix/zapache \$1
注意UserParameter= 后面的路径
mkdir -p /var/lib/zabbix
cd zabbix-config/apache
cp zapache /var/lib/zabbix
chmod +x zapache
#给予可执行权限

3、导入模板

下载https://github.com/rookiesky/zabbix-config.git 上传apache/zapache-template.xml

版权声明:本文为作者原创,如需转载须联系作者本人同意,未经作者本人同意不得擅自转载。本站微信公众号:7TEC,敬请关注!

暂时无法评论哦~

暂无评论