agengt端自定义文件内容:
[root@localhost zabbix_agentd.d]# cat mem.conf
UserParameter=check.totalmem,free -m| awk -F ' +' 'NR==2{print $2}'
UserParameter=check.usedmem,free -m| awk -F ' +' 'NR==2{print $3}'
UserParameter=check.freemem,free -m| awk -F ' +' 'NR==2{print $4}'
在server端可以get到:
[root@localhost ~]# zabbix_get -s 192.168.108.31 -p 10050 -k "check.totalmem"
3774
[root@localhost ~]# zabbix_get -s 192.168.108.31 -p 10050 -k "check.usedmem"
197
[root@localhost ~]# zabbix_get -s 192.168.108.31 -p 10050 -k "check.freemem"
3321