Icinga2 monitor windows host with nsclient++ software

Step I-On Window 2012:
download nsclient++
by go to http://www.nsclient.org/download/
then setup until on step choose module we need to choose as bellow:
 - Enable common check plugins
 - Enable nsclient server (check_nt)
 - Enable NRPE Server (check_nrpe)
Click Next to continue until finish
After finish we need to enable service nsclient (start or restart)
=>Open the Windows Services Manager and right click on NSClient go to Properties and then ‘Log On‘ tab and click the check box that says “Allow service to interact with the desktop“. If it isn’t already allowed, please check the box to allow it to.


Edit file nsclient.ini located at C:\programe files\NSClient++ directory
verify and edit similar with my file:
# If you want to fill this file with all avalible options run the following command:
#   nscp settings --generate --add-defaults --load-all
# If you want to activate a module and bring in all its options use:
#   nscp settings --activate-module  --add-defaults
# For details run: nscp settings --help

; Undocumented section
[/settings/default]

; Undocumented key
password = iloveyou

; Undocumented key
allowed hosts = 10.105.9.200

; Undocumented section
[/settings/NRPE/server]

; Undocumented key
ssl options = no-sslv2,no-sslv3
use SSL = 1
verify mode = none
port=5666

insecure = true
allow arguments= true
allow_nasty_meta_chars=1

[/modules]

; Undocumented key
CheckExternalScripts = 1

; Undocumented key
CheckHelpers = 1

; Undocumented key
CheckEventLog = 1

; Undocumented key
CheckNSCP = 1

; Undocumented key
CheckDisk = 1

; Undocumented key
CheckSystem = 1

; Undocumented key
NRPEServer = 1

[/settings/external scripts/alias]

; alias_cpu - Alias for alias_cpu. To configure this item add a section called: /settings/external scripts/alias/alias_cpu
alias_cpu = checkCPU warn=80 crit=90 time=5m time=1m time=30s

; alias_disk - Alias for alias_disk. To configure this item add a section called: /settings/external scripts/alias/alias_disk
alias_disk = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED

;check disk on drive E
alias_disk_e = CheckDriveSize MinWarn=10% MinCrit=5% FilterType=FIXED Drive=e
;check disk on drive c
alias_disk_c = CheckDriveSize MinWarn=10% MinCrit=5% FilterType=FIXED Drive=c

; alias_mem - Alias for alias_mem. To configure this item add a section called: /settings/external scripts/alias/alias_mem
alias_mem = checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical type=virtual type=paged type=page

; alias_process_count - Alias for alias_process_count. To configure this item add a section called: /settings/external scripts/alias/alias_process_count
alias_process_count = checkProcState MaxWarnCount=$ARG2$ MaxCritCount=$ARG3$ "$ARG1$=started"

; alias_service - Alias for alias_service. To configure this item add a section called: /settings/external scripts/alias/alias_service
alias_service = checkServiceState CheckAll

; alias_up - Alias for alias_up. To configure this item add a section called: /settings/external scripts/alias/alias_up
alias_uptime = checkUpTime MinWarn=0 MinCrit=0

; default - Alias for default. To configure this item add a section called: /settings/external scripts/alias/default
default = 

; Section for external scripts configuration options (CheckExternalScripts).
[/settings/external scripts]

; COMMAND ARGUMENT PROCESSING - This option determines whether or not the we will allow clients to specify arguments to commands that are executed.
allow arguments = true

; COMMAND ALLOW NASTY META CHARS - This option determines whether or not the we will allow clients to specify nasty (as in |`&><'"\[]{}) characters in arguments.
allow nasty characters = true

;COMMAND TIMEOUT - The maximum time in seconds that a command can execute. (if more then this execution will be aborted). NOTICE this only affects external commands not internal ones.
timeout = 60

[/settings/external scripts/wrapped scripts]
;check_files = check_files.vbs $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$ $ARG9$ $ARG10$ $ARG11$ $ARG12$ $ARG13$ $ARG14$

; A list of templates for wrapped scripts
[/settings/external scripts/wrappings]

; BATCH FILE WRAPPING - 
;bat = scripts\\%SCRIPT% %ARGS%

; POWERSHELL WRAPPING - 
;ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -

; VISUAL BASIC WRAPPING - 
;vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%
[/settings/log]
date mask = %Y-%m-%d %H:%M:%S

; FILENAME - The file to write log data to. Set this to none to disable log to file.
file name = nsclient.log

; LOG LEVEL - Log level to use. Avalible levels are error,warning,info,debug,trace
level = info

[/settings/log/file]

; MAXIMUM FILE SIZE - When file size reaches this it will be truncated to 50% if set to 0 (default) truncation will be disabled
max size = 50
After edit we must restart service nsclient++ again.

Step II-On Icinga2 Server:
-Define command object for window:
#vim /usr/share/icinga2/include/command-plugins.conf
Add the end of file
//define command for window
object CheckCommand "nrpe-check-cpu" {
       import "nrpe-common"
       vars.nrpe_command = "alias_cpu"#alias_cpu that is define on nsclient
}
object CheckCommand "nrpe-check-mem" {
        import "nrpe-common"
        vars.nrpe_command = "alias_mem"
}

object CheckCommand "nrpe-check-drive-c" {
       import "nrpe-common"
       vars.nrpe_command = "alias_disk_c"
}
object CheckCommand "nrpe-check-drive-e" {
        import "nrpe-common-windows"
        vars.nrpe_command = "alias_disk_e"
}
object CheckCommand "nrpe-check-uptime" {
       import "nrpe-common"
       vars.nrpe_command = "alias_uptime"
}
object CheckCommand "nrpe-check_total_service" {
        import "nrpe-common"
        vars.nrpe_command = "alias_service"
}
Then we add to the service of any window host by match your config service:
/etc/icinga2/conf.d/xm9200/services/window/xm9023.conf
object Service "ping4" {
    import "generic-service"
    host_name = "xm9023"
    check_command = "ping4"
    vars.sla = "24x7"
}
object Service "nrpe:Check_CPU" {#nrpe:Check_CPU use to display only
    import "generic-service"
    host_name = "xm9023"
    check_command = "nrpe-check-cpu"#name in command-plugins.conf
    vars.sla = "24x7"
}
object Service "nrpe:Check_Mem" {
    import "generic-service"
    host_name = "xm9023"
    check_command = "nrpe-check-mem"
    vars.sla = "24x7"
}
object Service "nrpe:Drive_C" {
    import "generic-service"
    host_name = "xm9023"
    check_command = "nrpe-check-drive-c"
    vars.sla = "24x7"
}
object Service "nrpe:Drive_E" {
    import "generic-service"
    host_name = "xm9023"
    check_command = "nrpe-check-drive-e"
    vars.sla = "24x7"
}
object Service "nrpe:check-uptime" {
    import "generic-service"
    host_name = "xm9023"
    check_command = "nrpe-check-uptime"
    vars.sla = "24x7"
}