Ad Widget

Collapse

Mysql monitoring error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Piyush299
    Junior Member
    • Oct 2021
    • 3

    #1

    Mysql monitoring error

    I am facing issue with mysql monitoring. I want to monitor my zabbix server database but I am getting below error

    Warning: World-writable config file '/var/lib/zabbix/.my.cnf' is ignored
    mysqladmin: connect to server at '10.18.xx.xxx' failed
    error: 'Can't connect to MySQL server on '10.18.xx.xxx' (13)'
    Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

    I have verified below
    1. user zbx_monitor has been created with permission GRANT REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zbx_monitor'@'%';
    2. I am able to login to zabbix database with user zbx_monitor
    3. I have created file /var/lib/zabbix/.my.cnf file and privided username and password as below
    [client]
    user=zbx_monitor
    password=<password>
    4. copied file to /etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf
    5. My /etc/passwd file looks like this
    zabbix:x:994:580:Zabbix Monitoring System:/var/lib/zabbix:/sbin/nologin
    6. Assigned the template Template DB MySQL by Zabbix agent to database host
    7. created Host Macro {$MYSQL.HOST} with DB IP

    Can someone help me , how can I get this working
  • Piyush299
    Junior Member
    • Oct 2021
    • 3

    #2
    Thanks Cyber,

    Changing the permission level has fixed one error, but still geting below error

    mysqladmin: connect to server at '10.18.**.***' failed
    error: 'Can't connect to MySQL server on '10.18.**.***' (13)'
    Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!


    I can login with zbx_monitor user manually

    $ mysql -u zbx_monitor -p --host=10.18.**.*** --port=3301 --protocol=tcp
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 82178
    Server version: 5.5.5-10.5.12-MariaDB-log MariaDB Server

    Copyright (c) 2000, 2021, Oracle and/or its affiliates.

    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    mysql> use zabbix
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Database changed
    mysql>

    Below is my /var/lib/zabbix/.my.cnf file
    [client]
    user=zbx_monitor
    password=************

    Comment

    Working...