Zabbix The custom key test failed

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

  • 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.