差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

兩邊的前次修訂版 前次修改
下次修改
前次修改
tech:librenms:nagios_agent [2021/04/20 19:48] jonathantech:librenms:nagios_agent [2023/04/08 11:05] (目前版本) – [檢查網址回應效率與關鍵字] jonathan
行 3: 行 3:
   * 返回 [[tech:librenms]]   * 返回 [[tech:librenms]]
  
-===== CentOS 7 ===== +===== 安裝語法 ===== 
-  * 安裝語法 <cli>+  * CentOS 7 <cli>
 yum install nagios-plugins-all yum install nagios-plugins-all
 </cli> </cli>
- +  * Ubuntu 20.04 <cli>
-===== Ubuntu 20.04 ===== +
-  * 安裝語法 <cli>+
 sudo apt install nagios-plugins sudo apt install nagios-plugins
 </cli> </cli>
  
 ===== 進行設定 ===== ===== 進行設定 =====
 +==== CentOS 7 ====
   * 更改設定檔 <code sh>vi /opt/librenms/config.php</code><file>   * 更改設定檔 <code sh>vi /opt/librenms/config.php</code><file>
 : :
行 23: 行 21:
 chmod +x /usr/lib64/nagios/plugins/* chmod +x /usr/lib64/nagios/plugins/*
 </code> </code>
 +
 +==== Ubuntu 20.04 ====
 +  * 更改設定檔 <code sh>vi /opt/librenms/config.php</code><file>
 +:
 +# nagios-plugins
 +$config['show_services'          = 1;
 +$config['nagios_plugins'  = "/usr/lib/nagios/plugins";
 +</file><code sh>
 +chmod +x /usr/lib/nagios/plugins/*
 +</code>
 +
 +===== 共同設定 =====
   * 設定定時起動 services-wrapper.py <code sh>vi /etc/cron.d/librenms</code><file>   * 設定定時起動 services-wrapper.py <code sh>vi /etc/cron.d/librenms</code><file>
 : :
行 29: 行 39:
 # Daily maintenance script. DO NOT DISABLE! # Daily maintenance script. DO NOT DISABLE!
 : :
-</file><code sh>+</file> 
 +  * CentOS 7<code sh>
 service crond restart service crond restart
 </code> </code>
 +  * Ubuntu 20.04 <cli>
 +systemctl restart cron 
 +</cli>
   * 可以透過 Add Service 增加設定檢查 SSL 憑證到期日, mail 服務運作是否正常...等等的設定   * 可以透過 Add Service 增加設定檢查 SSL 憑證到期日, mail 服務運作是否正常...等等的設定
     * {{:tech:2019010801.png}}     * {{:tech:2019010801.png}}
行 133: 行 147:
 </file> </file>
  
-===== 檢查網址應效率 =====+===== 檢查網址應效率與關鍵字 =====
   * 檢查特定網址的回應效率與正確性 .. Exp. https://172.16.1.32/erptools/Tracing_material.php   * 檢查特定網址的回應效率與正確性 .. Exp. https://172.16.1.32/erptools/Tracing_material.php
     * 參考網址 - https://raymii.org/s/tutorials/Service_checks_in_LibreNMS_nagios_plugins.html     * 參考網址 - https://raymii.org/s/tutorials/Service_checks_in_LibreNMS_nagios_plugins.html
行 140: 行 154:
       * -E : 額外的效能資料       * -E : 額外的效能資料
       * -I : 指定特定的 IP (Exp. 網站內部外部 IP 不同)       * -I : 指定特定的 IP (Exp. 網站內部外部 IP 不同)
-      * -S : 使用 SSL 加密協定 (https)+      * -S : 使用 SSL 加密協定 (https) **如有出現 Cannot make SSL connection 錯誤訊息可加上 --sni** Exp. <cli>--sni -S</cli>
       * -p 443 : 使用連線埠 443       * -p 443 : 使用連線埠 443
       * -u : 要進行效能檢核的網址       * -u : 要進行效能檢核的網址
  • tech/librenms/nagios_agent.1618919296.txt.gz
  • 上一次變更: 2021/04/20 19:48
  • jonathan