четверг, 1 февраля 2018 г.

NAGIOS vs Windows perfomance counters

На виндовс клиенте установить NSClient++, в nsclient.ini добавить:
 
[/settings/NRPE/server]
; Undocumented key
allow arguments=1
allow nasty characters=true

[/settings/external scripts]
allow_nasty_meta_chars=1
allow nasty characters=true

В консоли nagios сервера, для проверки:

/usr/lib/nagios/plugins/check_nrpe -t 60 -H win0.domain.local -c  CheckCounter -a "Counter=\PhysicalDisk(_Total)\Disk Reads/sec"
OK: \PhysicalDisk(_Total)\Disk Reads/sec = 582|'\PhysicalDisk(_Total)\Disk Reads/secnone'=582;0;0

Список счетчиков смотреть в perfmon.exe Graph -> Properties->Data

В конфигурации nagios:

/etc/nagios-plugins/config/check_nrpe.cfg

#### windows
#perfomance checks
define command {
        command_name    check_win_perf
        command_line    /usr/lib/nagios/plugins/check_nrpe -t 60 -H $HOSTADDRESS$ -c CheckCounter -a "$ARG1$"
}

-----------------------
/etc/nagios3/conf.d/servers/windows/win0.domain.local.conf

define service{
        use                             stats-service
        host_name                 win0.domain.local
        service_description   Total Disk Reads:
        check_command       check_win_perf!Counter=\\PhysicalDisk\(_Total\)\\Disk\ Reads\/sec
        contact_groups          net_admins, nw_admins
        icon_image                arkoon/arkoon-service-harddisk.png
        }