Ad Widget

Collapse

Working Agent refusing to start after configuring MySQL monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • IanHavelock
    Junior Member
    • Nov 2015
    • 10

    #1

    Working Agent refusing to start after configuring MySQL monitoring

    Hi all,

    I've been using Zabbix for years but recently changed jobs, and my old account was linked to my work email account, hence starting afresh

    I'm running Zabbix 2.4.7 and my agent is working fine on this particular Debian host for monitoring standard linux processes, but I have a MySQL instance on this host that I want to monitor. I have added the template to the relevant host in the front-end, but when I configure /etc/zabbix/zabbix_agentd.d/.my.cnf with MySQL credentials, the agent now refuses to start.

    Code:
    [mysql]
    user=zabbix
    password=zabbix_sql_password
    [mysqladmin]
    user=zabbix
    password=zabbix_sql_password
    This user works and can login to SQL on this particular host. It was given the following permissions: GRANT USAGE ON *.* TO 'zabbix'@'localhost' IDENTIFIED BY 'zabbix_mysql_password'; (as well as the same on 127.0.0.1) as mentioned here: http:// blog.themilkyway.org / 2013 / 11 / how-to-monitor-mysql-using-the-new-zabbix-template-app-mysql (spaces added due to spam filter)

    /etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf contains the following:



    I have followed the instructions and set the HOME path to be the path with the .my.cnf file but the agent just refuses to start - I receive the following:

    ian@magnesium:/etc/zabbix/zabbix_agentd.d$ sudo service zabbix-agent start
    [....] Starting Zabbix agent: zabbix_agentdian@magnesium:/etc/zabbix/zabbix_agentd.d$


    And when I do ps aux | grep zabbix, I can't see the agent running as usual.

    Any help would be greatly appreciated!
    Last edited by IanHavelock; 26-11-2015, 13:00.
  • IanHavelock
    Junior Member
    • Nov 2015
    • 10

    #2
    Does anyone have any suggestions on how to get the standard MySQL template working?

    Comment

    • ingus.vilnis
      Senior Member
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Mar 2014
      • 908

      #3
      Hi,

      Do you get any output in Zabbix agent log file?

      Try removing at first [mysqladmin] section from .my.cnf file to see of it helps.

      Maybe something Debian related hidden here? I recall having some issues with this on Ubuntu 12.04. Don't remember how did I fix them but I did.
      Never had anything like this on RHEL / CentOS.

      Best Regards,
      Ingus

      Comment

      • IanHavelock
        Junior Member
        • Nov 2015
        • 10

        #4
        From my agent host, if I cd into /etc/zabbix/zabbix_agentd.d/ and type:

        Code:
        mysql
        It doesn't appear to be using the .my.cnf file?

        It says:

        Code:
        ERROR 1045 (28000): Access denied for user 'stevenh'@'localhost' (using password: NO)
        Which is my server logon, not the username stored in .my.cnf.

        However, if from my Zabbix server I run:

        Code:
        stevenh@zabbixserver:~$ zabbix_get -s 10.3.30.12 -k mysql.ping
        mysqladmin: connect to server at 'localhost' failed
        error: 'Access denied for user 'zabsql'@'localhost' (using password: NO)'
        The agent allows SQL access from the agent commandline without a problem, and I assume that it is actually the agent doing the Mysql query, not the Zabbix server itself?

        Comment

        • ingus.vilnis
          Senior Member
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Mar 2014
          • 908

          #5
          Originally posted by IanHavelock
          From my agent host, if I cd into /etc/zabbix/zabbix_agentd.d/ and type:

          Code:
          mysql
          It doesn't appear to be using the .my.cnf file?
          It never should. By hitting "mysql" command here you simply open MySQL application and it has nothing to do with your .my.cnf file for Zabbix agent. It will use the username from your user account.

          Originally posted by IanHavelock
          It says:

          Code:
          ERROR 1045 (28000): Access denied for user 'stevenh'@'localhost' (using password: NO)
          Which is my server logon, not the username stored in .my.cnf.

          However, if from my Zabbix server I run:

          Code:
          stevenh@zabbixserver:~$ zabbix_get -s 10.3.30.12 -k mysql.ping
          mysqladmin: connect to server at 'localhost' failed
          error: 'Access denied for user 'zabsql'@'localhost' (using password: NO)'
          The agent allows SQL access from the agent commandline without a problem, and I assume that it is actually the agent doing the Mysql query, not the Zabbix server itself?
          Agent is doing the query. And it tries to do it with the credentials in the file.

          Were you able to start the agent in the end then?

          "mysql.ping" uses [mysqladmin] section from .my.cnf file so you must have it to get data.
          In my previous comment I wanted to rule out issues that prevent agent from starting.

          Best Regards,
          Ingus

          Comment

          Working...