Nagios 安裝
LibreNMS 用第三方套件監控站台某些功能及服務,LibreNMS 是搭配 Nagios 套件來進行監控,或者您也可以自己寫這樣子的腳本來給 LibreNMS 來使用
- Debian \ Ubuntu
apt install monitoring-plugins
- CentOS
yum install nagios-plugins-all
- LibreNMS 的
config.php
設定檔上新增加 Nagios 服務
$config['show_services'] = 1;
-
新增加路徑
- Debian \ Ubuntu
$config['nagios_plugins'] = "/usr/lib/nagios/plugins";
- CentOS
$config['nagios_plugins'] = "/usr/lib64/nagios/plugins";
-
讓 Nagios 套件服務設定能執行權限
- Debian \ Ubuntu
chmod +x /usr/lib/nagios/plugins/*
- CentOS
chmod +x /usr/lib64/nagios/plugins/*
-
設定排程輪詢
vim /etc/cron.d/librenms
*/5 * * * * librenms /opt/librenms/services-wrapper.py 1
-
重啟排程服務
- Debian/Ubuntu
systemctl restart cron
- CentOS
systemctl restart crond