Monitoring MySQL with Zabbix Agent

  1. Check that your zabbix_server config file is including the /etc/zabbix/zabbix_agentd.d/*.conf :
    vi /etc/zabbix/zabbix_agentd.conf

    (you will find at almost the end of file: Include =/etc/zabbix/zabbix_agentd.d/*.conf)

  2. Check where your zabbix_mysql config is :
    vim /etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf
  3. If you’ll find it for example: HOME=/var/lib/zabbix then create that directory if it does not exist:
    mkdir /var/lib/zabbix
  4. change your position to that directory and create/edit .my.cnf file:
    cd /var/lib/zabbix
    vim .my.cnf

    add the following :

    [mysql]
    user=zabbix
    password=zabbix
    host=localhost
    
    [mysqladmin]
    user=zabbix
    password=zabbix
    host=localhost

    Then save.

I presume you already have a mysql username=zabbix and password=zabbix with all privileges.

Restart mysql:

    service mysqld restart

Now connect to your zabbix gui and check the values coming from mysql (Monitoring–> Latest data)

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s