ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    need help with Zabbix server

    IT Discussion
    centos zabbix monitoring
    9
    62
    19.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Mike DavisM
      Mike Davis @scottalanmiller
      last edited by Mike Davis

      @scottalanmiller
      since I have 3 accounts, I tried:

      MariaDB [(none)]> drop user zabbix;
      Query OK, 0 rows affected (0.00 sec)

      MariaDB [(none)]> select user, host from mysql.user;
      +--------+--------------------+
      | user | host |
      +--------+--------------------+
      | root | 127.0.0.1 |
      | root | ::1 |
      | root | localhost |
      | zabbix | localhost |
      | zabbix | ​xx.xx.14.212​ |
      +--------+--------------------+
      5 rows in set (0.00 sec)

      MariaDB [(none)]> drop user zabbix@localhost;
      Query OK, 0 rows affected (0.00 sec)

      MariaDB [(none)]> select user, host from mysql.user;
      +--------+--------------------+
      | user | host |
      +--------+--------------------+
      | root | 127.0.0.1 |
      | root | ::1 |
      | root | localhost |
      | zabbix | xx.xx.14.212​ |
      +--------+--------------------+
      4 rows in set (0.00 sec)

      MariaDB [(none)]> drop user [email protected]​;
      ERROR 1396 (HY000): Operation DROP USER failed for 'zabbix'@'xx.xx.14.212​'
      MariaDB [(none)]> select user, host from mysql.user;
      +--------+--------------------+
      | user | host |
      +--------+--------------------+
      | root | 127.0.0.1 |
      | root | ::1 |
      | root | localhost |
      | zabbix | ​xx.xx.14.212​ |
      +--------+--------------------+
      4 rows in set (0.00 sec)

      MariaDB [(none)]> drop user 'zabbix'@'xx.xx.14.212​';
      ERROR 1396 (HY000): Operation DROP USER failed for 'zabbix'@'xx.xx.14.212​'

      Can't seem to delete the last one.

      1 Reply Last reply Reply Quote 0
      • DustinB3403D
        DustinB3403
        last edited by

        Here is a report (2007) of the syntax to be used to provide access to the database for a user.

        Mike DavisM 1 Reply Last reply Reply Quote 0
        • Mike DavisM
          Mike Davis @DustinB3403
          last edited by

          to delete the last account, it didn't like that I specified the host, even though it was listed. I did:
          delete from mysql.user where user='zabbix' ;

          and that took.

          now I just have the user zabbix@localhost

          I restarted services and in the log I'm getting:
          1141:20161020:154817.079 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
          1141:20161020:154817.086 database is down: reconnecting in 10 seconds
          1141:20161020:154827.330 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)

          travisdh1T scottalanmillerS 3 Replies Last reply Reply Quote 0
          • travisdh1T
            travisdh1 @Mike Davis
            last edited by

            @Mike-Davis Can you login to MariaDB with the username/password you're using for Zabbix?

            mysql -u zabbix -p
            
            1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @Mike Davis
              last edited by

              @Mike-Davis said in need help with Zabbix server:

              to delete the last account, it didn't like that I specified the host, even though it was listed. I did:
              delete from mysql.user where user='zabbix' ;

              and that took.

              now I just have the user zabbix@localhost

              I restarted services and in the log I'm getting:
              1141:20161020:154817.079 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
              1141:20161020:154817.086 database is down: reconnecting in 10 seconds
              1141:20161020:154827.330 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)

              And that's the only user that there should be.

              1 Reply Last reply Reply Quote 0
              • Mike DavisM
                Mike Davis
                last edited by scottalanmiller

                I can't log in with the user zabbix. Only as root.

                Just for kicks I looked at the zabbix_agentd.log
                I'm getting this error:

                  1132:20161020:154817.055 agent #3 started [listener #2]
                  1134:20161020:154817.056 active check configuration update from 127.0.0.1:10051 started to fail (cannot connect to 127.0.0.1:10051: 111 Connection refused)
                

                Is it possible I need to open 127.0.0.1 in the firewall?
                I do have this command:

                sudo firewall-cmd --permanent --zone=public --add-port=10051/tcp

                travisdh1T scottalanmillerS 3 Replies Last reply Reply Quote 0
                • travisdh1T
                  travisdh1 @Mike Davis
                  last edited by

                  @Mike-Davis If you can't login to the database using the credentials you created for the Zabbix user, then that will be one problem.

                  Firewall ports may or may not be another.

                  1 Reply Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller @Mike Davis
                    last edited by

                    @Mike-Davis said in need help with Zabbix server:

                    I can't log in with the user zabbix. Only as root.

                    Just for kicks I looked at the zabbix_agentd.log
                    I'm getting this error:

                      1132:20161020:154817.055 agent #3 started [listener #2]
                      1134:20161020:154817.056 active check configuration update from [127.0.0.1:10051] started to fail (cannot connect to 127.0.0.1]:10051]: [111] Connection refused)
                    

                    Is it possible I need to open 127.0.0.1 in the firewall?
                    I do have this command:

                    sudo firewall-cmd --permanent --zone=public --add-port=10051/tcp

                    No, there is no network or firewall involved here.

                    1 Reply Last reply Reply Quote 0
                    • scottalanmillerS
                      scottalanmiller @Mike Davis
                      last edited by

                      @Mike-Davis said in need help with Zabbix server:

                      sudo firewall-cmd --permanent --zone=public --add-port=10051/tcp

                      That's not even the right port. Why are you looking at 10051 when 3306 is the MySQL port?

                      Mike DavisM 1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller
                        last edited by

                        The issue is simple, you have a username / password mismatch. There is nothing more to it.

                        You know that the firewall can't be involved for three reasons...

                        • Root user works, so you've gotten past that point.
                        • The MySQL client does not use the network stack to connect in this way.
                        • Localhost / 127.0.0.1 never goes through the firewall.
                        1 Reply Last reply Reply Quote 1
                        • Mike DavisM
                          Mike Davis @scottalanmiller
                          last edited by

                          @scottalanmiller because the agent was getting connection refused and it's on 10051

                          scottalanmillerS 1 Reply Last reply Reply Quote 0
                          • Mike DavisM
                            Mike Davis
                            last edited by

                            OK, so it's definitely something about the zabbix user account. Switching the zabbix server to connect as root works. How bad is it to let it connect as root?

                            coliverC scottalanmillerS 2 Replies Last reply Reply Quote 0
                            • coliverC
                              coliver @Mike Davis
                              last edited by

                              @Mike-Davis said in need help with Zabbix server:

                              OK, so it's definitely something about the zabbix user account. Switching the zabbix server to connect as root works. How bad is it to let it connect as root?

                              Anything else running on that database? It isn't best practice but if you have a good backup then you probably won't have any issues.

                              1 Reply Last reply Reply Quote 1
                              • Mike DavisM
                                Mike Davis
                                last edited by

                                It's a dedicated server just for zabbix.

                                JaredBuschJ coliverC 2 Replies Last reply Reply Quote 0
                                • JaredBuschJ
                                  JaredBusch @Mike Davis
                                  last edited by

                                  @Mike-Davis said in need help with Zabbix server:

                                  It's a dedicated server just for zabbix.

                                  Did you follow my guide?

                                  Mike DavisM 1 Reply Last reply Reply Quote 0
                                  • coliverC
                                    coliver @Mike Davis
                                    last edited by

                                    @Mike-Davis said in need help with Zabbix server:

                                    It's a dedicated server just for zabbix.

                                    Won't be best practice or altogether safe but you can do it. I'm wondering why the Zabbix user doesn't work though that just seems odd.

                                    DustinB3403D 1 Reply Last reply Reply Quote 0
                                    • DustinB3403D
                                      DustinB3403 @coliver
                                      last edited by

                                      @coliver said in need help with Zabbix server:

                                      @Mike-Davis said in need help with Zabbix server:

                                      It's a dedicated server just for zabbix.

                                      Won't be best practice or altogether safe but you can do it. I'm wondering why the Zabbix user doesn't work though that just seems odd.

                                      Likely because the zabbix user password was fat fingered and is now stuck in a config file somewhere / isn't being overwritten.

                                      Mike DavisM 1 Reply Last reply Reply Quote 1
                                      • Mike DavisM
                                        Mike Davis @JaredBusch
                                        last edited by

                                        @JaredBusch said in need help with Zabbix server:

                                        @Mike-Davis said in need help with Zabbix server:

                                        It's a dedicated server just for zabbix.

                                        Did you follow my guide?

                                        no, but I wish I had known it was there last night....

                                        1 Reply Last reply Reply Quote 0
                                        • Mike DavisM
                                          Mike Davis @DustinB3403
                                          last edited by

                                          @DustinB3403 said in need help with Zabbix server:

                                          @coliver said in need help with Zabbix server:

                                          @Mike-Davis said in need help with Zabbix server:

                                          It's a dedicated server just for zabbix.

                                          Won't be best practice or altogether safe but you can do it. I'm wondering why the Zabbix user doesn't work though that just seems odd.

                                          Likely because the zabbix user password was fat fingered and is now stuck in a config file somewhere / isn't being overwritten.

                                          I created a really long password, so I was pasting it each time. I even used
                                          use mysql;
                                          update user set password=password('aweakpassword​') where user='zabbix';

                                          to change the password in SQL and then try to connect with that with no luck.

                                          1 Reply Last reply Reply Quote 0
                                          • scottalanmillerS
                                            scottalanmiller @Mike Davis
                                            last edited by

                                            @Mike-Davis said in need help with Zabbix server:

                                            @scottalanmiller because the agent was getting connection refused and it's on 10051

                                            I thought that you were working on the database. The agent doesn't talk to the database.

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 3 / 4
                                            • First post
                                              Last post