Ad Widget

Collapse

Failed to start Zabbix Server for 1st time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dcordoba_ISG
    Junior Member
    • Nov 2019
    • 4

    #1

    Failed to start Zabbix Server for 1st time

    Hey People!

    Background: My linux is rusty and 1rst time using/installing Zabbix. I need to monitor several devices on a project and was surprised with everything can be done with this software, therefore I wanted to give it a try.

    System: VM using CentOS 8, trying to. instal Zabbix 4.4 with MySQL

    I manage to:
    * Install and configure mariaDB including scheme
    * Installed zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-agent

    I modified the .config file to add the database password

    When I tried to start de server by using command [root@localhost ~]# systemctll start zabbix-server
    ## I got :

    Job for zabbix-server.service failed because the control process exited with error code.
    See "systemctl status zabbix-server.service" and "journalctl -xe" for details.

    ## Checked the server status:
    [root@localhost ~]# systemctl status zabbix-server.service
    ● zabbix-server.service - Zabbix Server
    Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
    Active: activating (auto-restart) (Result: exit-code) since Wed 2019-11-06 01:30:48 EST; 9s ago
    Process: 10519 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=1/FAILURE)

    Nov 06 01:30:48 localhost.localdomain systemd[1]: zabbix-server.service: Control process exited, code=exited status=1
    Nov 06 01:30:48 localhost.localdomain systemd[1]: zabbix-server.service: Failed with result 'exit-code'.
    Nov 06 01:30:48 localhost.localdomain systemd[1]: Failed to start Zabbix Server.

    ## I tried to check the log

    [root@localhost ~]# less /var/log/zabbix/zabbix_server.log
    /var/log/zabbix/zabbix_server.log: No such file or directory
    [root@localhost ~]#

    Any advice on how to solve this problem. Thanks in advance!

  • valentins.grins
    Member
    • Nov 2019
    • 38

    #2
    As suggested can you please try command "journalctl -xe" and share output with us. It may give some additional information why service don't start.

    Additionally can you please share your zabbix-server.config file here to check if everything is OK.

    Comment


    • dcordoba_ISG
      dcordoba_ISG commented
      Editing a comment
      Thank you to point me in the right direction!!
  • dcordoba_ISG
    Junior Member
    • Nov 2019
    • 4

    #3
    [root@localhost ~]# journalctl -xe
    -- Unit zabbix-server.service has begun starting up.
    Nov 06 14:18:25 localhost.localdomain zabbix_server[4674]: zabbix_server [4674]: Cannot initialize IPC services: Cannot access path "/var/rer [4674]: Cannot initialize IPC services: Cannot access path "/var/run/zabbix": [13] Permission denied.
    Nov 06 14:18:25 localhost.localdomain systemd[1]: zabbix-server.service: Control process exited, code=exited status=1
    Nov 06 14:18:25 localhost.localdomain systemd[1]: zabbix-server.service: Failed with result 'exit-code'.
    Nov 06 14:18:25 localhost.localdomain systemd[1]: Failed to start Zabbix Server.
    -- Subject: Unit zabbix-server.service has failed
    -- Defined-By: systemd
    -- Support: https://access.redhat.com/support
    --
    -- Unit zabbix-server.service has failed.
    --
    -- The result is RESULT.
    Nov 06 14:18:25 localhost.localdomain setroubleshoot[4650]: SELinux is preventing /usr/sbin/zabbix_server_mysql from using the dac_override capability. For complete SELinux messages run: sealert -l 6d2a4401-602d-40d4-b5db-1dbd2b5e4191
    Nov 06 14:18:25 localhost.localdomain platform-python[4650]: SELinux is preventing /usr/sbin/zabbix_server_mysql from using the dac_override capability.

    ***** Plugin dac_override (91.4 confidence) suggests **********************

    If you want to help identify if domain needs this access or you have a file with the wrong permissions on your system
    Then turn on full auditing to get path information about the offending file and generate the error again.
    Do

    Turn on full auditing
    # auditctl -w /etc/shadow -p w
    Try to recreate AVC. Then execute
    # ausearch -m avc -ts recent
    If you see PATH record check ownership/permissions on file, and fix it,
    otherwise report as a bugzilla.

    ***** Plugin catchall (9.59 confidence) suggests **************************

    If you believe that zabbix_server_mysql should have the dac_override capability by default.
    Then you should report this as a bug.
    You can generate a local policy module to allow this access.
    Do
    allow this access for now by executing:
    # ausearch -c 'zabbix_server' --raw | audit2allow -M my-zabbixserver
    # semodule -X 300 -i my-zabbixserver.pp


    ************************************************** ************​​​​​​​********************​​​​​​​**** ****************​​​​​​​********************​​​​​​​ ********************​​​​​​​********************​​​ ​​​​********************​​​​​​​******************* *​​​​​​​********************
    ## I executed the recommendation by ** Plugin catchall (9.59 confidence) ****

    root@localhost ~]# ausearch -c 'zabbix_server' --raw | audit2allow -M my-zabbixserver
    ******************** IMPORTANT ***********************
    To make this policy package active, execute:

    semodule -i my-zabbixserver.pp

    [root@localhost ~]# semodule -i my-zabbixserver.pp
    libsemanage.semanage_direct_install_info: Overriding my-zabbixserver module at lower priority 300 with module at priority 400.

    ​​​​​​​**********************​​​​​​​************** ******​​​​​​​********************​​​​​​​********** **********​​​​​​​********************​​​​​​​****** **************​​​​​​​********************​​​​​​​** ******************​​​​​​​********************​​​​​ ​​********************​​​​​​​********************
    ## After executing the recommendation by ** Plugin catchall (9.59 confidence) ****

    [root@localhost ~]# systemctl restart zabbix-server.service
    [root@localhost ~]# systemctl status zabbix-server.service
    ● zabbix-server.service - Zabbix Server
    Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
    Active: activating (auto-restart) (Result: exit-code) since Wed 2019-11-06 14:52:19 EST; 4s ago
    Process: 15844 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=1/FAILURE)
    Process: 15803 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
    Main PID: 15805 (code=exited, status=0/SUCCESS)

    Nov 06 14:52:19 localhost.localdomain systemd[1]: zabbix-server.service: Control process exited, code=exited status=1
    Nov 06 14:52:19 localhost.localdomain systemd[1]: zabbix-server.service: Failed with result 'exit-code'.

    Last edited by dcordoba_ISG; 06-11-2019, 22:02.

    Comment

    • dcordoba_ISG
      Junior Member
      • Nov 2019
      • 4

      #4
      ************************************ ******​​​​​​​********************​​​​​​​********** **********​​​​​​​********************​​​​​​​****** **************​​​​​​​********************​​​​​​​** ******************​​​​​​​********************​​​​​ ​​********************​​​​​​​********************
      ##checked. the status again

      [root@localhost ~]# systemctl status zabbix-server.service
      ● zabbix-server.service - Zabbix Server
      Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
      Active: activating (auto-restart) (Result: exit-code) since Wed 2019-11-06 15:08:16 EST; 718ms ago
      Process: 20685 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=1/FAILURE)
      Process: 20644 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
      Main PID: 20646 (code=exited, status=0/SUCCESS)

      Nov 06 15:08:16 localhost.localdomain systemd[1]: zabbix-server.service: Control process exited, code=exited status=1
      Nov 06 15:08:16 localhost.localdomain systemd[1]: zabbix-server.service: Failed with result 'exit-code'.

      ​​​​​​​## I see this error: " ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=1/FAILURE) " was fixed
      ## ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)

      ## But now this one has appear " ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=1/FAILURE)"

      ​​​​​​​**********************​​​​​​​************** ******​​​​​​​********************​​​​​​​********** **********​​​​​​​********************​​​​​​​****** **************​​​​​​​********************​​​​​​​** ******************​​​​​​​********************​​​​​ ​​********************​​​​​​​********************
      ## Now I see the log file was created I went to read it using:

      [root@localhost ~]# less /var/log/zabbix/zabbix_server.log

      ## Is a long file with several thousands lines. Call my attention this error keep happening each 3 minutes

      19202:20191106:150319.050 cannot start preprocessing service: Cannot bind socket to "/var/run/zabbix/zabbix_server_preprocessing.sock": [98] Address already in use.
      Last edited by dcordoba_ISG; 06-11-2019, 23:18.

      Comment

      • dcordoba_ISG
        Junior Member
        • Nov 2019
        • 4

        #5
        Originally posted by dcordoba_ISG
        ## Now I see the log file was created I went to read it using:

        [root@localhost ~]# less /var/log/zabbix/zabbix_server.log

        ## Is a long file with several thousands lines. Call my attention this error keep happening each 3 minutes

        19202:20191106:150319.050 cannot start preprocessing service: Cannot bind socket to "/var/run/zabbix/zabbix_server_preprocessing.sock": [98] Address already in use.
        ## I fixed this by doing

        [root@localhost ~]# grep AVC /var/log/audit/audit.log* | audit2allow -M systemd-allow

        ##Wait for the process to finished

        [root@localhost ~]# semodule -i systemd-allow.pp

        ##Wait it take some time ( almost 1 minute)

        ************************************ ******​​​​​​​********************​​​​​​​********** **********​​​​​​​********************​​​​​​​****** **************​​​​​​​************
        ## Then I restarted the process and finally the service started without errors!!!!!!!!!!

        [root@localhost ~]# systemctl restart zabbix-server.service
        [root@localhost ~]# systemctl status zabbix-server.service
        ● zabbix-server.service - Zabbix Server
        Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
        Active: active (running) since Wed 2019-11-06 15:31:14 EST; 4s ago
        Process: 25286 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
        Process: 25289 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
        Main PID: 25291 (zabbix_server)
        Tasks: 38 (limit: 11372)
        Memory: 41.0M
        CGroup: /system.slice/zabbix-server.service
        25291 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
        ├─25298 /usr/sbin/zabbix_server: configuration syncer [waiting 60 sec for processes]
        ├─25299 /usr/sbin/zabbix_server: housekeeper [startup idle for 30 minutes]
        ├─25300 /usr/sbin/zabbix_server: timer #1 [updated 0 hosts, suppressed 0 events in 0.000511 sec, idle 45 sec]
        ├─25301 /usr/sbin/zabbix_server: http poller #1 [got 0 values in 0.000295 sec, idle 5 sec]
        ├─25302 /usr/sbin/zabbix_server: discoverer #1 [processed 0 rules in 0.000515 sec, idle 60 sec]
        ├─25303 /usr/sbin/zabbix_server: history syncer #1 [processed 0 values, 0 triggers in 0.000058 sec, idle 1 sec]
        ├─25304 /usr/sbin/zabbix_server: history syncer #2 [processed 0 values, 0 triggers in 0.000107 sec, idle 1 sec]
        ├─25305 /usr/sbin/zabbix_server: history syncer #3 [processed 1 values, 1 triggers in 0.002444 sec, idle 1 sec]
        ├─25306 /usr/sbin/zabbix_server: history syncer #4 [processed 0 values, 0 triggers in 0.000082 sec, idle 1 sec]
        ├─25307 /usr/sbin/zabbix_server: escalator #1 [processed 0 escalations in 0.001279 sec, idle 3 sec]
        ├─25308 /usr/sbin/zabbix_server: proxy poller #1 [exchanged data with 0 proxies in 0.000068 sec, idle 5 sec]
        ├─25309 /usr/sbin/zabbix_server: self-monitoring [processed data in 0.000052 sec, idle 1 sec]
        ├─25310 /usr/sbin/zabbix_server: task manager [processed 0 task(s) in 0.002776 sec, idle 5 sec]
        ├─25311 /usr/sbin/zabbix_server: poller #1 [got 1 values in 0.001229 sec, idle 1 sec]
        ├─25312 /usr/sbin/zabbix_server: poller #2 [got 0 values in 0.000041 sec, idle 1 sec]
        ├─25313 /usr/sbin/zabbix_server: poller #3 [got 0 values in 0.000025 sec, idle 1 sec]
        ├─25314 /usr/sbin/zabbix_server: poller #4 [got 0 values in 0.000075 sec, idle 1 sec]
        ├─25315 /usr/sbin/zabbix_server: poller #5 [got 0 values in 0.000038 sec, idle 1 sec]
        ├─25316 /usr/sbin/zabbix_server: unreachable poller #1 [got 0 values in 0.000067 sec, idle 5 sec]
        ├─25317 /usr/sbin/zabbix_server: trapper #1 [processed data in 0.000000 sec, waiting for connection]
        ├─25318 /usr/sbin/zabbix_server: trapper #2 [processed data in 0.000000 sec, waiting for connection]
        ├─25319 /usr/sbin/zabbix_server: trapper #3 [processed data in 0.000000 sec, waiting for connection]
        ├─25320 /usr/sbin/zabbix_server: trapper #4 [processed data in 0.000000 sec, waiting for connection]
        ├─25321 /usr/sbin/zabbix_server: trapper #5 [processed data in 0.000000 sec, waiting for connection]
        ├─25322 /usr/sbin/zabbix_server: icmp pinger #1 [got 0 values in 0.000104 sec, idle 5 sec]
        ├─25323 /usr/sbin/zabbix_server: alert manager #1 started
        ├─25324 /usr/sbin/zabbix_server: alerter #1 started
        ├─25325 /usr/sbin/zabbix_server: alerter #2 started
        ├─25326 /usr/sbin/zabbix_server: alerter #3 started
        ├─25327 /usr/sbin/zabbix_server: preprocessing manager #1 started
        ├─25328 /usr/sbin/zabbix_server: preprocessing worker #1 started
        ├─25329 /usr/sbin/zabbix_server: preprocessing worker #2 started
        ├─25330 /usr/sbin/zabbix_server: preprocessing worker #3 started
        ├─25331 /usr/sbin/zabbix_server: lld manager #1 started
        ├─25332 /usr/sbin/zabbix_server: lld worker #1 started
        ├─25333 /usr/sbin/zabbix_server: lld worker #2 started
        └─25334 /usr/sbin/zabbix_server: alert syncer [queued 0 alerts(s), flushed 0 result(s) in 0.001259 sec, idle 1 sec]

        Nov 06 15:31:14 localhost.localdomain systemd[1]: Starting Zabbix Server...
        Nov 06 15:31:14 localhost.localdomain systemd[1]: Started Zabbix Server.


        ​​​​​​​##If it doesn't work, reboot your server it will work after rebooting





        Last edited by dcordoba_ISG; 06-11-2019, 23:25.

        Comment

        • E_Derksen_AC
          Junior Member
          • Jul 2020
          • 1

          #6
          i had (nearly) the same issue with:
          System: VM using CentOS 8, trying to install Zabbix 5.0.1 with MySQL

          Versions:
          centos-release-8.2-2.2004.0.1.el8.x86_64
          zabbix_server (Zabbix) 5.0.1
          Revision c2a0b03480 25 May 2020, compilation time: May 28 2020 12:11:01
          mysql Ver 8.0.17 for Linux on x86_64 (Source distribution)

          What happend was that after installation:
          -Zabbix server wasn't running
          -Status error was: ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=1/FAILURE)
          -There was no log-file of the Zabbix-server

          I did the same what you have done:

          # ausearch -c 'zabbix_server' --raw | audit2allow -M my-zabbixserver
          # semodule -X 300 -i my-zabbixserver.pp
          ....
          # ausearch -c 'zabbix_server' --raw | audit2allow -M my-zabbixserver
          # semodule -i my-zabbixserver.pp
          ....
          # systemctl restart zabbix-server.service
          # systemctl status zabbix-server.service
          ....

          And now the Zabbix-server was running.

          Your post was a great help, thanks!!!!

          Comment

          • Rohitmahajan701
            Junior Member
            • Apr 2023
            • 7

            #7
            Do i need to run this command " ausearch -c 'zabbix_server' --raw | audit2allow -M my-zabbixserver" as it is ? or my-zabbixserver should be replaced by something.. If i run the coomand as it is i get : You must specify the -p option with the path to the policy file.

            Comment

            Working...