Ad Widget

Collapse

Lot of problems with Zabbix 3.4 installation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jonh123
    Junior Member
    • Jul 2018
    • 6

    #1

    Lot of problems with Zabbix 3.4 installation

    Hi,

    Today morning I try to install Zabix 3.4 in new clean CentOs 7 ( Upgraded ), but there are a lot of problems which I detect.

    I Was following the install instruction, but when i became to 2.) c part

    Code:
    # mysql -uroot -p
    Terminal showed me:


    Code:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    After this error message, I found some tips, where somebody counseled me, that I should install mysql-server again, because it looks like there was a problem during installation, so I did it and:

    Code:
    # mysql -uroot -p
    Enter password:
    ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using password: YES)
    I´m quite disappointed of this "Tutorial how to" cause I install software on new, clean and upgraded system according to your instructions, and yet there is a hill of trouble.

    Any advices ?

    Thanks,
  • DCox
    Junior Member
    • Jul 2018
    • 4

    #2
    I am having the exact same issue and had been trying to install yesterday. A reinstall of mysql-server didn't even allow me to get as far as you have and I am stuck with a new system that I can't even get SQL on.

    Comment

    • Jonh123
      Junior Member
      • Jul 2018
      • 6

      #3
      It´s pretty bad advertising for Zabbix when their own installation guide does not working right.

      Still any help for us ?

      Comment

      • Jonh123
        Junior Member
        • Jul 2018
        • 6

        #4
        I Also tried a lot of installation tutorials on internet or on Youtube, but still the same result. Still lagged on mysql.

        Comment

        • DCox
          Junior Member
          • Jul 2018
          • 4

          #5
          So I found that you have to seperately go into mysql and setup the root user and password. I am asking for further clarification about more of their instructions and what should be put in. So far this seems to assume you already have mysql installed and configured with a root password.

          Comment

          • bricka
            Junior Member
            • Jun 2018
            • 23

            #6
            I've tested several platforms: ubuntu, centos, redhat, debian. There is problems in all distributions.

            The easy'est way to launch zabbix I've found in debian. There you need only uninstall mariaDB and install mysql.

            Comment

            • DCox
              Junior Member
              • Jul 2018
              • 4

              #7
              I had contacted Zabbix on this and they eventually gave me a full list of commands to run and reasons why. I am going to post it here. There are a few places where there are long password strings, you will likely want to replace those with something custom. You may also want to start from scratch. This is for CentOS 7 and I have updated some information as what they had given me was not necessarily correct. About the only thing I can't be sure of is the setting of the Root password part as I had already set that.


              # Instruction for CentOS 7. Confortable set. No need to change any line!

              # make sure you are supper user
              sudo su

              # make sure the system is up to date
              yum -y update

              # Database is the heart of Zabbix. In order to install Zabbix server on the top of CentOS 7 some database server must be install. Let's install the most popular database engine - MariaDB (it is a fork of MySQL)
              yum -y install mariadb-server

              # Let's enable the databse server at startup
              systemctl enable mysqld

              # Start the database server right now
              systemctl start mysqld

              # Make sure the databse server is running
              systemctl status mysqld

              # Root password must be configured
              /usr/bin/mysqladmin -u root password '5sRj4GXspvDKsBXW'

              # Let's check if there is any other database in the front of us
              mysql -h localhost -uroot -p5sRj4GXspvDKsBXW -P 3306 -s <<< 'show databases;'

              # Create a new database with name 'zabbix'
              mysql -h localhost -uroot -p5sRj4GXspvDKsBXW -P 3306 -s <<< 'create database zabbix character set utf8 collate utf8_bin;'

              # Let's ensure the 'zabbix' database is there
              mysql -h localhost -uroot -p5sRj4GXspvDKsBXW -P 3306 -s <<< 'show databases;'

              # create new MySQL user 'zabbix' with password 'TaL2gPU5U9FcCU2u' and assign those to database 'zabbix'
              mysql -h localhost -uroot -p5sRj4GXspvDKsBXW -P 3306 -s <<< 'grant all privileges on zabbix.* to zabbix@localhost identified by "TaL2gPU5U9FcCU2u"'

              # The database is created but there is no tables inside. Let's look at
              mysql -h localhost -uroot -p5sRj4GXspvDKsBXW -P 3306 -s zabbix <<< 'show tables\G' | wc -l
              # It will report 0. There are no tables ! ! !

              # Install Zabbix repository
              rpm -ivh https://repo.zabbix.com/zabbix/3.4/r...el7.noarch.rpm

              # Install Zabbix back-end + the SQL inserts to create some basic structure
              yum -y install zabbix-server-mysql

              # The previous command just installed new user 'zabbix' and new group 'zabbix'. We can see it by running
              grep zabbix /etc/{passwd,group}

              # Let's observe if we have sql scripts (templates) installed from previous commands
              ls -l /usr/share/doc/zabbix-server-mysql*/

              # Let's create the table structure
              zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pTaL2gPU5U9FcCU2u zabbix

              # Observe the tables created
              mysql -h localhost -uroot -p5sRj4GXspvDKsBXW -P 3306 -s zabbix <<< 'show tables\G' | grep "Tables_in_zabbix"

              # The same 'zabbix' DB password must be configured in zabbix_server.conf.
              grep "DBPassword=" /etc/zabbix/zabbix_server.conf

              # Let's substitute non-existing passowrd with real one
              sed -i "s|^.*DBPassword=.*$|DBPassword=TaL2gPU5U9FcCU 2u|" /etc/zabbix/zabbix_server.conf

              # Let's check again if the password was changed
              grep "DBPassword=" /etc/zabbix/zabbix_server.conf

              # The custom settings about Zabbix server conf can be observed with
              grep -v "#\|^$" /etc/zabbix/zabbix_server.conf

              # By default SELinux on CentOS 7 are blocking some things related to preprocessing. This can be solved with
              yum install policycoreutils-python -y
              cd
              curl https://support.zabbix.com/secure/at..._server_add.te > zabbix_server_add.te
              checkmodule -M -m -o zabbix_server_add.mod zabbix_server_add.te
              semodule_package -m zabbix_server_add.mod -o zabbix_server_add.pp
              semodule -i zabbix_server_add.pp

              # Allow Zabbix server to receive data from active agent, active proxy, front-end
              firewall-cmd --add-port=10051/tcp --permanent
              firewall-cmd --reload
              firewall-cmd --list-all

              # Now we can start Zabbix server
              systemctl start zabbix-server

              # Let's check Zabbix log file if there is no errors or warnings
              cat /var/log/zabbix/zabbix_server.log

              # Enable zabbix server to launch at system startup
              systemctl enable zabbix-server


              # FRONT END INSTALL

              # Enable rhel-7-server-optional-rpms repository. This is neccessary to successfully install frontend
              yum install yum-utils -y

              # Enable RHEL optional repository
              yum-config-manager --enable rhel-7-server-optional-rpms

              # If CentOS server do not have any web server. Let's got with moust popular - httpd (aka Apache)
              yum install httpd -y

              # List current ports in firewall
              firewall-cmd --list-all

              # Allow to access the frontent from the outside world
              firewall-cmd --permanent --add-service=http
              firewall-cmd --reload
              firewall-cmd --list-all

              # install httpd configuration for Zabbix
              yum install zabbix-web-mysql -y

              # set timezone
              sed -i "s/^.*php_value date.timezone .*$/php_value date.timezone America\/Havana/" /etc/httpd/conf.d/zabbix.conf

              # Allow httpd daemon to work with Zabbix backend
              setsebool -P httpd_can_network_connect on
              setsebool -P zabbix_can_network on

              # Restart Web Server
              systemctl restart httpd

              # Allow webserver to launch at system startup
              systemctl enable httpd

              # Now we can go to http://ip.address.goes.here/zabbix

              Comment

              Working...