1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| [root@zabbix5 fonts]# zabbix_get -s 172.16.1.7 -k tcp.port.http (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) 报错原因:定义监控项时,定义的数据类型是数字,结果获取到的值含有字符串 解决方案:将zabbix用户提权 [root@web01 ~]# visudo zabbix ALL=(ALL) NOPASSWD: ALL
[root@web01 ~]# vim /etc/zabbix/zabbix_agentd.d/port.conf UserParameter=tcp.port.ssh,sudo netstat -lntup|grep -wc "22" UserParameter=tcp.port.http,sudo netstat -lntup|grep -wc "80" UserParameter=tcp.port.tomcat,sudo netstat -lntup|grep -wc "8080"
UserParameter=tcp.port.ssh,ss -ltnup|grep -wc 'sshd'
给netstat命令加setuid权限
|