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.
    • dafyreD
      dafyre @Mike Davis
      last edited by

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

      when I run:
      sudo getenforce
      it returns:
      Disabled

      Do I need to enable it so those rules apply?

      The guide I was following said to run these commands:
      sudo setsebool -P httpd_can_network_connect=1
      sudo setsebool -P httpd_can_connect_zabbix=1
      sudo setsebool -P zabbix_can_network=1

      If SELinux id disabled, then those commands won't have any affect until you enable it again.

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

        database on the same server. If I log in to the database, and run:
        select user, host from mysql.user;
        it returns:
        MariaDB [(none)]> select user, host from mysql.user;
        +--------+--------------------+
        | user | host |
        +--------+--------------------+
        | zabbix | % |
        | root | 127.0.0.1 |
        | root | ::1 |
        | root | localhost |
        | zabbix | localhost |
        | zabbix | ​xx.xx.14.212​ |
        +--------+--------------------+
        6 rows in set (0.00 sec)

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

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

          database on the same server. If I log in to the database, and run:
          select user, host from mysql.user;
          it returns:
          MariaDB [(none)]> select user, host from mysql.user;
          +--------+--------------------+
          | user | host |
          +--------+--------------------+
          | zabbix | % |
          | root | 127.0.0.1 |
          | root | ::1 |
          | root | localhost |
          | zabbix | localhost |
          | zabbix | ​xx.xx.14.212​ |
          +--------+--------------------+
          6 rows in set (0.00 sec)

          The user may exist but it may not have the granted permissions. You can run:

          SHOW GRANTS FOR 'zabbix'@'xx.xx.14.212';
          

          To see what that user has access to.

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

            I think we have a bingo.

            ERROR 1141 (42000): There is no such grant defined for user 'zabbix' on host 'xx.xx.14.212​'

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

              Shouldn't this work:

              GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@​xx.xx.14.212 IDENTIFIED BY 'mySecurePasswordHere​';

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

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

                Shouldn't this work:

                GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@​xx.xx.14.212 IDENTIFIED BY 'mySecurePasswordHere​';

                If the user already exists drop the IDENTIFIED BY part. But yes the syntax should work. Don't forget the single quotes around the username and IP address.

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

                  When I run it, I get:
                  Query OK, 0 rows affected (0.00 sec)

                  MariaDB [(none)]> show grants for [email protected]​; ERROR 1141 (42000): There is no such grant defined for user 'zabbix' on host 'xx.xx.14.212​'

                  Do the single quotes matter when running these commands?

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

                    MariaDB [(none)]> show grants for [email protected]​;
                    ERROR 1141 (42000): There is no such grant defined for user 'zabbix' on host 'xx.xx.14.212​'
                    MariaDB [(none)]> show grants for zabbix
                    -> ;
                    +-------------------------------------------------------------------------------------------------------+
                    | Grants for zabbix@% |
                    +-------------------------------------------------------------------------------------------------------+
                    | GRANT USAGE ON . TO 'zabbix'@'%' IDENTIFIED BY PASSWORD 'F7B59hashhereC9667D7D09DC' |
                    | GRANT ALL PRIVILEGES ON zabbix.
                    TO 'zabbix'@'%' |
                    +-------------------------------------------------------------------------------------------------------+
                    2 rows in set (0.00 sec)

                    Do I have too many zabbix users configured? Should I just have the one with the external host IP?

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

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

                      MariaDB [(none)]> show grants for [email protected]​;
                      ERROR 1141 (42000): There is no such grant defined for user 'zabbix' on host 'xx.xx.14.212​'
                      MariaDB [(none)]> show grants for zabbix
                      -> ;
                      +-------------------------------------------------------------------------------------------------------+
                      | Grants for zabbix@% |
                      +-------------------------------------------------------------------------------------------------------+
                      | GRANT USAGE ON . TO 'zabbix'@'%' IDENTIFIED BY PASSWORD 'F7B59hashhereC9667D7D09DC' |
                      | GRANT ALL PRIVILEGES ON zabbix.
                      TO 'zabbix'@'%' |
                      +-------------------------------------------------------------------------------------------------------+
                      2 rows in set (0.00 sec)

                      Do I have too many zabbix users configured? Should I just have the one with the external host IP?

                      I'm not sure, I don't think so I thought '%' was equivalent to local host.

                      travisdh1T Mike DavisM 2 Replies Last reply Reply Quote 0
                      • travisdh1T
                        travisdh1 @coliver
                        last edited by

                        @coliver said in need help with Zabbix server:

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

                        MariaDB [(none)]> show grants for [email protected]​;
                        ERROR 1141 (42000): There is no such grant defined for user 'zabbix' on host 'xx.xx.14.212​'
                        MariaDB [(none)]> show grants for zabbix
                        -> ;
                        +-------------------------------------------------------------------------------------------------------+
                        | Grants for zabbix@% |
                        +-------------------------------------------------------------------------------------------------------+
                        | GRANT USAGE ON . TO 'zabbix'@'%' IDENTIFIED BY PASSWORD 'F7B59hashhereC9667D7D09DC' |
                        | GRANT ALL PRIVILEGES ON zabbix.
                        TO 'zabbix'@'%' |
                        +-------------------------------------------------------------------------------------------------------+
                        2 rows in set (0.00 sec)

                        Do I have too many zabbix users configured? Should I just have the one with the external host IP?

                        I'm not sure, I don't think so I thought '%' was equivalent to local host.

                        % is everything, like * would be in other places.

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

                          @coliver I think % is the wildcard from what I read. Not good practice, but I was trying to get it working.

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

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

                            @coliver I think % is the wildcard from what I read. Not good practice, but I was trying to get it working.

                            Ah, that makes sense. So that should work.

                            1 Reply Last reply Reply Quote 0
                            • dafyreD
                              dafyre
                              last edited by

                              You can also attempt to log in from the CLI from the Zabbix server...

                              mysql -u zabbix -p -h ip.add.14.212
                              

                              And see if it lets you connect.

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

                                sudo mysql -u zabbix -p -h xx.xx.14.212​
                                Enter password:
                                ERROR 2005 (HY000): Unknown MySQL server host 'xx.xx.14.212​' (0)

                                DustinB3403D dafyreD 2 Replies Last reply Reply Quote 0
                                • DustinB3403D
                                  DustinB3403 @Mike Davis
                                  last edited by DustinB3403

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

                                  sudo mysql -u zabbix -p -h xx.xx.14.212​
                                  Enter password:
                                  ERROR 2005 (HY000): Unknown MySQL server host 'xx.xx.14.212​' (0)

                                  Enter in your servers' IP address not the literal "xx.xx.14.212"

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

                                    I did enter the real IP address.

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

                                      Did you fill in the user password?

                                      1 Reply Last reply Reply Quote 0
                                      • coliverC
                                        coliver
                                        last edited by

                                        I wonder if Firewalld is blocking this. Zabbix should really be using 'zabbix'@'localhost' instead of the IP address.

                                        1 Reply Last reply Reply Quote 0
                                        • dafyreD
                                          dafyre @Mike Davis
                                          last edited by

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

                                          sudo mysql -u zabbix -p -h xx.xx.14.212​
                                          Enter password:
                                          ERROR 2005 (HY000): Unknown MySQL server host 'xx.xx.14.212​' (0)

                                          I'm assuming that this mysql server is not on the same server as Zabbix?

                                          So check your firewall, and check /etc/mysql/my.cnf and make sure that it's set to listen on the IP address and not 127.0.0.1.

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

                                            I just tested this on my zabbix system and got

                                            0_1476976272132_XenCenterMain_2016-10-20_11-10-46.png

                                            He received 2005

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