zabbix2.0 添加自定义监控项
1. key的创建
客户端配置文件如下:
root@192.168.100.254:/usr/local/zabbix/sbin# egrep -v "(^#|^$)" ../etc/zabbix_agentd.conf LogFile=/tmp/zabbix_agentd.log Server=192.168.100.252 ServerActive=127.0.0.1 Hostname=Zabbix server Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
在客户端创建/usr/local/zabbix/etc/zabbix_agentd.conf.d/count_line_passwd.conf
root@192.168.100.254:/usr/local/zabbix/sbin# cat ../etc/zabbix_agentd.conf.d/count_line_passwd.conf UserParameter=count.line.passwd,wc -l /etc/passwd | awk '{print $1}'
重启客户端进程
root@192.168.100.254:/usr/local/zabbix/sbin# killall zabbix_agentd root@192.168.100.254:/usr/local/zabbix/sbin# ./zabbix_agentd
在服务器端执行key值检查:
root@192.168.100.252:/usr/local/services/lighttpd/sbin# zabbix_get -s 192.168.100.254 -p 10050 -k "count.line.passwd" 33
说明key值创建成功
2. web页面创建模版
3. 创建自定义item
4. 查看自定义item項的值