To do a very simple collection system memory usage monitoring, according to the various information on the Internet to obtain the method as follows:
Modify several configurations in the zabbix_agentd.conf
UnsafeUserParameters=1UserParameter=mem.usage,/usr/bin/free -m |grep Mem | awk '{print $3}'
Then Zabbix_agentd-t Mem.usage, return the error
mem.usage [m|ZBX_NOTSUPPORTED] [Unsupported item key.]
Try another one that feels the same way:
Modify several configurations in the zabbix_agentd.conf
UnsafeUserParameters=1Include=/app/local/zabbix/conf/zabbix_agentd/*.conf
Then create the mem_usage.conf file in the/app/local/zabbix/conf/zabbix_agentd/
The content in mem_usage.conf is
UserParameter=mem.usage,HOME=/app/local/zabbix/sh/mem_usage.sh
Create a mem_usage.sh file in/app/local/zabbix/sh/with the contents of
#!/bin/bash/usr/bin/free -m |grep Mem |awk '{print $3}'
Run this script to return the result correctly, but use zabbix_agentd-t mem.usage to return an error
mem.usage [m|ZBX_NOTSUPPORTED] [Unsupported item key.]
Seek the guidance of the great God ....
Reply content:
To do a very simple collection system memory usage monitoring, according to the various information on the Internet to obtain the method as follows:
Modify several configurations in the zabbix_agentd.conf
UnsafeUserParameters=1UserParameter=mem.usage,/usr/bin/free -m |grep Mem | awk '{print $3}'
Then Zabbix_agentd-t Mem.usage, return the error
mem.usage [m|ZBX_NOTSUPPORTED] [Unsupported item key.]
Try another one that feels the same way:
Modify several configurations in the zabbix_agentd.conf
UnsafeUserParameters=1Include=/app/local/zabbix/conf/zabbix_agentd/*.conf
Then create the mem_usage.conf file in the/app/local/zabbix/conf/zabbix_agentd/
The content in mem_usage.conf is
UserParameter=mem.usage,HOME=/app/local/zabbix/sh/mem_usage.sh
Create a mem_usage.sh file in/app/local/zabbix/sh/with the contents of
#!/bin/bash/usr/bin/free -m |grep Mem |awk '{print $3}'
Run this script to return the result correctly, but use zabbix_agentd-t mem.usage to return an error
mem.usage [m|ZBX_NOTSUPPORTED] [Unsupported item key.]
Seek the guidance of the great God ....
A reboot is required after modifying the zabix-agentd.conf, and then you can test your custom key using the software that comes with Zabbix.
zabbix-get -s agent_ip -p 10050 -k mem.usage
Different versions, resulting in pit daddy!
Https://www.zabbix.com/documentation/3.0/manual/config/items/userparameters/extending_agent