Ad Widget

Collapse

New install issues

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jsmith
    Junior Member
    • Jun 2023
    • 8

    #1

    New install issues

    Hi,

    I'm running through an install for the first time and am stuck at here. https://www.zabbix.com/download?zabb...debian&os_vers ion=12&components=server_frontend_agent&db=mysql&w s=apache

    step 2c gives me ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)

    Code:
    # mysql -uroot -p
    password​

    I have almost no experience with database servers at all. I can follow instructions and google errors, but I lack the understanding to know the context. What password is being asked for, the OS root? It's a new VM built for this project, there is no previous history to it.

    Thanks in advance
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Have you installed a MySQL server?
    Instructions for installing MySQL server are not provided on the download page, as there are options for installing on the same server, starting on a different server, using something like RDS on AWS. If you can install it on the same server, I think you can install it with the following command.

    Code:
    # apt install mysql-server

    Comment

    • jsmith
      Junior Member
      • Jun 2023
      • 8

      #3
      Thank you for the suggestion. I haven't done anything that wasn't in the instructions. I looked back after you prompted me to check and see this. So zabbix-server-mysql isn't the DB server? should I use mysql-server or virtual-mysql-server

      Code:
      apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agentapt
      
      ...
      
      
      Suggested packages:
        zabbix-nginx-conf virtual-mysql-server
      
      ​

      Comment

      • jsmith
        Junior Member
        • Jun 2023
        • 8

        #4
        I installed the recommended packages in the meantime. It's a fresh VM I can reset and start over any time. That step now leads to..

        Code:
        root@zabbix:/home/user# mysql -uroot -p
        Enter password:
        Welcome to the MariaDB monitor.  Commands end with ; or \g.
        Your MariaDB connection id is 31
        Server version: 10.11.3-MariaDB-1 Debian 12
        
        Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
        
        Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
        
        MariaDB [(none)]>
        
        ​

        MariaDB isn't one of the DB servers listed at the top of that page for installation So I'm guessing I need to install mysql-server. But I will need a complete guide to get this running, I have no experience with DB servers this guide seems to assume. I'll look further into this and post back if I get stuck, thanks for your help.

        Comment

        • MM347
          Junior Member
          • Jun 2023
          • 8

          #5
          Debian uses MariaDB not MySQL, it's not an issue. They're almost identical. I've just been through that install and it's documented terribly. I have a docker image that installs the bare minimum required to work, though I use an external database.

          This may help you, I'm using Debian 11 but it shouldn't be any different to 12. If it's already installed don't worry, it will skip it:
          Code:
          apt-get install --no-install-recommends --allow-downgrades --allow-remove-essential --allow-change-held-packages -y
              apt-utils nano wget software-properties-common ca-certificates mariadb-client
              libapache2-mod-php libfreetype6-dev libgd3 libjpeg62-turbo-dev libldap2-dev libpng-dev libxslt1.1 php php-bcmath php-gd php-ldap
              php-mbstring php-mysql php-xml php7.4 php7.4-bcmath php7.4-gd php7.4-ldap
              php7.4-mbstring php7.4-mysql php7.4-xml ssl-cert zlib1g-dev
          && service apache2 restart​
          Then start the install process on that page.

          As a side note, I use PHP 8.2 but for some reason the 7.4 packages are still required.
          Last edited by MM347; 29-06-2023, 10:57.

          Comment

          • jsmith
            Junior Member
            • Jun 2023
            • 8

            #6
            Thank you, I really appreciate that. I got further in the meantime following this - https://bestmonitoringtools.com/how-...tend_and_agent

            Now I'm missing the step 4a from that guide, there's nothing to uncomment and it mentions two lines. I've added php_value date.timezone Europe/London to /etc/zabbix/apache.conf

            I get part way through the web setup where I get

            Code:
            Cannot connect to the database.[LIST][*]Locale for language "en_US" is not found on the web server. Tried to set: en_US, en_US.utf8, en_US.UTF-8, en_US.iso885915, en_US.ISO8859-1, en_US.ISO8859-2, en_US.ISO8859-4, en_US.ISO8859-5, en_US.ISO8859-15, en_US.ISO8859-13, en_US.CP1131, en_US.CP1251, en_US.CP1251, en_US.CP949, en_US.KOI8-U, en_US.US-ASCII, en_US.eucKR, en_US.eucJP, en_US.SJIS, en_US.GB18030, en_US.GB2312, en_US.GBK, en_US.eucCN, en_US.Big5HKSCS, en_US.Big5, en_US.armscii8, en_US.cp1251, en_US.eucjp, en_US.euckr, en_US.euctw, en_US.gb18030, en_US.gbk, en_US.koi8r, en_US.tcvn. Unable to translate Zabbix interface.[/LIST]
            ​
            So it's not just me then? The documentation is incomplete or not up to date? Feels like another project where I'm going to follow half a dozen guides each with one crucial bit missing and patch something together jankily.

            Comment

            • MM347
              Junior Member
              • Jun 2023
              • 8

              #7
              No whoever wrote the documentation totally winged it rather than trying it.

              Code:
              apt-get install -y locales && echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen && service apache2 restart

              Comment

              • jsmith
                Junior Member
                • Jun 2023
                • 8

                #8
                Thanks again! Is that required as is or can I substitute en_GB for England, London timezone? Debian was installed with GB location.

                Comment

                • MM347
                  Junior Member
                  • Jun 2023
                  • 8

                  #9
                  Sorry yeah I actually changed it from GB to US for you based off your error but yeah change it back and make sure Apache/Zabbix are using GB.

                  Edit: Tbh it looks like you want both. Run the echo section twice, once as US once as GB, then run locale-gen.
                  Last edited by MM347; 29-06-2023, 15:11.

                  Comment

                  • jsmith
                    Junior Member
                    • Jun 2023
                    • 8

                    #10
                    Hmm. Further, with US and GB, but now getting Cannot connect to the database. I'll revert back to earlier snapshots and make sure I'm not missing steps from the VM's perception of history. Thanks again for your help.

                    Just to note for anyone following this later, I've hit the issue with modern debians removing paths from the su elevated environment so commands like service and even shutdown won't work without adding /sbin/ before them. I thought steps from the previous tip weren't working but they do, eg

                    Code:
                    /sbin/locale-gen
                    
                    /sbin/service apache2 restart

                    Comment

                    • jsmith
                      Junior Member
                      • Jun 2023
                      • 8

                      #11
                      Still not been able to get further on this. I've looked around other people describing similar issues and checked things like can I connect to the database directly. Am still completely new to this side of things. Is the following sufficient to say that services are running/not being blocked/db exists?


                      Code:
                      mariadb  -u zabbix -pmypassword zabbix
                      
                      MariaDB [zabbix]> \r
                      Connection id:    987
                      Current database: zabbix
                      ​

                      Comment

                      • MM347
                        Junior Member
                        • Jun 2023
                        • 8

                        #12
                        Honestly not too sure, I use an external DB. I can only suggest you check the zabbix_server.conf to make sure you're using localhost if your DB is local.

                        Comment

                        • jsmith
                          Junior Member
                          • Jun 2023
                          • 8

                          #13
                          Please forgive me for I am an IDIOT. Of all the things to get wrong it was a mixture of misunderstanding the password being asked for in the initial setup, plus not allowing the site in No Script adblocker so the real error wasn't being displayed. I'm very grateful for your help. I'm past the setup and in the admin page now.

                          Comment

                          • ahamilton.a
                            Junior Member
                            • Sep 2023
                            • 3

                            #14
                            I am having a similar issue. Just re-deployed my Zabbix server. I think I got everything mostly up. Except when I login I get these messages. Not sure where to go with this?
                            • Locale for language "en_US" is not found on the web server. Tried to set: en_US, en_US.utf8, en_US.UTF-8, en_US.iso885915, en_US.ISO8859-1, en_US.ISO8859-2, en_US.ISO8859-4, en_US.ISO8859-5, en_US.ISO8859-15, en_US.ISO8859-13, en_US.CP1131, en_US.CP1251, en_US.CP1251, en_US.CP949, en_US.KOI8-U, en_US.US-ASCII, en_US.eucKR, en_US.eucJP, en_US.SJIS, en_US.GB18030, en_US.GB2312, en_US.GBK, en_US.eucCN, en_US.Big5HKSCS, en_US.Big5, en_US.armscii8, en_US.cp1251, en_US.eucjp, en_US.euckr, en_US.euctw, en_US.gb18030, en_US.gbk, en_US.koi8r, en_US.tcvn. Unable to translate Zabbix interface.

                            Comment

                            • ahamilton.a
                              Junior Member
                              • Sep 2023
                              • 3

                              #15
                              Click image for larger version

Name:	image.png
Views:	3760
Size:	664.5 KB
ID:	474039This is what I have​

                              Comment

                              Working...