差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン | |||
| ja:documentation:07_technical_annexes:30_pfms_install_latest_ubuntu_server [2023/12/27 08:24] – [PhantomJS] junichi | ja:documentation:07_technical_annexes:30_pfms_install_latest_ubuntu_server [2026/09/06 19:55] (現在) – 削除 - 外部編集 (不明な日付) 127.0.0.1 | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | ====== Ubuntu サーバへの Pandora FMS インストールガイド ====== | ||
| - | |||
| - | {{indexmenu_n> | ||
| - | |||
| - | [[: | ||
| - | |||
| - | <WRAP center round todo 60%> | ||
| - | |||
| - | We are working on the translation of the Pandora FMS documentation. Sorry for any inconvenience. | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== 前提条件 ===== | ||
| - | |||
| - | * Ubuntu server 22.04 with **root.** user rights | ||
| - | * Internet connection. | ||
| - | |||
| - | * Ubuntu server 22.04 および **root** 権限 | ||
| - | * インターネット接続 | ||
| - | |||
| - | ===== 基本ツール ===== | ||
| - | |||
| - | In a terminal window with user **root**: | ||
| - | |||
| - | ターミナル画面で **root** ユーザで実行します。 | ||
| - | |||
| - | < | ||
| - | apt install -y gawk sed grep | ||
| - | |||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | < | ||
| - | rm -rf / | ||
| - | mkdir -p / | ||
| - | cd / | ||
| - | |||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | < | ||
| - | apt update | ||
| - | apt install -y net-tools vim curl wget \ | ||
| - | software-properties-common apt-transport-https\ | ||
| - | ca-certificates gnupg lsb-release | ||
| - | |||
| - | </ | ||
| - | |||
| - | ==== Apache2 および PHP 8 ==== | ||
| - | |||
| - | < | ||
| - | add-apt-repository ppa: | ||
| - | apt update | ||
| - | apt upgrade | ||
| - | apt install -y php8.0-fpm php8.0-common libapache2-mod-fcgid php8.0-cli apache2 | ||
| - | a2enmod proxy_fcgi setenvif | ||
| - | systemctl reload apache2 | ||
| - | a2enconf php8.0-fpm | ||
| - | systemctl restart php8.0-fpm | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | ===== Pandora FMS Web コンソール依存ファイル ===== | ||
| - | |||
| - | < | ||
| - | apt install -y \ | ||
| - | ldap-utils postfix \ | ||
| - | wget graphviz \ | ||
| - | xfonts-75dpi xfonts-100dpi \ | ||
| - | xfonts-ayu xfonts-intl-arabic \ | ||
| - | xfonts-intl-asian xfonts-intl-phonetic \ | ||
| - | xfonts-intl-japanese-big xfonts-intl-european \ | ||
| - | xfonts-intl-chinese xfonts-intl-japanese \ | ||
| - | xfonts-intl-chinese-big libzstd1 \ | ||
| - | gir1.2-atk-1.0 libavahi-common-data\ | ||
| - | cairo-perf-utils libfribidi-bin \ | ||
| - | php8.0-mcrypt php8.0-gd \ | ||
| - | php8.0-curl php8.0-mysql \ | ||
| - | php8.0-ldap php8.0-fileinfo \ | ||
| - | php8.0-gettext php8.0-snmp\ | ||
| - | php8.0-mbstring php8.0-zip \ | ||
| - | php8.0-xml rpc php8.0-xml \ | ||
| - | php8.0-yaml libnet-telnet-perl\ | ||
| - | whois cron | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== Pandora FMS サーバ依存ファイル ===== | ||
| - | |||
| - | < | ||
| - | apt install -y \ | ||
| - | perl nmap\ | ||
| - | fping sudo \ | ||
| - | net-tools nfdump \ | ||
| - | expect openssh-client \ | ||
| - | postfix unzip \ | ||
| - | xprobe coreutils \ | ||
| - | libmoosex-role-timer-perl libmoosex-perl \ | ||
| - | libdbd-mysql-perl libcrypt-mysql-perl \ | ||
| - | libhttp-request-ascgi-perl liblwp-useragent-chicaching-perl \ | ||
| - | liblwp-protocol-https-perl snmp\ | ||
| - | libnetaddr-ip-perl libio-socket-ssl-perl\ | ||
| - | libio-socket-socks-perl libio-socket-ip-perl \ | ||
| - | libio-socket-inet6-perl libnet-telnet-perl \ | ||
| - | libjson-perl libencode-perl \ | ||
| - | cron libgeo-ip-perl\ | ||
| - | arping snmp-mibs-downloader \ | ||
| - | openjdk-8-jdk | ||
| - | |||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | < | ||
| - | mkdir -m 0755 -p / | ||
| - | |||
| - | curl -fsSL https:// | ||
| - | sudo gpg --yes --dearmor -o / | ||
| - | |||
| - | threw out \ | ||
| - | "deb [arch=$(dpkg --print-architecture) signed-by=/ | ||
| - | sudo tee / | ||
| - | |||
| - | apt update -y | ||
| - | apt-get install -y \ | ||
| - | docker-ce docker-ce-cli containerd.io\ | ||
| - | docker-buildx-plugin docker-compose-plugin | ||
| - | |||
| - | systemctl disable docker --now | ||
| - | systemctl disable docker.socket --now | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | ===== WMI 監視を行うための依存ファイル ===== | ||
| - | |||
| - | < | ||
| - | curl -O https:// | ||
| - | curl -O https:// | ||
| - | chmod +x pandorawmic wmic | ||
| - | cp -a wmic /usr/bin/ | ||
| - | cp -a pandorawmic /usr/bin/ | ||
| - | |||
| - | </ | ||
| - | ==== Fping ==== | ||
| - | |||
| - | < | ||
| - | rm -f / | ||
| - | ln -s / | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | ===== Google Chrome Tool ===== | ||
| - | |||
| - | < | ||
| - | wget https:// | ||
| - | dpkg -i google-chrome-stable_current_amd64.deb | ||
| - | ln -s / | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== VMware Tool ===== | ||
| - | |||
| - | < | ||
| - | apt install -y \ | ||
| - | lib32z1 lib32z1 \ | ||
| - | build-essential uuid uuid-dev \ | ||
| - | libssl-dev perl-doc\ | ||
| - | libxml-libxml-perl libcrypt-ssleay-perl \ | ||
| - | libsoap-lite-perl libmodule-build-perl | ||
| - | wget https:// | ||
| - | tar -xzvf VMware-vSphere-Perl-SDK-7.0.0-16453907.x86_64.tar.gz | ||
| - | cd vmware-vsphere-cli-distrib/ | ||
| - | sed --follow-symlinks -i -e " | ||
| - | ./ | ||
| - | cd .. | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== Oracle client tool ===== | ||
| - | |||
| - | < | ||
| - | mkdir -p /opt/oracle | ||
| - | wget https:// | ||
| - | wget https:// | ||
| - | rm -fr / | ||
| - | unzip instantclient-basic-linux.x64-19.8.0.0.0dbru.zip -d / | ||
| - | unzip instantclient-sqlplus-linux.x64-19.8.0.0.0dbru.zip -d / | ||
| - | |||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | < | ||
| - | cat>> / | ||
| - | #!/bin/bash | ||
| - | VERSION=19.8 | ||
| - | export PATH=$PATH:/ | ||
| - | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/ | ||
| - | export ORACLE_HOME=/ | ||
| - | EOF_ENV | ||
| - | |||
| - | </ | ||
| - | < | ||
| - | source '/ | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | ===== IPAM 依存ファイル ===== | ||
| - | |||
| - | < | ||
| - | apt install -y \ | ||
| - | xprobe libnetaddr-ip-perl \ | ||
| - | coreutils libdbd-mysql-perl \ | ||
| - | libxml-simple-perl libgeo-ip-perl \ | ||
| - | libio-socket-inet6-perl libxml-twig-perl \ | ||
| - | libnetaddr-ip-perl | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== MS SQL のための ODBC 依存ファイル ===== | ||
| - | |||
| - | < | ||
| - | curl -sSL https:// | ||
| - | tee / | ||
| - | curl -sSL https:// | ||
| - | tee / | ||
| - | apt update | ||
| - | env ACCEPT_EULA=Y apt install -y msodbcsql17 | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== AppArmor および UFW 設定 ===== | ||
| - | |||
| - | < | ||
| - | systemctl stop ufw.service | ||
| - | systemctl disable ufw | ||
| - | systemctl stop apparmor | ||
| - | systemctl disable apparmor | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== MySQL インストール ===== | ||
| - | |||
| - | < | ||
| - | curl -O https:// | ||
| - | apt install -y gnupg2 lsb-release ./ | ||
| - | percona-release setup ps80 | ||
| - | apt install -y percona-server-server percona-xtrabackup-80 | ||
| - | |||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | < | ||
| - | systemctl start mysql | ||
| - | |||
| - | mysql -uroot -p | ||
| - | |||
| - | ALTER USER ' | ||
| - | |||
| - | create database pandora; | ||
| - | |||
| - | CREATE USER pandora IDENTIFIED BY ' | ||
| - | |||
| - | ALTER USER ' | ||
| - | |||
| - | GRANT ALL PRIVILEGES ON pandora.* TO ' | ||
| - | |||
| - | exit; | ||
| - | |||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | < | ||
| - | cat > / | ||
| - | [mysqld] | ||
| - | datadir=/ | ||
| - | user=mysql | ||
| - | character-set-server=utf8mb4 | ||
| - | skip-character-set-client-handshake | ||
| - | # Disabling symbolic-links is recommended to prevent assorted security risks | ||
| - | symbolic-links=0 | ||
| - | # Mysql optimizations for Pandora FMS | ||
| - | # Please check the documentation in http:// | ||
| - | max_allowed_packet = 64M | ||
| - | innodb_buffer_pool_size = grep -i total / | ||
| - | innodb_lock_wait_timeout = 90 | ||
| - | innodb_file_per_table | ||
| - | innodb_flush_log_at_trx_commit = 0 | ||
| - | innodb_flush_method = O_DIRECT | ||
| - | innodb_log_file_size = 64M | ||
| - | innodb_log_buffer_size = 16M | ||
| - | innodb_io_capacity = 300 | ||
| - | thread_cache_size = 8 | ||
| - | thread_stack = 256K | ||
| - | max_connections = 100 | ||
| - | key_buffer_size=4M | ||
| - | read_buffer_size=128K | ||
| - | read_rnd_buffer_size=128K | ||
| - | sort_buffer_size=128K | ||
| - | join_buffer_size=4M | ||
| - | skip-log-bin | ||
| - | sql_mode="" | ||
| - | log-error=/ | ||
| - | [mysqld_safe] | ||
| - | log-error=/ | ||
| - | pid-file=/ | ||
| - | EOF_DB | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | < | ||
| - | |||
| - | systemctl restart mysql | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== Pandora FMS のインストール ===== | ||
| - | |||
| - | < | ||
| - | curl -LSs --output \ | ||
| - | pandorafms_console-7.0NG.tar.gz\ | ||
| - | " | ||
| - | |||
| - | curl -LSs --output \ | ||
| - | pandorafms_server-7.0NG.tar.gz\ | ||
| - | " | ||
| - | |||
| - | curl -LSs --output \ | ||
| - | pandorafms_agent_linux-7.0NG.tar.gz\ | ||
| - | " | ||
| - | </ | ||
| - | ==== Pandora FMS Web コンソールのインストール ==== | ||
| - | < | ||
| - | tar xvzf pandorafms_console-7.0NG.tar.gz | ||
| - | |||
| - | cp -Ra pandora_console / | ||
| - | |||
| - | rm -f / | ||
| - | </ | ||
| - | ==== Pandora FMS サーバのインストール ==== | ||
| - | < | ||
| - | useradd pandora | ||
| - | |||
| - | |||
| - | mv pandorafms_server-7.0NG.tar.gz / | ||
| - | |||
| - | cd / | ||
| - | |||
| - | tar xvfz pandorafms_server-7.0NG.tar.gz | ||
| - | |||
| - | cd pandora_server | ||
| - | |||
| - | ./ | ||
| - | </ | ||
| - | ==== Pandora FMS エージェントのインストール ==== | ||
| - | < | ||
| - | apt install -y libyaml-tiny-perl perl coreutils wget curl unzip procps python3 python3-pip | ||
| - | |||
| - | |||
| - | mv pandorafms_agent_linux-7.0NG.tar.gz / | ||
| - | |||
| - | cd / | ||
| - | |||
| - | tar xvzf pandorafms_agent_linux-7.0NG.tar.gz | ||
| - | |||
| - | unix cd | ||
| - | |||
| - | ./ | ||
| - | |||
| - | cp -a tentacle_client / | ||
| - | </ | ||
| - | ==== GoTTY インストール ==== | ||
| - | < | ||
| - | cd / | ||
| - | |||
| - | wget https:// | ||
| - | |||
| - | tar xvzf gotty_linux_amd64.tar.gz | ||
| - | |||
| - | mv gotty /usr/bin/ | ||
| - | </ | ||
| - | ==== SSL 設定 ==== | ||
| - | < | ||
| - | cat > / | ||
| - | SSLCipherSuite EECDH+AESGCM: | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | # Requires Apache >= 2.4 | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | # Requires Apache >= 2.4.11 | ||
| - | | ||
| - | | ||
| - | EOF_PARAM | ||
| - | </ | ||
| - | ---- | ||
| - | < | ||
| - | a2enmod ssl | ||
| - | a2enmod headers | ||
| - | a2enconf ssl-params | ||
| - | a2ensite default-ssl | ||
| - | a2enconf ssl-params | ||
| - | apache2ctl configtest | ||
| - | |||
| - | systemctl restart apache2 | ||
| - | systemctl enable mysql --now | ||
| - | systemctl enable apache2 --now | ||
| - | systemctl enable php8.0-fpm --now | ||
| - | </ | ||
| - | ==== MySQL の構造とデータ ==== | ||
| - | < | ||
| - | mysql -uroot -ppandora | ||
| - | |||
| - | wear pandora; | ||
| - | |||
| - | source / | ||
| - | |||
| - | source / | ||
| - | |||
| - | exit; | ||
| - | </ | ||
| - | |||
| - | ==== PHP および Apache2 の設定 ==== | ||
| - | |||
| - | < | ||
| - | cat > / | ||
| - | <?php | ||
| - | \$config[" | ||
| - | \$config[" | ||
| - | \$config[" | ||
| - | \$config[" | ||
| - | \$config[" | ||
| - | \$config[" | ||
| - | \$config[" | ||
| - | error_reporting(0); | ||
| - | \$ownDir = dirname(__FILE__) . '/'; | ||
| - | include (\$ownDir . " | ||
| - | EO_CONFIG_F | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | < | ||
| - | cat > / | ||
| - | < | ||
| - | | ||
| - | Allow Override All | ||
| - | | ||
| - | </ | ||
| - | EO_CONFIG_F | ||
| - | |||
| - | cat >> / | ||
| - | Proxy Requests Off | ||
| - | <Proxy *> | ||
| - | | ||
| - | </ | ||
| - | |||
| - | ProxyPass /ws ws: | ||
| - | ProxyPassReverse /ws ws: | ||
| - | EO_HTTPD_WSTUNNEL | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | < | ||
| - | chmod 600 / | ||
| - | |||
| - | chown -R www-data: | ||
| - | |||
| - | mv / | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | < | ||
| - | ln -s / | ||
| - | |||
| - | sed --follow-symlinks -i -e " | ||
| - | |||
| - | sed --follow-symlinks -i -e " | ||
| - | |||
| - | sed --follow-symlinks -i -e " | ||
| - | |||
| - | sed --follow-symlinks -i -e " | ||
| - | |||
| - | sed --follow-symlinks -i -e " | ||
| - | |||
| - | sed --follow-symlinks -i -e " | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | < | ||
| - | cat > / | ||
| - | <meta HTTP-EQUIV=" | ||
| - | EOF_INDEX | ||
| - | |||
| - | systemctl restart apache2 | ||
| - | |||
| - | systemctl restart php8.0-fpm | ||
| - | </ | ||
| - | ==== Pandora FMS エージェントとサーバ設定 ==== | ||
| - | |||
| - | < | ||
| - | cat> / | ||
| - | authCommunity log public | ||
| - | disableAuthorization yes | ||
| - | EOF | ||
| - | |||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | < | ||
| - | sed -i -e " | ||
| - | |||
| - | sed -i -e " | ||
| - | |||
| - | sed -i -e " | ||
| - | |||
| - | sed -i -e " | ||
| - | |||
| - | sed -i -e " | ||
| - | |||
| - | sed -i -e " | ||
| - | |||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | < | ||
| - | |||
| - | grep -q "group www-data" | ||
| - | cat>> / | ||
| - | #Adding group www-data to assigning remote-config permission correctly for ubuntu 22.04 | ||
| - | group www-data | ||
| - | EOF_G | ||
| - | |||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | < | ||
| - | |||
| - | sed -i " | ||
| - | |||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | < | ||
| - | cat> / | ||
| - | #!/bin/bash | ||
| - | VERSION=19.8 | ||
| - | export PATH=$PATH:/ | ||
| - | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/ | ||
| - | export ORACLE_HOME=/ | ||
| - | export OPENSSL_CONF=/ | ||
| - | EOF_ENV | ||
| - | |||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | < | ||
| - | cat>> / | ||
| - | # Pandora FMS Optimization | ||
| - | #default=5 | ||
| - | net.ipv4.tcp_syn_retries = 3 | ||
| - | #default=5 | ||
| - | net.ipv4.tcp_synack_retries = 3 | ||
| - | # | ||
| - | net.ipv4.tcp_max_syn_backlog = 65536 | ||
| - | # | ||
| - | net.core.wmem_max = 8388608 | ||
| - | # | ||
| - | net.core.rmem_max = 8388608 | ||
| - | #default = 128 | ||
| - | net.core.somaxconn = 1024 | ||
| - | |||
| - | #default = 20480 | ||
| - | net.core.optmem_max = 81920 | ||
| - | |||
| - | EO_KO | ||
| - | |||
| - | sysctl --system | ||
| - | |||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | < | ||
| - | chown pandora: www-data / | ||
| - | |||
| - | chmod g+s / | ||
| - | |||
| - | cat> / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | your apache root | ||
| - | | ||
| - | | ||
| - | size 300000 | ||
| - | | ||
| - | max age 90 | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | } | ||
| - | |||
| - | / | ||
| - | your apache root | ||
| - | | ||
| - | | ||
| - | size 500000 | ||
| - | | ||
| - | max age 30 | ||
| - | | ||
| - | | ||
| - | | ||
| - | } | ||
| - | |||
| - | EO_LR | ||
| - | |||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | < | ||
| - | cat> / | ||
| - | / | ||
| - | your apache root | ||
| - | | ||
| - | | ||
| - | size 300000 | ||
| - | | ||
| - | max age 90 | ||
| - | | ||
| - | | ||
| - | | ||
| - | } | ||
| - | |||
| - | EO_LRA | ||
| - | |||
| - | chmod 0644 / | ||
| - | |||
| - | chmod 0644 / | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | ==== Tentacle および cron ==== | ||
| - | < | ||
| - | / | ||
| - | |||
| - | systemctl enablepandora_server | ||
| - | |||
| - | service tentacle_server start | ||
| - | |||
| - | systemctl enable tentacle_server | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | < | ||
| - | echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies / | ||
| - | |||
| - | echo " | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | Agent remote configuration: | ||
| - | |||
| - | エージェントリモート設定: | ||
| - | |||
| - | < | ||
| - | sed -i " | ||
| - | |||
| - | / | ||
| - | |||
| - | systemctl enable pandora_agent_daemon | ||
| - | </ | ||
| - | |||
| - | <WRAP center round tip 60%> | ||
| - | If there was a problem with PhantomJS: | ||
| - | </ | ||
| - | |||
| - | <WRAP center round tip 60%> | ||
| - | PhantomJS で問題があった場合: | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | sed --follow-symlinks -i -e " | ||
| - | </ | ||
| - | |||
| - | ===== Pandora FMS へのログイン ===== | ||
| - | |||
| - | To access the Web Console, type the IP address (or URL) of the device followed by ''/ | ||
| - | |||
| - | Web コンソールにアクセスするには、デバイスの IP アドレス (または URL) に続けて ''/ | ||
| - | |||
| - | The default login credentials are: | ||
| - | |||
| - | デフォルトのログイン情報は次の通りです。 | ||
| - | |||
| - | * user: '' | ||
| - | * password: '' | ||
| - | |||
| - | * ユーザ: '' | ||
| - | * パスワード: | ||
| - | |||
| - | [[: | ||
| - | |||
| - | ===== (OBSOLETE) ===== | ||
| - | |||
| - | ==== Websocket エンジン ==== | ||
| - | < | ||
| - | mv / | ||
| - | |||
| - | chmod +x / | ||
| - | |||
| - | / | ||
| - | |||
| - | systemctl enable pandora_websocket_engine | ||
| - | </ | ||