要做一个很简单的收集系统内存使用情况的监控,根据网上各种资料获得方法如下:修改zabbix_agentd.conf中的几个配置UnsafeUserParameters=1UserParameter=mem.usage,/usr/bin/free-m|grepMem|awk'{print$3}'然后zabbix_agentd-tmem.usage,返回报错mem.usage[m|ZBX_NOTSUPPORTED][Unsupporteditemkey.]试过另外一个感觉一样的方法:修改zabbix_agentd.conf中的几个配置UnsafeUserParameters=1Include=/app/local/zabbix/conf/zabbix_agentd/*.conf然后在/app/local/zabbix/conf/zabbix_agentd/中创建mem_usage.conf文件mem_usage.conf中的内容为UserParameter=mem.usage,HOME=/app/local/zabbix/sh/mem_usage.sh在/app/local/zabbix/sh/中创建mem_usage.sh文件,内容为#!/bin/bash/usr/bin/free-m|grepMem|awk'{print$3}'运行此脚本能正确返回结果,但使用zabbix_agentd-tmem.usage,返回报错mem.usage[m|ZBX_NOTSUPPORTED][Unsupporteditemkey.]求大神指点。。。。
holdtom
相关分类