To monitor the memory usage of the collection system, follow these steps to obtain the information on the Internet: modify several configurations in zabbix_agentd.conf {code ...} then zabbix_agentd-tmem.usage, return error {code ...} I tried another method that feels the same... to monitor the memory usage of a simple collection system, you can obtain the following information based on the information on the Internet:
Modify several configurations in zabbix_agentd.conf
UnsafeUserParameters=1UserParameter=mem.usage,/usr/bin/free -m |grep Mem | awk '{print $3}'
Then zabbix_agentd-t mem. usage returns an error
mem.usage [m|ZBX_NOTSUPPORTED] [Unsupported item key.]
I tried another method that feels the same:
Modify several configurations in zabbix_agentd.conf
UnsafeUserParameters=1Include=/app/local/zabbix/conf/zabbix_agentd/*.conf
Create the mem_usage.conf file in/app/local/zabbix/conf/zabbix_agentd /.
Content in mem_usage.conf is
UserParameter=mem.usage,HOME=/app/local/zabbix/sh/mem_usage.sh
Create the mem_usage.sh file in/app/local/zabbix/sh/. The content is
#!/bin/bash/usr/bin/free -m |grep Mem |awk '{print $3}'
Run this script to return the correct result, but use zabbix_agentd-t mem. usage to return an error.
mem.usage [m|ZBX_NOTSUPPORTED] [Unsupported item key.]
Please kindly advise ....
Reply content:
To monitor the memory usage of a simple collection system, you can obtain the following information based on the information on the Internet:
Modify several configurations in zabbix_agentd.conf
UnsafeUserParameters=1UserParameter=mem.usage,/usr/bin/free -m |grep Mem | awk '{print $3}'
Then zabbix_agentd-t mem. usage returns an error
mem.usage [m|ZBX_NOTSUPPORTED] [Unsupported item key.]
I tried another method that feels the same:
Modify several configurations in zabbix_agentd.conf
UnsafeUserParameters=1Include=/app/local/zabbix/conf/zabbix_agentd/*.conf
Create the mem_usage.conf file in/app/local/zabbix/conf/zabbix_agentd /.
Content in mem_usage.conf is
UserParameter=mem.usage,HOME=/app/local/zabbix/sh/mem_usage.sh
Create the mem_usage.sh file in/app/local/zabbix/sh/. The content is
#!/bin/bash/usr/bin/free -m |grep Mem |awk '{print $3}'
Run this script to return the correct result, but use zabbix_agentd-t mem. usage to return an error.
mem.usage [m|ZBX_NOTSUPPORTED] [Unsupported item key.]
Please kindly advise ....
After modifying the zabix-agentd.conf, You need to restart and then you can use the software that comes with zabbix to test the custom KEY
zabbix-get -s agent_ip -p 10050 -k mem.usage
Different Versions lead to poor news!
Https://www.zabbix.com/documentation/3.0/manual/config/items/userparameters/extending_agent