差異處
這裏顯示兩個版本的差異處。
兩邊的前次修訂版 前次修改 下次修改 | 前次修改 | ||
tech:librenms [2022/09/29 09:24] – [升級 php 至 8.1 以上版本] 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 通知 ++設定畫面參考| \\ {{: | ||
行 417: | 行 422: | ||
apt install software-properties-common && add-apt-repository ppa: | apt install software-properties-common && add-apt-repository ppa: | ||
apt update && apt upgrade -y | apt update && apt upgrade -y | ||
- | apt install php8.1 php8.1-fpm php8.1-cli -y | + | apt install php8.1 php8.1-fpm php8.1-cli |
apt autoremove -y | apt autoremove -y | ||
systemctl status php8.1-fpm | systemctl status php8.1-fpm | ||
行 439: | 行 444: | ||
* 關閉 7.4 版的 php-fpm< | * 關閉 7.4 版的 php-fpm< | ||
root@ct-librenms: | 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 檔案< | * 確認 8.4 版的 php-fpm socket 檔案< | ||
行 460: | 行 469: | ||
* 重啟 nginx <cli> | * 重啟 nginx <cli> | ||
systemctl restart nginx.service | 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 | ||
</ | </ | ||
===== 參考網址 ==== | ===== 參考網址 ==== | ||
行 470: | 行 599: | ||
* https:// | * https:// | ||
- | {{tag> | + | {{tag> |