Ad Widget

Collapse

Where is userparameter_mysql.conf?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jfha73
    Member
    • Aug 2018
    • 33

    #1

    Where is userparameter_mysql.conf?

    Hello,

    I just added the Template DB_MySQL to a host and it's not connecting to it, when I checked the Template for the mysql.ping item it says:

    It requires user parameter mysql.ping, which is defined in userparameter_mysql.conf.

    But I can'y find that file anywhere, can somebody tell me where it is?

    Thanks
  • jfha73
    Member
    • Aug 2018
    • 33

    #2
    OK found the file, but I have no idea what to put in it.

    The error I'm seeing with this Template is that it's trying to login using user root with no password and since it can't it shows as Not Supported, so I'm guessing what I have to put in there is the username and password, but how? what are the names of the variables that I have to put there?

    I saw in share.zabbix.com a MySQL Template, I don't know if it's the same, but there it says to add the user and password as macros, which I did, but it's not working.

    Any ideas?

    Comment

    • Atsushi
      Senior Member
      • Aug 2013
      • 2028

      #3
      You need to configure it to be able to connect to the MySQL server using the Zabbix user on the OS.
      For example, create .my.cnf in the Zabbix user's home directory.

      This is also described in the first line of userparameter_mysql.conf.

      ex. /var/lib/zabbix/.my.cnf
      Code:
      [client]
      user = zabbix
      password = password

      Comment

      • jfha73
        Member
        • Aug 2018
        • 33

        #4
        Thanks Atsushi, I just put those lines in that file in the Zabbix user's home folder, let's see if it catches it when it checks MySQL again.

        Comment

        • jfha73
          Member
          • Aug 2018
          • 33

          #5
          Interesting, it did change the username to login to MySQL from root to zabbix, but it still says using password NO, which is not true as I did put the password for the database user zabbix.

          Am I missing something?

          Thanks.

          Comment

          • jfha73
            Member
            • Aug 2018
            • 33

            #6
            I finally got it working by creating the same file in the same folder on the MySQL servers themselves, not just the Zabbix server, I like the idea of putting this info in a macro instead so people don't have to create this file on every server that has MySQL running.

            Comment

            Working...