[Zabbix] Apache 监控
来源:互联网 发布:dive into python 3 编辑:程序博客网 时间:2024/05/22 03:14
一、配置 apache
# yum -y install httpd
# vi/etc/httpd/conf/httpd.conf #红色字体为修改/添加部分
ServerRoot "/etc/httpd"
Listen 8081
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "/var/www/html"
<Directory "/var/www">
AllowOverride None
Require all granted
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
<Files ".ht*">
Require all denied
</Files>
ErrorLog "logs/error_log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access_log" combined
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<IfModule mime_module>
TypesConfig /etc/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</IfModule>
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
<location /server-status>
SetHandler server-status
Order allow,deny
Allow from localhost
Allow from 192.168.1.
</location>
IncludeOptional conf.d/*.conf
# systemctl enable httpd && systemctl restart httpd #重启apache并测试配置生效
#浏览器输入http://192.168.1.208:8081/server-status?auto 测试
二、下载 zapache
#wget https://github.com/lorf/zapache/archive/master.zip
# unzip master.zip
#ll zapache-master/
总用量 124
-rw-r--r-- 1 root root 676 4月 22 2016 httpd-server-status.conf.sample # http status 配置模板文件
-rw-r--r-- 1 root root 1780 4月 22 2016 README.md
-rw-r--r-- 1 root root 224 4月 22 2016 userparameter_zapache.conf.sample # zabbix 配置模板文件
-rwxr-xr-x 1 root root 6110 4月 22 2016 zapache #监控脚本
-rw-r--r-- 1 root root 52258 4月 22 2016 zapache-template-active.xml # zabbix 模板
-rw-r--r-- 1 root root 52024 4月 22 2016 zapache-template.xml
#cp -a /usr/local/src/tarbag/zapache/zapache-master/zapache/etc/zabbix/shell/zapache.sh
#chown zabbix/etc/zabbix/shell/zapache.sh
#chmod +x/etc/zabbix/shell/zapache.sh
#vi/etc/zabbix/shell/zapache.sh
STATUS_URL="http://localhost:8081/server-status?auto"
#cp -a/usr/local/src/tarbag/zapache/zapache-master/userparameter_zapache.conf.sample/etc/zabbix/zabbix_agentd.d/userparameter_zapache.conf
#vi/etc/zabbix/zabbix_agentd.d/userparameter_zapache.conf
UserParameter=zapache[*],/etc/zabbix/shell/zapache.sh \$1
# agent端配置
#vi/etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=192.168.1.208
Hostname=192.168.1.208
Include=/etc/zabbix/zabbix_agentd.d/*.conf
UnsafeUserParameters=1
#systemctl restart zabbix-agent
三、WEB端配置
#上传 zabbix模板
监测中-最新数据
- zabbix监控Apache状态
- [Zabbix] Apache 监控
- zabbix监控mysql和apache
- Zabbix监控apache与MySQL
- Zabbix监控
- Zabbix监控
- zabbix监控
- 监控-zabbix
- 监控,zabbix
- zabbix 监控
- Zabbix分布式监控(3)添加模版(Apache mysql)
- Zabbix监控:监控端口
- Zabbix添加监控主机 Zabbix
- [zabbix]zabbix使用脚本监控
- zabbix 分布式监控系统
- zabbix监控参数
- zabbix监控服务安装
- 利用Zabbix监控Nginx
- c语言使用librdkafka库实现kafka的生产和消费实例
- github提示:fatal:remote origin already exists
- 问题&提示&小tips
- 官方开发者工具导入demo教程:真机预览教程
- Silver Cow Party
- [Zabbix] Apache 监控
- c语言main函数的参数
- Shell 命令行,实现一个获取任意位数的随机密码的脚本
- mint java 提示 错误: 找不到或无法加载主类
- extjs利用cookie设置全局变量
- 在Golang中实现有无限容量的同步Queue
- 一种解决不同页面不同侧边栏的方法
- 算术运算符与算术表达式——如何买玫瑰?
- 【美团】直方图内最大矩形