簡體   English   中英

如何使用Icinga2檢查遠程服務器平均負載

[英]How to check remote server load average using Icinga2

Icinga2nagios plugins文件夾中存在一個名為check_load的腳本,該腳本為主機OS提供結果。 當我用-h調用腳本時,報告:

check_load v2.1.1 (monitoring-plugins 2.1.1)
Copyright (c) 1999 Felipe Gustavo de Almeida <galmeida@linux.ime.usp.br>
Copyright (c) 1999-2007 Monitoring Plugins Development Team
    <devel@monitoring-plugins.org>

This plugin tests the current system load average.

Usage:
check_load [-r] -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15

Options:
 -h, --help
    Print detailed help screen
 -V, --version
    Print version information
 --extra-opts=[section][@file]
    Read options from an ini file. See
    https://www.monitoring-plugins.org/doc/extra-opts.html
    for usage and examples.
 -w, --warning=WLOAD1,WLOAD5,WLOAD15
    Exit with WARNING status if load average exceeds WLOADn
 -c, --critical=CLOAD1,CLOAD5,CLOAD15
    Exit with CRITICAL status if load average exceed CLOADn
    the load average format is the same used by "uptime" and "w"
 -r, --percpu
    Divide the load averages by the number of CPUs (when possible)

Send email to help@monitoring-plugins.org if you have questions regarding
use of this software. To submit patches or suggest improvements, send email
to devel@monitoring-plugins.org

看起來沒有參數可作為主機地址傳遞。

問題是如何獲取遠程服務器的平均負載(1m,5m,15m)?

您可以使用nagios nrpe服務器/客戶端來查詢遠程主機

在服務器端(遠程主機)上:在/etc/nagios/nrpe.d/default.cfg

像這樣添加一行

command[system_load]=/usr/lib/nagios/plugins/check_load -r -w 100,20,30 -c 100,40,50

來自icinga的查詢是

/usr/lib/nagios/plugins/check_nrpe -H HOSTNAME -c system_load -t 30

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM