标签:51cto active color 新建 模板 $1 cep version agent
创建zabbix_agentd的子配置文件zabbix-agent配置自定义key:
UserParameter=nginx.status[],/etc/zabbix/scripts/nginx_status.sh $1
UserParameter=php-fpm.status[],/usr/bin/curl -s -m 5 "http://127.0.0.1/statusx45?xml" | grep "<$1>" | awk -F‘>|<‘ ‘{ print $$3}‘
#UserParameter=idle.processe,/etc/zabbix/scripts/php-fpm_status.sh idle
#UserParameter=total.processes,/etc/zabbix/scripts/php-fpm_status.sh total
#UserParameter=active.processes,/etc/zabbix/scripts/php-fpm_status.sh active
#UserParameter=max.active.processes,/etc/zabbix/scripts/php-fpm_status.sh mactive
#UserParameter=listen.queue.len,/etc/zabbix/scripts/php-fpm_status.sh listenqueuelen
#UserParameter=listen.queue,/etc/zabbix/scripts/php-fpm_status.sh listenqueue
#UserParameter=start.since,/etc/zabbix/scripts/php-fpm_status.sh since
#UserParameter=accepted.conn,/etc/zabbix/scripts/php-fpm_status.sh conn
#UserParameter=max.children.reached,/etc/zabbix/scripts/php-fpm_status.sh reached
#UserParameter=slow.requests,/etc/zabbix/scripts/php-fpm_status.sh requests
UserParameter=chatter.pid[*],ps -ef | grep $1 | grep -v grep | grep $2 | grep -v grep | awk ‘{print $$2}‘
zabbix服务端的get数值
[root@mha ~]# zabbix_get -s 192.168.198.131 -k ‘nginx.status[ping]‘
1
zabbix页面:
nginx:
添加nginx status监控模板
新建nginx status模板
定义nginx status模板
新建nginxApplication
定义nginx status items,这里我使用的是被动临控
增加nginx status状态码映射
nginx trigger定义
定义nginx监控视图
标签:51cto active color 新建 模板 $1 cep version agent
原文地址:http://blog.51cto.com/wsw26/2064990