- 安装好apache
- 确保监控模块开启
/etc/httpd/conf.modules.d/00-base.conf 查看这个文件,确保监控模块开启
LoadModule status_module modules/mod_status.so 没有被注释
- 一旦启用了mod_status ,接下来需要为Apache服务器状态页面创建一个server-status.conf配置文件
# vim /etc/httpd/conf.d/server-status.conf
<Location "/server-status">
SetHandler server-status
#Require host localhost #uncomment to only allow requests from localhost
</Location>
- 通过使用命令行Web浏览器 (如lynx)验证Apache服务器状态和统计信息页是否正常工作,如图所示。
yum install lynx
lynx http://localhost/server-status
5.创建netdata读取apache属性的配置文件
vi /etc/netdata/python.d/apache.conf
#
# if the URL is password protected, the following are supported:
#
# user:'username'
# pass:'password'
# -------------------------------------------------------------------
# AUTO-DETECTION JOBS
# only one of them will run (they have the same name)
localhost:
name : 'local'
url : 'http://localhost/server-status?auto'
localipv4:
name : 'local'
url : 'http://127.0.0.1/server-status?auto'
localipv6:
name : 'local'
url : 'http://::1/server-status?auto'