Zabbix 2 — мониторим MySQL

Zabbix 2 — мониторим MySQL

Новая версия 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. Все, теперь осталось подключить шаблон к хосту и наблюдать за цифрами и веселыми картинками.

Рейтинг 4.78/5

39 thoughts on “Zabbix 2 — мониторим MySQL

  1. Спасибо. Помог.
    В заббиксе самом написано что мол настраивайте в userparameter_mysql.conf, а в пакете этого файла небыло.

    еще тут столкнулся. в .my.cnf еще хорошо указать host = 127.0.0.1, а то если mysql запущен с skip-name-resolve то заббикс будет ломится на localhost и получать отказ

  2. Файл userparameter_mysql.conf, есть в составе любого дистрибутива.

    Найти его можно как правило в /usr/share/doc/zabbix*/

  3. Отличная статья! Спасибо огромное! Все настроил, метрики снимаются, на почту тригеры о больших количествах запросов в секунду шлются!
    Респект за статью!!

  4. 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

  5. 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.

  6. 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.

  7. In any occasion, the standards of propitious news-casting haven’t been disposed of by this significant snare index. Google in actuality thinks instances take the dash and substance of articles, uncommonly as a component of its XML. Gargantuan news-casting is tied in with being straightforward and as even headed as could be expected.

    For what talk over with do you over the Google XML sitemap creeps, lists, and distributes outsider locate soothe from CNN, BBC, Techcrunch, The Impediment Boulevard Magazine and others in its incline items?

    my blog

    $e33

  8. In any the actuality, the standards of good news-casting haven’t been minded of through this significant net index. Google in truth thinks often to the look and meat of articles, peculiarly as a component of its XML. Major news-casting is tied in with being straightforward and as level headed as could be expected.

    An eye to what reason do you over the Google XML sitemap creeps, lists, and distributes visitor site subject-matter from CNN, BBC, Techcrunch, The Enclosure Street Magazine and others in its list items?

    my blog

    $e33

  9. In any case, the standards of propitious news-casting haven’t been willing of past this valuable network index. Google actually thinks time after time about the dash and meat of articles, particularly as a component of its XML. Great news-casting is tied in with being straightforward and as level headed as could be expected.

    For what judgement do you over the Google XML sitemap creeps, lists, and distributes visitor position content from CNN, BBC, Techcrunch, The Wall Street Magazine and others in its incline items?

    my blog

    $e33

  10. In any the actuality, the standards of good news-casting haven’t been minded of sooner than this noteworthy network index. Google in actuality thinks usually take the dash and sum total of articles, peculiarly as a component of its XML. Gargantuan news-casting is tied in with being straightforward and as level headed as could be expected.

    In search what saneness do you meditate on the Google XML sitemap creeps, lists, and distributes outsider locate soothe from CNN, BBC, Techcrunch, The Enclosure High road Magazine and others in its incline items?

    my blog

    $e33

  11. In any occasion, the standards of profitable news-casting haven’t been willing of past this noteworthy net index. Google indeed thinks often take the look and substance of articles, uncommonly as a component of its XML. Vast news-casting is tied in with being straightforward and as destroy headed as could be expected.

    An eye to what reason do you meditate on the Google XML sitemap creeps, lists, and distributes outsider place subject-matter from CNN, BBC, Techcrunch, The Divider In someone’s bailiwick Logbook and others in its list items?

    my blog

    $e33

Добавить комментарий

Ваш адрес email не будет опубликован.