[email protected](none):/etc/zabbix/zabbix_agentd.conf.d# pwd /etc/zabbix/zabbix_agentd.conf.d [email protected](none):/etc/zabbix/zabbix_agentd.conf.d# ls count_line_passwd.conf os_type.conf wc.conf [email protected](none):/etc/zabbix/zabbix_agentd.conf.d#
[email protected](none):/etc/zabbix/zabbix_agentd.conf.d# cat wc.conf UserParameter=wc[*],grep -c "$2" $1 #这里表示把$2,$1的传递给key
[email protected](none):/etc/zabbix/zabbix_agentd.conf.d# zabbix_get -s 127.0.0.1 -k wc[/etc/passwd,root] 1 [email protected](none):/etc/zabbix/zabbix_agentd.conf.d#
#grep -c ---->是统计行数(如果[]里面有多个参数项的值,用逗号隔开)
时间: 2024-10-12 15:53:54