zabbix5.4 nginx监测模板

2021-11-03

通过zabbix提供的Nginx by Zabbix agent可以轻松监测nginx进程和一些参数。

1、nginx -V
需要用到--with-http_stub_status_module
2、修改conf,添加
location /basic_status {
stub_status on;
}
3、重启nginx -s reload
4、测试curl 127.0.0.1/basic_status
5、修改Nginx by Zabbix agent模板,宏$NGINX.STUB_STATUS.HOST由localhost改为127.0.0.1
6、安装zabbix-get-5.4.7-1.el8.x86_64.rpm
yum -y install https://repo.zabbix.com/zabbix/5.4/rhel/8/x86_64/zabbix-get-5.4.7-1.el8.x86_64.rpm
7、测试
zabbix_get -s 172.16.0.2 -p 10050 -k'net.tcp.service[http,"127.0.0.1","80"]'
1
8、配置主机添加Nginx by Zabbix agent模板即可
9、修改/etc/zabbix/zabbix-agent.conf允许zabbix-server访问
PidFile=/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=172.16.0.100,172.16.1.200
ServerActive=172.16.0.100
ServerActive=172.16.1.200
Hostname=nginx1-172.16.1.1

分类:Linux | 标签: |

相关日志

评论被关闭!