In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces zabbix how to customize the monitoring items, the article is very detailed, has a certain reference value, interested friends must read it!
Although Zabbix provides a lot of templates (simply understood as a collection of monitoring items), you can jump directly to the official website of template Daquan by clicking the share button in the zabbix interface, but due to the large number of monitoring items in the template, which are difficult to sort out and the uneven quality of various templates, it is recommended to customize the template for the host or product you want to monitor (Linux server host monitoring can use the default template).
Environment description:
Zabbix version: 3.0.3 operating system: CentOS 7 mysql version: 5.7.1
Implementation steps:
1. Modify the zabbix_agentd.conf and add the zabbix_agent configuration directory. The following is the configuration of my native zabbix: remove the comments from the following line
# Include=/usr/local/etc/zabbix_agentd.conf.d/*.conf
Become:
Include=/usr/local/etc/zabbix_agentd.conf.d/*.conf
After this line comment is removed, all .conf files in the / usr/local/etc/zabbix_agentd.conf.d/ directory are automatically scanned and loaded after zabbix_agentd starts.
2. Write a monitoring script / usr/local/zabbix/zabbix-script/get_mysql_status.sh. The script is as follows (the directory where the script is stored can be customized):
#! / bin/shcase $3 inuptime) mysqladmin-upright 1-pendant 2 status 2 > / dev/nul | awk-F'[:]'+'{print $2}';; threads) mysqladmin-upright 1-pendant 2 status 2 > / dev/nul | awk-F'[:]'+ {print $4}';; question) mysqladmin-upright 1-pendant 2 status 2 > / dev/nul | awk-F'[:]'+'{print $6}' Sq) mysqladmin-upright 1-pendant 2 status 2 > / dev/nul | awk-F'[:]'+'{print $9}';; open) mysqladmin-upright 1-pendant 2 status 2 > / dev/nul | awk-F'[:] +'{print $11}'; ftable) mysqladmin-upright 1-pendant 2 status 2 > / dev/nul | awk-F'[:]'+'{print $14}'; opent) mysqladmin-upright 1-pendant 2 status 2 > / dev/nul | awk-F'[:]'+'{print $17}' Qps) mysqladmin-upright 1-pendant 2 status 2 > / dev/nul | awk-F'[: |]'+'{print $22}'; *)
The script states that the script needs to enter three parameters: mysql user, mysql user password and mysql status: uptime: running time unit s, threads: number of sessions opened, question (questions): number of customer questions (queries) since the server started sq (Slow queries): number of slow queries open (opens): number of database tables opened by the server ftable (Flush tables): flush executed by the server … Number of, refresh, and reload commands opent (open tables): the average query time for the qps (Queries per second avg): select statement to start with server startup through the number of tables in the database in which the command is used
3. Add the monitoring item configuration file get_mysql_status.conf under the / usr/local/etc/zabbix_agentd.conf.d/ directory, as follows:
UserParameter=get_mysql_status [*], / usr/local/zabbix/zabbix-script/get_mysql_status.sh $1 $2 $3
4. Restart zabbix_agent and zabbix_server, and test using zabbix_get, as follows:
# zabbix_get-s 127.0.0.1-k get_mysql_status [root,weiming,open] 679
5. Add monitoring items on the web: add monitoring items on the host:
After the addition, you can see that the new monitoring items are as follows:
Add a drawing:
Graphic Preview:
The above is all the content of the article "how to customize the monitoring items in zabbix". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.