Ad Widget

Collapse

Template App MySQL.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • skwalou
    Junior Member
    • Sep 2013
    • 15

    #1

    Template App MySQL.

    Hi,
    It's a traduction of this french post :


    It's possible to monitor a remote database MySQL (LAN, not the base MySQL of Zabbix Server) with this basic Template ?.
    If so, i'm interested for HowTo.
    Thanks.
  • prc2k10
    Junior Member
    • Jan 2014
    • 3

    #2
    Hi,

    you can create a user in remote mysql server like this:
    Code:
    GRANT USAGE ON *.* TO 'monitor'@'%' IDENTIFIED BY 'yourpw';
    Then you can create Userparameter in your agent config like this:
    Code:
    UserParameter=mysql.status[*],(test -f /usr/bin/mysqladmin && mysqladmin -u$1 -p$2 extended-status 2>/dev/null | awk '/ $3 /{print $$4}')
    UserParameter=mysql.ping[*],(test -f /usr/bin/mysqladmin && mysqladmin -u$1 -p$2 ping | grep alive | wc -l)
    UserParameter=mysql.version,(test -f /usr/bin/mysqladmin && mysqladmin -V)
    on your zabbix server edit the item template to use you new config: (i use macros for user and pw per host)
    this is a example for slow queries
    Code:
    mysql.status[{$MYSQL_USER},{$MYSQL_PASSWORD},Slow_queries]
    or without macros:
    Code:
    mysql.status[monitor,yourpw,Slow_queries]
    Cheers
    Peter

    Comment

    • skwalou
      Junior Member
      • Sep 2013
      • 15

      #3
      Hi,

      Thank you for your reply.
      I'll try shortly.

      Regards.

      Comment

      Working...