Новая версия Zabbix 2, помимо прочих плюшек, умеет легко и красиво мониторить основные параметры MySQL-серверов. Более того, в ней для этого есть стандартный шаблон Template Default MySQL. И как оказалось, настраивается он в пару нажатий.
Итак, на хосте, который надо мониторить, нам понадобится следующее:
1. Выполняем в MySQL запрос вида
GRANT USAGE ON *.* TO 'zabbix'@'%' IDENTIFIED BY 'superpassword';
2. В zabbix_agentd.conf проверяем подключение дополнительных конфигов и путь к ним:
Include=/etc/zabbix/conf.d/
3. Если при установке агента файл userparameter_mysql.conf не распаковался, создаем его в каталоге из п.2:
UserParameter=mysql.status[*],echo "show global status where Variable_name='$1';" | HOME=/var/lib/zabbix mysql -N | awk '{print $$2}'
UserParameter=mysql.size[*],echo "select sum($(case "$3" in both|"") echo "data_length+index_length";; data|index) echo "$3_length";; free) echo "data_free";; esac)) from information_schema.tables$([[ "$1" = "all" || ! "$1" ]] || echo " where table_schema='$1'")$([[ "$2" = "all" || ! "$2" ]] || echo "and table_name='$2'");" | HOME=/var/lib/zabbix mysql -N
UserParameter=mysql.ping,HOME=/var/lib/zabbix mysqladmin ping | grep -c alive
UserParameter=mysql.version,mysql -V
4. В этом файле обращаем внимание на переменную HOME=/var/lib/zabbix. Именно в этот каталог надо положить файл .my.cnf со следующим содержанием:
[client]
user = zabbix
password = superpassword
5. Все, теперь осталось подключить шаблон к хосту и наблюдать за цифрами и веселыми картинками.
#1 by spyer on 23.08.2013 - 13:58
Quote
Спасибо, очень полезно. Про .my.cnf нет нигде инфы.
#2 by airo on 05.09.2013 - 23:19
Quote
Спасибо. Помог.
В заббиксе самом написано что мол настраивайте в userparameter_mysql.conf, а в пакете этого файла небыло.
еще тут столкнулся. в .my.cnf еще хорошо указать host = 127.0.0.1, а то если mysql запущен с skip-name-resolve то заббикс будет ломится на localhost и получать отказ
#3 by a-zazell on 02.11.2013 - 13:48
Quote
Спасибо за заметку, помогла. Не сразу въехал, что файл дб именно «.my.cnf», а не «my.cnf».
#4 by Denis on 16.01.2014 - 12:41
Quote
Файл userparameter_mysql.conf, есть в составе любого дистрибутива.
Найти его можно как правило в /usr/share/doc/zabbix*/
#5 by bogdan on 21.07.2014 - 22:44
Quote
спасибо большое)
#6 by Кастильское мыло on 17.05.2015 - 03:46
Quote
Никакой больше ерунды из магазина — теперь пользуюсь только
натуральным мылом ручной
работы Nadine.com.ua — рекомендую.
#7 by finalist on 20.06.2016 - 16:34
Quote
Отличная статья! Спасибо огромное! Все настроил, метрики снимаются, на почту тригеры о больших количествах запросов в секунду шлются!
Респект за статью!!
#8 by gbsouqehmwij on 18.06.2020 - 12:38
Quote
discount cialis buy generic cialis https://wmmcialis.com/# — buy cialis online safely cialis pills when will cialis be generic
#9 by cialis on 08.10.2020 - 02:00
Quote
Global Message Here this by-product
cialis https://cialislevel.com/# cialis
#10 by levitra on 08.10.2020 - 02:00
Quote
Global Message Far this outcome
levitra https://levitrahill.com/# levitra
#11 by cleckleyfloors.com on 08.10.2020 - 18:04
Quote
Excellent, what a weblog it is! This weblog gives helpful
data to us, keep it up. http://cleckleyfloors.com/
#12 by plaquenil hydroxychloroquine who manufactures on 31.10.2020 - 21:13
Quote
plaquenil hydroxychloroquine who manufactures https://hydroxychloroquine.webbfenix.com/
#13 by Scottblice on 08.11.2020 - 19:07
Quote
prescription drugs without doctor approval generic ed pills online medication
http://camzone.org/ prescription drugs without doctor approval
natural ed medications generic cialis treating ed
#14 by auto owners ins on 08.11.2020 - 21:07
Quote
personal presentation
#15 by vidalista liquid research chems on 22.11.2020 - 01:37
Quote
vidalista liquid research chems https://vidalista.buszcentrum.com/
#16 by harlots on 26.11.2020 - 09:09
Quote
Alter ego members of the polite society of prostitutes and whores are waiting for you. Decent freedom time to sexually active men with money.
#17 by vidalista 5 mg coupon costco on 29.11.2020 - 08:44
Quote
vidalista 5 mg coupon costco https://vidalista.mlsmalta.com/
#18 by normal aurogra dose on 30.11.2020 - 01:58
Quote
normal aurogra dose https://aurogra.buszcentrum.com/
#19 by methotrexate and suprax drug interaction on 03.12.2020 - 17:48
Quote
methotrexate and suprax drug interaction https://cefixime.webbfenix.com/
#20 by Anagpba on 05.12.2020 - 08:43
Quote
kindergarten homework packet buy pre written essays step to write an essay
#21 by chloroquine pill on 05.12.2020 - 13:57
Quote
chloroquine pill https://hydroxychloroquinee.com/
#22 by Laynevlpq on 11.12.2020 - 18:43
Quote
elavil 25 mg usa elavil 50mg over the counter elavil 10mg medication
#23 by Fionaphbw on 18.12.2020 - 11:34
Quote
gambling casino best online casinos that payout play casino
#24 by Celinesjkn on 20.12.2020 - 16:43
Quote
seroquel medication seroquel 300mg united states where to buy seroquel
#25 by q8adsweb.com on 28.12.2020 - 10:26
Quote
That is very attention-grabbing, You are an overly skilled blogger.
I have joined your feed and look ahead to in quest of
more of your fantastic post. Also, I have shared your website in my social networks
#26 by Bistroduetbarp on 05.01.2021 - 19:51
Quote
If you are looking payment a portugal duenna that ordain not only help you relax but also profit from your stay, then you have take place to the satisfactorily place. You bequeath finger some of the most magnificent and sweetest girls in all of USA. Scroll in the course the website to find unerringly what you are looking in place of in whichever municipality you are in.
find out this here
The disparity of breathtaking girls convenient effectiveness make it a crumb of a contest to on from, but we can guarantee that you want be satisfied with whoever you choose, even if you pick with your eyes closed. It does not make a difference if you are a specific or some big cannon-ball businessman from obsolete of township, you can hope for the excellent treatment from any companion you choose.
#27 by Bistroduetbarp on 07.01.2021 - 23:26
Quote
If you are looking for a fellow that will not only better you mitigate but also enjoy your obstruct, then you contain come to the preferable place. You bequeath find some of the most charming and sweetest girls in all of USA. Scroll on account of the website to find exactly what you are looking after in whichever city you are in.
description
The variety of gorgeous girls to hand power coerce it a crumb of a challenge to on from, but we can guarantee that you resolve be satisfied with whoever you choose, unchanging if you pick with your eyes closed. It does not of importance if you are a neighbouring or some important shot businessman from out of town, you can imagine the best treatment from any escort you choose.
#28 by fauth on 14.01.2021 - 22:16
Quote
A strip club with no panties? Do you go to the megaplex with no panties on? No names just let me know where you will be and what you will be wearing.
https://verbasco.noblogs.org/post/2015/11/17/sono-stati-e-fanno-la-guerra/#comment-18165 Result: используем SOCKS 188.165.196.197:55621; использован никнейм «lient»; ReCaptcha2 обработать не удалось; успех (с первой страницы);
#29 by 2021dof on 25.01.2021 - 23:11
Quote
Popular Searches. Online chatting at TenderMeets. Then you have come to the right place, Uptoflirt.
classicvibes1480cin.com
#30 by fauth on 29.01.2021 - 18:26
Quote
You can too Enjoy the best horny chats you can find online on Shagtogether. Next Start NOW!
http://forum.darkstalker.eu/misc/contact Result: используем SOCKS 37.59.46.63:56128; использован никнейм «Spelm»; успех;