Get the App
SLTechnology News&Howtos  ›  Servers  › 

Zabb Custom key use format handout

Shulou Source: shulou.com Published: 2022-06-03 06:44:57 09月30日 Update

This article mainly introduces the zabb custom key format handout, I hope you can add and update some knowledge, if you have other questions you need to know, you can continue to follow my updated article in the industry information.

1. First familiarize yourself with zabb's custom key format

Vim / etc/zabbix/zabbix_agentd.d/mysql.conf

# # the .conf of zabbix_agentd.d in this folder will be read by agent. A new configuration file created here is easy to use, so there is no need to move the main configuration file.

UserParameter=echo [*], echo "$1" # to pass parameters with [*], and the key key must be globally unique UserParameter=ifconfig,ifconfig | awk NR==2' {print $2}'

Systemctl restart zabbix-agent.service

# remember to restart agent after adding

two。 View Custom key

Here we use zabbix's native software get to test.

# #-ip address of s agent-k key value

If the following error occurs

Zabbix_get [87881]: Check access restrictions in Zabbix agent configuration

It should be that the local access permission is not set in the agent configuration, and 127.0.0.1 permission should be given to the agent side of the CVM. If you use 127.0.0.1 access, you will not make a mistake.

3. Use shell to fetch the read and write value of mysql first.

Get it by testing first, and take the value of the read state of mysql

4. Set mysql account permissions

Grant all privileges on. To root@ "localhost" identified by "123456"

# add a password to the root account. What I read here is the native mysql, so I use the localhost permission

Note that if the permission for refresh is set, be sure to test it.

5. Modify agent configuration file to add custom key

Vim / etc/zabbix/zabbixagentd.d/mysql.conf

`UserParameter=mysql [*], mysql-hacked 1-upright 2-pendant 3-e 'show global status;' | awk'/ Com$4\ > / {print $2}'

# replace the above code with variables`

Test it again.

As you can see in the figure above, the value of gen can be obtained normally. You can add monitoring items directly to zabbix_web.

6. Add a monitoring item

7. In assembling into a graph

Generated graphic

This is not obvious when it is split into a single aggregate figure.

8. I don't feel comfortable with the total figure above, but I adjust it to increase per second or every minute below.

Every monitoring item should be adjusted in this way.

The final generated diagram

Another way of tuning

Change it all to simple changes first.

Read the above handouts on the use of zabb custom key format, hoping to give you some help in practical application. Due to the limited space in this article, it is inevitable that there will be deficiencies and need to be supplemented. If you need more professional answers, you can contact us on the official website for 24-hour pre-sales and after-sales to help you answer questions at any time.

Tags: Permissions files tests configuration formats graphics monitoring handouts accounts questions local machine updates generation solutions obvious comfortable above professional code global Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Linux OPPO Reno vpn macOS