Ad Widget

Collapse

Cent 7 после yum update не работает веб интерфейс

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ToxaAdmin
    Junior Member
    • Jul 2022
    • 12

    #1

    Cent 7 после yum update не работает веб интерфейс

    Cent 7, обновил пакеты yum update, ребут, и всё. Куда смотреть ?
    systemctl status zabbix-server https://pastebin.com/w8caqR11

    zabbix_server (Zabbix) 4.0.42
    Revision f5370d9acb1 28 June 2022, compilation time: Jun 28 2022 10:20:38

    php -v
    PHP 7.1.33 (cli) (built: Jun 7 2022 13:06:17) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

    в браузере по ip адресу сервера http://10.40.109.211/ получаю Welcome to nginx!

    а по адресу http://10.40.109.211/zabbix 404
  • vladimir_lv
    Senior Member
    • May 2022
    • 240

    #2
    Есть ли фолдер /usr/share/zabbix/ ? Не пусто ли он? Что прописано в настройках nginx?

    Comment

    • ToxaAdmin
      Junior Member
      • Jul 2022
      • 12

      #3
      Originally posted by vladimir_lv
      Есть ли фолдер /usr/share/zabbix/ ? Не пусто ли он? Что прописано в настройках nginx?
      фолдер заббикс
      actionconf.php adm.triggerdisplayoptions.php audio chart6.php disc_prototypes.php host_prototypes.php index_http.php locale report4.php setup.php tr_events.php
      adm.gui.php adm.triggerseverities.php auditacts.php chart7.php favicon.ico host_screen.php index.php maintenance.php robots.txt slideconf.php trigger_prototypes.php
      adm.housekeeper.php adm.valuemapping.php auditlogs.php chart.php graphs.php hosts.php items.php map.import.php screenconf.php slides.php triggers.php
      adm.iconmapping.php adm.workingtime.php browserwarning.php charts.php history.php httpconf.php js map.php screenedit.php srv_status.php usergrps.php
      adm.images.php api_jsonrpc.php chart2.php conf host_discovery.php httpdetails.php jsLoader.php overview.php screen.import.php sysmap.php users.php
      adm.macros.php app chart3.php conf.import.php hostgroups.php image.php jsrpc.php profile.php screens.php sysmaps.php zabbix.php
      adm.other.php applications.php chart4.php correlation.php hostinventoriesoverview.php imgstore.php latest.php queue.php search.php templates.php
      adm.regexps.php assets chart5.php discoveryconf.php hostinventories.php include local report2.php services.php toptriggers.php

      Конфиг nginx

      user nginx;
      worker_processes auto;

      error_log /var/log/nginx/error.log notice;
      pid /var/run/nginx.pid;


      events {
      worker_connections 1024;
      }


      http {
      include /etc/nginx/mime.types;
      default_type application/octet-stream;

      log_format main '$remote_addr - $remote_user [$time_local] "$request" '
      '$status $body_bytes_sent "$http_referer" '
      '"$http_user_agent" "$http_x_forwarded_for"';

      access_log /var/log/nginx/access.log main;

      sendfile on;
      #tcp_nopush on;

      keepalive_timeout 65;

      #gzip on;

      include /etc/nginx/conf.d/*.conf;
      }

      Comment

      • vladimir_lv
        Senior Member
        • May 2022
        • 240

        #4
        include /etc/nginx/conf.d/*.conf;
        там есть что-то типа zabbix.conf?

        Comment

        • ToxaAdmin
          Junior Member
          • Jul 2022
          • 12

          #5
          Originally posted by vladimir_lv
          там есть что-то типа zabbix.conf?
          нет, там есть только default.conf
          server {
          listen 80;
          server_name localhost;

          #access_log /var/log/nginx/host.access.log main;

          location / {
          root /usr/share/nginx/html;
          index index.html index.htm;
          }

          #error_page 404 /404.html;

          # redirect server error pages to the static page /50x.html
          #
          error_page 500 502 503 504 /50x.html;
          location = /50x.html {
          root /usr/share/nginx/html;
          }

          # proxy the PHP scripts to Apache listening on 127.0.0.1:80
          #
          [HASHTAG="t3566"]location[/HASHTAG] ~ \.php$ {
          # proxy_pass http://127.0.0.1;
          #}

          # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
          #
          [HASHTAG="t3566"]location[/HASHTAG] ~ \.php$ {
          # root html;
          # fastcgi_pass 127.0.0.1:9000;
          # fastcgi_index index.php;
          # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
          # include fastcgi_params;
          #}

          # deny access to .htaccess files, if Apache's document root
          # concurs with nginx's one
          #
          [HASHTAG="t3566"]location[/HASHTAG] ~ /\.ht {
          # deny all;
          #}
          }

          Comment

          • vladimir_lv
            Senior Member
            • May 2022
            • 240

            #6
            Там должен быть симлинк на файл /etc/zabbix/nginx.conf. Сам такой файл существует?

            Comment

            • ToxaAdmin
              Junior Member
              • Jul 2022
              • 12

              #7
              Originally posted by vladimir_lv
              Там должен быть симлинк на файл /etc/zabbix/nginx.conf. Сам такой файл существует?
              Нет, в /etc/zabbix/nginx.conf Есть только такие web zabbix_agentd.conf zabbix_agentd.d zabbix_server_after_update.conf zabbix_server.conf

              Comment

              • vladimir_lv
                Senior Member
                • May 2022
                • 240

                #8
                Создайте файл zabbix.conf в /etc/nginx/conf.d/
                Code:
                server {
                listen 80;
                listen [::]:80;
                
                server_name zabbix;
                index index.php;
                
                access_log /dev/fd/1 main;
                error_log /dev/fd/2 notice;
                
                set $webroot '/usr/share/zabbix';
                
                root $webroot;
                
                large_client_header_buffers 8 8k;
                client_max_body_size 10M;
                
                location = /favicon.ico {
                log_not_found off;
                }
                
                location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
                }
                
                # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
                location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
                }
                
                # caching of files
                location ~* \.ico$ {
                expires 1y;
                }
                
                location ~* \.(js|css|png|jpg|jpeg|gif|xml|txt)$ {
                expires 14d;
                }
                
                location ~ /(app\/|conf[^\.]|include\/|local\/|locale\/) {
                deny all;
                return 404;
                }
                
                location / {
                try_files $uri $uri/ /index.php?$args;
                }
                
                location ~ .php$ {
                fastcgi_pass unix:/tmp/php-fpm.sock;
                fastcgi_index index.php;
                
                fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
                
                include fastcgi_params;
                fastcgi_param QUERY_STRING $query_string;
                fastcgi_param REQUEST_METHOD $request_method;
                fastcgi_param CONTENT_TYPE $content_type;
                fastcgi_param CONTENT_LENGTH $content_length;
                fastcgi_intercept_errors on;
                fastcgi_ignore_client_abort off;
                fastcgi_connect_timeout 60;
                fastcgi_send_timeout 180;
                fastcgi_read_timeout 601;
                fastcgi_buffer_size 128k;
                fastcgi_buffers 4 256k;
                fastcgi_busy_buffers_size 256k;
                fastcgi_temp_file_write_size 256k;
                }
                }
                назначьте владельцем файла zabbix:zabbix
                Переазпустите nginx

                Comment

                • ToxaAdmin
                  Junior Member
                  • Jul 2022
                  • 12

                  #9
                  Originally posted by vladimir_lv
                  Создайте файл zabbix.conf в /etc/nginx/conf.d/
                  Code:
                  server {
                  listen 80;
                  listen [::]:80;
                  
                  server_name zabbix;
                  index index.php;
                  
                  access_log /dev/fd/1 main;
                  error_log /dev/fd/2 notice;
                  
                  set $webroot '/usr/share/zabbix';
                  
                  root $webroot;
                  
                  large_client_header_buffers 8 8k;
                  client_max_body_size 10M;
                  
                  location = /favicon.ico {
                  log_not_found off;
                  }
                  
                  location = /robots.txt {
                  allow all;
                  log_not_found off;
                  access_log off;
                  }
                  
                  # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
                  location ~ /\. {
                  deny all;
                  access_log off;
                  log_not_found off;
                  }
                  
                  # caching of files
                  location ~* \.ico$ {
                  expires 1y;
                  }
                  
                  location ~* \.(js|css|png|jpg|jpeg|gif|xml|txt)$ {
                  expires 14d;
                  }
                  
                  location ~ /(app\/|conf[^\.]|include\/|local\/|locale\/) {
                  deny all;
                  return 404;
                  }
                  
                  location / {
                  try_files $uri $uri/ /index.php?$args;
                  }
                  
                  location ~ .php$ {
                  fastcgi_pass unix:/tmp/php-fpm.sock;
                  fastcgi_index index.php;
                  
                  fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
                  
                  include fastcgi_params;
                  fastcgi_param QUERY_STRING $query_string;
                  fastcgi_param REQUEST_METHOD $request_method;
                  fastcgi_param CONTENT_TYPE $content_type;
                  fastcgi_param CONTENT_LENGTH $content_length;
                  fastcgi_intercept_errors on;
                  fastcgi_ignore_client_abort off;
                  fastcgi_connect_timeout 60;
                  fastcgi_send_timeout 180;
                  fastcgi_read_timeout 601;
                  fastcgi_buffer_size 128k;
                  fastcgi_buffers 4 256k;
                  fastcgi_busy_buffers_size 256k;
                  fastcgi_temp_file_write_size 256k;
                  }
                  }
                  назначьте владельцем файла zabbix:zabbix
                  Переазпустите nginx
                  теперь такая беда
                  Code:
                  systemctl status nginx
                  ● nginx.service - nginx - high performance web server
                  Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
                  Active: failed (Result: exit-code) since Tue 2022-07-26 17:22:36 +10; 2min 5s ago
                  Docs: http://nginx.org/en/docs/
                  Process: 2126 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
                  
                  Jul 26 17:22:36 kms-od-zabbix.medkhv.ru systemd[1]: Starting nginx - high performance web server...
                  Jul 26 17:22:36 kms-od-zabbix.medkhv.ru nginx[2126]: nginx: [emerg] open() "/dev/fd/1" failed (6: No such device or address)
                  Jul 26 17:22:36 kms-od-zabbix.medkhv.ru systemd[1]: nginx.service: control process exited, code=exited status=1
                  Jul 26 17:22:36 kms-od-zabbix.medkhv.ru systemd[1]: Failed to start nginx - high performance web server.
                  Jul 26 17:22:36 kms-od-zabbix.medkhv.ru systemd[1]: Unit nginx.service entered failed state.
                  Jul 26 17:22:36 kms-od-zabbix.medkhv.ru systemd[1]: nginx.service failed.

                  Comment

                  • vladimir_lv
                    Senior Member
                    • May 2022
                    • 240

                    #10
                    nginx: [emerg] open() "/dev/fd/1" failed (6: No such device or address)
                    Ну, это мои настройки, сервер запущуен на контейнере. Проявите немного инициативы и прочитайте документацию того, что вы используете.
                    У вас, скорей всего, эти параметры должны быть как
                    Code:
                     access_log /var/log/nginx/zabbix/access.log;
                            error_log /var/log/nginx/zabbix/error.log;

                    Comment

                    • ToxaAdmin
                      Junior Member
                      • Jul 2022
                      • 12

                      #11
                      Originally posted by vladimir_lv
                      Ну, это мои настройки, сервер запущуен на контейнере. Проявите немного инициативы и прочитайте документацию того, что вы используете.
                      У вас, скорей всего, эти параметры должны быть как
                      Code:
                       access_log /var/log/nginx/zabbix/access.log;
                      error_log /var/log/nginx/zabbix/error.log;
                      В директории /var/log/nginx/ отсутствовала директория zabbix, добавил и файлы добавил (access.log и error.log). владелец директории и файлов root
                      Но заббикс также не доступен.
                      Code:
                      systemctl status zabbix-server
                      ● zabbix-server.service - Zabbix Server
                      Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
                      Active: active (running) since Wed 2022-07-27 08:29:33 +10; 9min ago
                      Process: 23129 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
                      Process: 23139 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
                      Main PID: 23141 (zabbix_server)
                      CGroup: /system.slice/zabbix-server.service
                      ├─23141 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
                      ├─23142 /usr/sbin/zabbix_server: configuration syncer [synced configuration in 0.394046 sec, idle 60 sec]
                      ├─23143 /usr/sbin/zabbix_server: alert manager [NODE="1"]Home[/NODE] [sent 0, failed 0 alerts, idle 5.010641 sec during 5.010752 sec]
                      ├─23144 /usr/sbin/zabbix_server: alerter [NODE="1"]Home[/NODE] started
                      ├─23145 /usr/sbin/zabbix_server: alerter [NODE="2"]Forum[/NODE] started
                      ├─23146 /usr/sbin/zabbix_server: alerter #3 started
                      ├─23147 /usr/sbin/zabbix_server: preprocessing manager [NODE="1"]Home[/NODE] [queued 0, processed 240 values, idle 5.104091 sec during 5.108493 sec]
                      ├─23148 /usr/sbin/zabbix_server: preprocessing worker [NODE="1"]Home[/NODE] started
                      ├─23149 /usr/sbin/zabbix_server: preprocessing worker [NODE="2"]Forum[/NODE] started
                      ├─23150 /usr/sbin/zabbix_server: preprocessing worker #3 started
                      ├─23151 /usr/sbin/zabbix_server: housekeeper [startup idle for 30 minutes]
                      ├─23152 /usr/sbin/zabbix_server: timer [NODE="1"]Home[/NODE] [updated 0 hosts, suppressed 0 events in 0.001322 sec, idle 59 sec]
                      ├─23153 /usr/sbin/zabbix_server: http poller [NODE="1"]Home[/NODE] [got 0 values in 0.000581 sec, idle 5 sec]
                      ├─23154 /usr/sbin/zabbix_server: discoverer [NODE="1"]Home[/NODE] [processed 0 rules in 0.000953 sec, performing discovery]
                      ├─23155 /usr/sbin/zabbix_server: history syncer [NODE="1"]Home[/NODE] [processed 33 values, 4 triggers in 0.002468 sec, idle 1 sec]
                      ├─23156 /usr/sbin/zabbix_server: history syncer [NODE="2"]Forum[/NODE] [processed 0 values, 0 triggers in 0.000025 sec, idle 1 sec]
                      ├─23157 /usr/sbin/zabbix_server: history syncer #3 [processed 0 values, 0 triggers in 0.000024 sec, idle 1 sec]
                      ├─23158 /usr/sbin/zabbix_server: history syncer #4 [processed 0 values, 0 triggers in 0.000062 sec, idle 1 sec]
                      ├─23159 /usr/sbin/zabbix_server: escalator [NODE="1"]Home[/NODE] [processed 0 escalations in 0.001034 sec, idle 3 sec]
                      ├─23160 /usr/sbin/zabbix_server: proxy poller [NODE="1"]Home[/NODE] [exchanged data with 0 proxies in 0.000029 sec, idle 5 sec]
                      ├─23161 /usr/sbin/zabbix_server: self-monitoring [processed data in 0.000035 sec, idle 1 sec]
                      ├─23162 /usr/sbin/zabbix_server: task manager [processed 0 task(s) in 0.000492 sec, idle 5 sec]
                      ├─23163 /usr/sbin/zabbix_server: poller [NODE="1"]Home[/NODE] [got 3 values in 0.037132 sec, idle 1 sec]
                      ├─23164 /usr/sbin/zabbix_server: poller [NODE="2"]Forum[/NODE] [got 8 values in 0.043055 sec, idle 1 sec]
                      ├─23165 /usr/sbin/zabbix_server: poller #3 [got 9 values in 0.067875 sec, idle 1 sec]
                      ├─23166 /usr/sbin/zabbix_server: poller #4 [got 0 values in 0.000033 sec, idle 1 sec]
                      ├─23167 /usr/sbin/zabbix_server: poller #5 [got 13 values in 0.035672 sec, idle 1 sec]
                      ├─23168 /usr/sbin/zabbix_server: unreachable poller [NODE="1"]Home[/NODE] [got 0 values in 0.000050 sec, idle 5 sec]
                      ├─23169 /usr/sbin/zabbix_server: trapper [NODE="1"]Home[/NODE] [processed data in 0.002845 sec, waiting for connection]
                      ├─23170 /usr/sbin/zabbix_server: trapper [NODE="2"]Forum[/NODE] [processed data in 0.002365 sec, waiting for connection]
                      ├─23171 /usr/sbin/zabbix_server: trapper #3 [processed data in 0.002381 sec, waiting for connection]
                      ├─23172 /usr/sbin/zabbix_server: trapper #4 [processed data in 0.024794 sec, waiting for connection]
                      ├─23173 /usr/sbin/zabbix_server: trapper #5 [processed data in 0.023092 sec, waiting for connection]
                      └─23174 /usr/sbin/zabbix_server: icmp pinger [NODE="1"]Home[/NODE] [got 3 values in 2.013155 sec, idle 1 sec]
                      Агенты вот что говорят
                      Code:
                      2464:20220727:083446.286 no active checks on server [10.40.109.211:10051]: host [PBX-HOST] not found
                      ​​

                      ​ ​
                      ​​ ​​​​​​​

                      Comment

                      • vladimir_lv
                        Senior Member
                        • May 2022
                        • 240

                        #12
                        Простите, коллега. но мне кажется вы немного запутались. Zabbix server это одно, Zabbix Web GUI (frontend) - второе, Zabbix agent - третье. Ваша проблема была, что веб часть, т.е. панель управления не работала в виду неправильной настройки вебсервера. Зачем смотреть логи Zabbix сервера, если недоустпна веб часть? Что вы видите сейчас по адресу http://10.40.109.211/zabbix? Что в логах Nginx?

                        Comment

                        • ToxaAdmin
                          Junior Member
                          • Jul 2022
                          • 12

                          #13
                          Originally posted by vladimir_lv
                          Простите, коллега. но мне кажется вы немного запутались. Zabbix server это одно, Zabbix Web GUI (frontend) - второе, Zabbix agent - третье. Ваша проблема была, что веб часть, т.е. панель управления не работала в виду неправильной настройки вебсервера. Зачем смотреть логи Zabbix сервера, если недоустпна веб часть? Что вы видите сейчас по адресу http://10.40.109.211/zabbix? Что в логах Nginx?
                          http://10.40.109.211/zabbix 404 Not Found

                          в логах Nginx
                          2022/07/27 11:41:02 [error] 2291#2291: *1 open() "/usr/share/nginx/html/zabbix" failed (2: No such file or directory), client: 10.40.108.204, server: localhost, request: "GET /zabbix HTTP/1.1", host: "10.40.109.211"
                          2022/07/27 11:41:03 [error] 2291#2291: *1 open() "/usr/share/nginx/html/zabbix" failed (2: No such file or directory), client: 10.40.108.204, server: localhost, request: "GET /zabbix HTTP/1.1", host: "10.40.109.211"
                          2022/07/27 12:36:00 [error] 2290#2290: *2 open() "/usr/share/nginx/html/zabbix" failed (2: No such file or directory), client: 10.40.108.204, server: localhost, request: "GET /zabbix HTTP/1.1", host: "10.40.109.211"
                          2022/07/27 17:36:34 [error] 2290#2290: *8 open() "/usr/share/nginx/html/zabbix" failed (2: No such file or directory), client: 10.40.108.204, server: localhost, request: "GET /zabbix HTTP/1.1", host: "10.40.109.211"
                          2022/07/27 17:38:00 [error] 2288#2288: *10 open() "/usr/share/nginx/html/zabbix" failed (2: No such file or directory), client: 10.40.108.204, server: localhost, request: "GET /zabbix HTTP/1.1", host: "10.40.109.211"
                          Также
                          ls -l /usr/share/nginx/html
                          total 8
                          -rw-r--r--. 1 root root 497 May 25 01:35 50x.html
                          -rw-r--r--. 1 root root 615 May 25 01:35 index.html
                          Last edited by ToxaAdmin; 27-07-2022, 09:43. Reason: add ls -l

                          Comment

                          • vladimir_lv
                            Senior Member
                            • May 2022
                            • 240

                            #14
                            open() "/usr/share/nginx/html/zabbix" failed (2: No such file or directory), c
                            Ну вот же ошибка. Нет такого файла или директории.
                            Что у вас в написано для set $webroot внастройках zabbix.conf в /etc/nginx/conf.d/ ? /usr/share/nginx/html/zabbix ?

                            Comment

                            • ToxaAdmin
                              Junior Member
                              • Jul 2022
                              • 12

                              #15
                              Originally posted by vladimir_lv
                              Ну вот же ошибка. Нет такого файла или директории.
                              Что у вас в написано для set $webroot внастройках zabbix.conf в /etc/nginx/conf.d/ ? /usr/share/nginx/html/zabbix ?
                              в /etc/nginx/conf.d/ вот что set $webroot '/usr/share/zabbix';
                              а в /usr/share/nginx/html/ нет файла zabbix

                              Comment

                              Working...