Monitoring

In diesem Abschnitt beschäftigen Wir uns mit dem Monitoring von Windowsmaschinen unter Verwendung von Nagios.

Das ganze hängt, speziell für diesen Part, von nsclient++ (64Bit)  ab.
nsclient++ ist fast analog zu nrpe zu konfigurieren.

BSP: C:\Program Files\NSClient++
Hier verzichten wir auf die Build In’s des Clients.

; Undocumented section
[/modules]
NRPEServer=enabled

; Undocumented key
CheckDisk = 0

; Undocumented key
CheckEventLog = 0

; Undocumented key
CheckExternalScripts = 1

; Undocumented key
CheckHelpers = 1

; Undocumented key
CheckNSCP = 0

; Undocumented key
CheckSystem = 0

[/settings/default]
# allowed hosts = 10.0.0.0/8
allowed hosts = 10.1.0.0/8,192.168.0.0/16
cache allowed hosts = true
password = CHECK_NT PASSWORD
timeout = 90
allow arguments=true

[/settings/NRPE/server]
allow arguments = true
## allow nasty characters = 1

[/settings/external scripts]
allow arguments=true
## allow nasty characters=true
timeout = 60

[/settings/external scripts/wrappings]
ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -
## ps1 = scripts\cmd\pswrapper.cmd \%SCRIPT% %ARGS%

[/settings/external scripts/wrapped scripts]
## CHECK SCRIPTS ########################

check_disk_usage=check_disk_usage.ps1 $ARG1$ $ARG2$
check_service_load=check_service_load.ps1 $ARG1$ $ARG2$
check_disk_queue=check_disk_queue.ps1 $ARG1$ $ARG2$
check_mailq=check_mailq.ps1 $ARG1$ $ARG2$ 
check_cpu_usage=check_cpu_usage.ps1 $ARG1$ $ARG2$ 
check_mem_usage=check_mem_usage.ps1 $ARG1$ $ARG2$ $ARG3$
check_eventlog=check_eventlog.ps1 CRITICAL $ARG1$ $ARG2$
check_procs=check_procs.ps1 '$ARG1$'
check_file_size=check_file_size.ps1 $ARG1$ $ARG2$
check_eventlog_id=check_eventlog_id.ps1 $ARG1$ $ARG2$


## EVENTHANDLER #######################
restart_by_nrpe=restart.ps1 '$ARG1$'

Folgender Abschnitt ist essentiel um externen Code über nsclient++ auszuführen

[/settings/external scripts/wrappings]
ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -
## ps1 = scripts\cmd\pswrapper.cmd \%SCRIPT% %ARGS%