差異處
這裏顯示兩個版本的差異處。
兩邊的前次修訂版 前次修改 下次修改 | 前次修改 | ||
tech:librenms [2022/08/01 15:30] – [設定告警通知] jonathan | tech:librenms [2024/02/20 12:13] (目前版本) – [設定告警通知] jonathan | ||
---|---|---|---|
行 1: | 行 1: | ||
====== Ubuntu 20.04 / CentOS7 安裝 LibreNMS 程序 ====== | ====== Ubuntu 20.04 / CentOS7 安裝 LibreNMS 程序 ====== | ||
+ | <note tip> | ||
+ | 如果要以 Docker 方式進行安裝, | ||
+ | </ | ||
+ | |||
* Ubuntu 20.04 LTS | * Ubuntu 20.04 LTS | ||
* CentOS Linux release 7.5.1804 (Core) | * CentOS Linux release 7.5.1804 (Core) | ||
行 56: | 行 60: | ||
* 進入 172.16.0.230 的 Alert Rules 設定頁面 ++設定畫面參考| \\ {{: | * 進入 172.16.0.230 的 Alert Rules 設定頁面 ++設定畫面參考| \\ {{: | ||
* 修改 硬碟空間已使用 90% 規則, 增加排除 /mnt/ext 規則 ++設定畫面參考| \\ {{: | * 修改 硬碟空間已使用 90% 規則, 增加排除 /mnt/ext 規則 ++設定畫面參考| \\ {{: | ||
+ | * 針對特定群組主機設定實體記憶體使用超過 7G 就發出 Critical 通知 ++設定畫面參考| \\ {{: | ||
行 394: | 行 399: | ||
</ | </ | ||
+ | ===== 升級 php 至 8.1 以上版本 ===== | ||
+ | * 今天看到這訊息 | ||
+ | < | ||
+ | Error: PHP version too low | ||
+ | PHP version 8.1 is the minimum supported version as of September, 2022. We recommend you update to PHP a supported version of PHP (8.1 suggested) to continue to receive updates. If you do not update PHP, LibreNMS will continue to function but stop receiving bug fixes and updates. | ||
+ | |||
+ | 2022-09-27 00:00:00 | Source: daily.sh | ||
+ | </ | ||
+ | * 檢查作業系統 -> Ububtu 20.04 / php 7.4 / nginx 1.18< | ||
+ | root@ct-librenms: | ||
+ | Ubuntu 20.04.4 LTS \n \l | ||
+ | root@ct-librenms: | ||
+ | PHP 7.4.3 (cli) (built: Jun 13 2022 13:43:30) ( NTS ) | ||
+ | Copyright (c) The PHP Group | ||
+ | Zend Engine v3.4.0, Copyright (c) Zend Technologies | ||
+ | with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies | ||
+ | root@ct-librenms: | ||
+ | nginx version: nginx/ | ||
+ | </ | ||
+ | * 進行升級 ref - https:// | ||
+ | apt update && apt upgrade -y | ||
+ | apt install software-properties-common && add-apt-repository ppa: | ||
+ | apt update && apt upgrade -y | ||
+ | apt install php8.1 php8.1-fpm php8.1-cli php8.1-gd php8.1-curl php8.1-dom php8.1-xml php8.1-mysql php8.1-mbstring -y | ||
+ | apt autoremove -y | ||
+ | systemctl status php8.1-fpm | ||
+ | systemctl restart nginx | ||
+ | </ | ||
+ | root@ct-librenms: | ||
+ | PHP 8.1.10 (cli) (built: Sep 18 2022 10:25:43) (NTS) | ||
+ | Copyright (c) The PHP Group | ||
+ | Zend Engine v4.1.10, Copyright (c) Zend Technologies | ||
+ | with Zend OPcache v8.1.10, Copyright (c), by Zend Technologies | ||
+ | </ | ||
+ | * 更換 php-fpm 的版本設定 | ||
+ | * 查看目前啟動的 php-fpm 狀況< | ||
+ | root@ct-librenms: | ||
+ | root | ||
+ | root | ||
+ | www-data | ||
+ | www-data | ||
+ | : | ||
+ | </ | ||
+ | * 關閉 7.4 版的 php-fpm< | ||
+ | root@ct-librenms: | ||
+ | root@ct-librenms: | ||
+ | Synchronizing state of php7.4-fpm.service with SysV service script with / | ||
+ | Executing: / | ||
+ | Removed / | ||
+ | </ | ||
+ | * 確認 8.4 版的 php-fpm socket 檔案< | ||
+ | root@ct-librenms:/ | ||
+ | php-fpm.sock | ||
+ | root@ct-librenms:/ | ||
+ | lrwxrwxrwx 1 root root 30 Sep 29 09:05 / | ||
+ | root@ct-librenms:/ | ||
+ | srw-rw---- 1 www-data www-data 0 Sep 29 09:05 / | ||
+ | </ | ||
+ | * 將 nginx 內的 librenms 網站設定改用新板 php-fpm <cli> | ||
+ | vi / | ||
+ | </ | ||
+ | : | ||
+ | } | ||
+ | | ||
+ | fastcgi_pass unix:/ | ||
+ | fastcgi_split_path_info ^(.+\.php)(/ | ||
+ | : | ||
+ | </ | ||
+ | * 重啟 nginx <cli> | ||
+ | systemctl restart nginx.service | ||
+ | </ | ||
+ | * 執行 librenms 的設定檢查< | ||
+ | su - librenms | ||
+ | ./ | ||
+ | </ | ||
+ | librenms@ct-librenms: | ||
+ | ==================================== | ||
+ | Component | Version | ||
+ | --------- | ------- | ||
+ | LibreNMS | ||
+ | DB Schema | 2022_09_03_091314_update_ports_adsl_table_with_defaults (246) | ||
+ | PHP | 8.1.11 | ||
+ | Python | ||
+ | Database | ||
+ | RRDTool | ||
+ | SNMP | 5.8 | ||
+ | ==================================== | ||
+ | |||
+ | [OK] Composer Version: 2.4.2 | ||
+ | [OK] Dependencies up-to-date. | ||
+ | : | ||
+ | : | ||
+ | OK] Database schema correct | ||
+ | [FAIL] | ||
+ | Mysql time 2022-10-04 18:40:56 | ||
+ | PHP time 2022-10-04 10:40:56 | ||
+ | [FAIL] | ||
+ | [FIX]: | ||
+ | Please install mbstring | ||
+ | [FAIL] | ||
+ | [FIX]: | ||
+ | https:// | ||
+ | [OK] Active pollers found | ||
+ | : | ||
+ | [OK] rrdtool version ok | ||
+ | [WARN] | ||
+ | [FIX]: | ||
+ | Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors. | ||
+ | [WARN] | ||
+ | [FIX]: | ||
+ | You can fix this with ./ | ||
+ | Modified Files: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | [FAIL] | ||
+ | [FIX]: | ||
+ | sudo chown -R librenms: | ||
+ | sudo setfacl -d -m g::rwx / | ||
+ | sudo chmod -R ug=rwX / | ||
+ | Files: | ||
+ | / | ||
+ | </ | ||
+ | * 依照上述的修正建議進行修正< | ||
+ | su - root | ||
+ | vi / | ||
+ | ---- | ||
+ | : | ||
+ | [Date] | ||
+ | ; Defines the default timezone used by the date functions | ||
+ | ; https:// | ||
+ | date.timezone = " | ||
+ | : | ||
+ | ---- | ||
+ | vi / | ||
+ | ---- | ||
+ | : | ||
+ | [Date] | ||
+ | ; Defines the default timezone used by the date functions | ||
+ | ; https:// | ||
+ | date.timezone = " | ||
+ | : | ||
+ | ---- | ||
+ | su - librenms | ||
+ | ./daily.sh | ||
+ | ./ | ||
+ | su - root | ||
+ | chown -R librenms: | ||
+ | chmod -R ug=rwX / | ||
+ | usermod -a -G librenms www-data | ||
+ | su - librenms | ||
+ | </ | ||
+ | librenms@ct-librenms: | ||
+ | =========================================== | ||
+ | Component | Version | ||
+ | --------- | ------- | ||
+ | LibreNMS | ||
+ | DB Schema | 2022_09_03_091314_update_ports_adsl_table_with_defaults (246) | ||
+ | PHP | 8.1.11 | ||
+ | Python | ||
+ | Database | ||
+ | RRDTool | ||
+ | SNMP | 5.8 | ||
+ | =========================================== | ||
+ | |||
+ | [OK] Composer Version: 2.4.2 | ||
+ | [OK] Dependencies up-to-date. | ||
+ | [OK] Database connection successful | ||
+ | [OK] Database Schema is current | ||
+ | [OK] SQL Server meets minimum requirements | ||
+ | [OK] lower_case_table_names is enabled | ||
+ | [OK] MySQL engine is optimal | ||
+ | [OK] | ||
+ | [OK] Database schema correct | ||
+ | [OK] MySQl and PHP time match | ||
+ | [OK] Active pollers found | ||
+ | [OK] Dispatcher Service not detected | ||
+ | [OK] Locks are functional | ||
+ | [OK] Python poller wrapper is polling | ||
+ | [OK] Redis is unavailable | ||
+ | [OK] rrd_dir is writable | ||
+ | [OK] rrdtool version ok | ||
+ | </ | ||
===== 參考網址 ==== | ===== 參考網址 ==== | ||
* https:// | * https:// | ||
行 403: | 行 599: | ||
* https:// | * https:// | ||
- | {{tag> | + | {{tag> |