Zabbix Learning Note 5-custom user key and parameter userparameters

Source: Internet
Author: User

Sometimes we want to let the monitored side perform a zabbix without a pre-top detection, Zabbix's user-defined parameters feature provides this method, which we can configure in the client Profile zabbix_agentd.conf Userparameter


Userparameter=key,command


User-defined parameters include a key and a command, the key must be the entire system unique, configured well, restart the client.

Then configure the item and fill in the key's location with our custom key. The script specified by the user's custom parameter is executed by the Zabbix agent, which can return up to 512kb of data


User-defined Key

Userparameter=ping,echo 1

If you call ping this key, you will receive a return value of 1


More complex commands

Userparameter=mysql.ping,mysqladmin-uroot Ping|grep-c Alive

Returning 1 means that MySQL is alive, and returning 0 means MySQL is dead.


Flexible key definition

Userparameter=key[*],command

* Indicates that multiple parameters can be passed

Command needs to execute the script, key [] inside the parameter one by one corresponds to the $1-$9,$0 represents the script command


Userparameter=ping[*],echo $

Ping[0]-will always return 0

PING[AAA]-will always return ' AAA '


If you have special characters, you need to turn on unsafe parameters

Execution requires permission to execute a command


Add Item

Type: Zabbix client-side Active

Key-Value: Key


This article from "Eight Miles" blog, declined reprint!

Zabbix Learning Note 5-custom user key and parameter userparameters

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.