Zabbix custom key test failed

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.