当前位置:网站首页>MySQL monitoring 3
MySQL monitoring 3
2022-06-30 01:27:00 【franket】
The test script
After packing , Execute the test script again , It returns a number normally
[[email protected] scripts]# /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh gg
0
[[email protected] scripts]# /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh gt
38409Where did this data come from , This file is generated during the execution of the script /tmp/localhost-mysql_cacti_stats.txt
[[email protected] scripts]# cat /tmp/localhost-mysql_cacti_stats.txt
gg:0 gh:0 gi:0 gj:0 gk:3275 gl:7096091357813 gm:0 gn:2 go:0 gp:0 gq:1310712 gr:560473 gs:747264 gt:38409 gu:666299 gv:81269 gw:3884351 gx:4850164 gy:666658 gz:22406662 hg:16685721 hh:0 hi:0 hj:0 hk:0 hl:0 hm:0 hn:0 ho:0 hp:0 hq:61117 hr:79688 hs:72627 ht:3483741 hu:46269304 hv:1477167 hw:10612667 hx:10992203 hy:712017 hz:11704230 ig:0 ih:358979056 ii:0 ij:23 ik:245 il:263 im:2048 in:10245 io:2048 ip:0 iq:2 ir:1 is:0 it:0 iu:1 iv:1 iw:1 ix:2048 iy:8 iz:12 jg:0 jh:0 ji:0 jj:0 jk:0 jl:1 jm:268417400 jn:0 jo:0 jp:0 jq:6 jr:0 js:1 jt:268435456 ju:52 jv:10816055 jw:10511991 jx:6 jy:719085 jz:0 kg:0 kh:0 ki:0 kj:0 kk:0 kl:0 km:0 kn:0 ko:0 kp:3 kq:0 kr:0 ks:0 kt:0 ku:3 kv:0 kw:6 kx:87998 ky:6025810131 kz:8388608 lg:8388608 lh:4347852912824 li:4347852916081 lj:575663419 lk:1048576 ll:0 lm:0 ln:638 lo:0 lp:0 lq:0 lr:0 ls:0 lt:0 lu:1 lv:0 lw:0 lx:0 ly:0 lz:0 mg:0 mh:0 mi:0 mj:0 mk:0 ml:2 mm:38445444 mn:712017 mo:0 mp:0 mq:6 mr:11974037 ms:10 mt:0 mu:11971670 mv:62 mw:0 mx:0 my:0 mz:10992203 ng:10612792 nh:0 ni:0 nj:-1 nk:-1 nl:21978152960 nm:0 nn:72550322 no:1 np:813 nq:815 nr:388741648 ns:2657176 nt:87248076 nu:1197592 nv:53125976 nw:0 nx:-1 ny:-1 nz:-1 og:0 oh:6119424 oi:33554432 oj:0 ok:0 ol:-1 om:-1 on:-1 oo:-1 op:-1 oq:-1 or:-1 os:-1 ot:-1 ou:-1 ov:-1 ow:-1 ox:-1 oy:-1 oz:-1 pg:-1 ph:-1 pi:-1 pj:-1 pk:-1 pl:-1 pm:-1 pn:-1 po:-1 pp:-1 pq:-1 pr:-1 ps:-1 pt:-1 pu:-1 pv:-1 pw:-1 px:-1 py:-1 pz:-1 qg:-1 qh:-1 qi:-1 qj:-1 qk:-1 ql:-1 qm:-1 qn:-1 qo:607839 qp:1964228995[[email protected] scripts]#
[[email protected] scripts]# This script is not long , There's only... In all 43 That's ok , It's right ss_get_mysql_stats.php A layer of packaging , The logic is very simple , Just look at it
[[email protected] scripts]# wc -l /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh
43 /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh
[[email protected] scripts]# cat /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh
#!/bin/sh
# The wrapper for Cacti PHP script.
# It runs the script every 5 min. and parses the cache file on each following run.
# Version: 1.1.5
#
# This program is part of Percona Monitoring Plugins
# License: GPL License (see COPYING)
# Copyright: 2015 Percona
# Authors: Roman Vynar
ITEM=$1
HOST=localhost
DIR=`dirname $0`
CMD="/usr/bin/php -q $DIR/ss_get_mysql_stats.php --host $HOST --items gg"
CACHEFILE="/tmp/$HOST-mysql_cacti_stats.txt"
if [ "$ITEM" = "running-slave" ]; then
# Check for running slave
RES=`HOME=~zabbix mysql -e 'SHOW SLAVE STATUS\G' | egrep '(Slave_IO_Running|Slave_SQL_Running):' | awk -F: '{print $2}' | tr '\n' ','`
if [ "$RES" = " Yes, Yes," ]; then
echo 1
else
echo 0
fi
exit
elif [ -e $CACHEFILE ]; then
# Check and run the script
TIMEFLM=`stat -c %Y /tmp/$HOST-mysql_cacti_stats.txt`
TIMENOW=`date +%s`
if [ `expr $TIMENOW - $TIMEFLM` -gt 300 ]; then
rm -f $CACHEFILE
$CMD 2>&1 > /dev/null
fi
else
$CMD 2>&1 > /dev/null
fi
# Parse cache file
if [ -e $CACHEFILE ]; then
cat $CACHEFILE | sed 's/ /\n/g; s/-1/0/g'| grep $ITEM | awk -F: '{print $2}'
else
echo "ERROR: run the command manually to investigate the problem: $CMD"
fi
[[email protected] scripts]# 边栏推荐
- Varnish 基础概览10
- Preliminary understanding of NVIDIA Jetson nano
- Seata 与三大平台携手编程之夏,百万奖金等你来拿
- Varnish 基础概览1
- Cookie encryption 12
- JS anti shake and throttling
- How to seamlessly transition from traditional microservice framework to service grid ASM
- 3-6sql injection website instance step 5: break through the background to obtain web administrator permissions
- 眼底出血术后需注意事项//每天必看
- [machine learning Q & A] data sampling and model verification methods, hyperparametric optimization, over fitting and under fitting problems
猜你喜欢

C语言 数素数

The first unlucky person watching eth 2.0
![[machine learning Q & A] data sampling and model verification methods, hyperparametric optimization, over fitting and under fitting problems](/img/ec/de75eb8279604a57ef7d90406ad7c7.png)
[machine learning Q & A] data sampling and model verification methods, hyperparametric optimization, over fitting and under fitting problems

C语言 害死人不偿命的(3n+1)猜想

numpy的索引和图片的索引一样吗?

The Web3 era is coming? Inventory of five Web3 representative projects | footprint analytics

The 8th "Internet +" competition - cloud native track invites you to challenge
![【图神经网络】图分类学习研究综述[3]:图分类方法评价及未来研究方向](/img/b1/2afa73a14b2f41b7a65c4c2d261e6a.png)
【图神经网络】图分类学习研究综述[3]:图分类方法评价及未来研究方向

ctfshow 大赛原题 680-695

Ansible ad-hoc 临时命令
随机推荐
post请求出现WebKitFormBoundaryk的解决办法
Varnish 基础概览6
Sentinel source code analysis Part 8 - core process - sphu Entry current limiting execution
cookie加密8
JS recursive summation 1-100
The Web3 era is coming? Inventory of five Web3 representative projects | footprint analytics
What is digital garbage? Follow the world's first AI artist to explore meta carbon Art
Is the course of digging money reliable and safe to open an account?
TP-LINK configure WiFi authentication method for wireless Internet SMS
[mrctf2020]ezpop-1 | PHP serialization
JS reverse request parameter encryption:
C语言 素数对猜想
Ansible ad-hoc temporary command
The first unlucky person watching eth 2.0
Internal class usage scenarios, syntax and principle explanations
How to seamlessly transition from traditional microservice framework to service grid ASM
js Array.from()的5个便捷应用
JS anti shake and throttling
Embedded exit (review and release)
RubyMine开发工具,重构和意图操作