Using NRPE with Windows hosts

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Using NRPE with Windows hosts

Post by neworderfac33 »

Good afternoon,

I have attempted to follow the instructions in https://assets.nagios.com/downloads/nag ... 1484833902 to allow me to use check_nrpe to monitor Windows hosts.

Here is my resulting NSClient++.ini

Code: Select all

# 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 <MODULE NAME> --add-defaults
# For details run: nscp settings --help


; Undocumented section
[/settings/default]

; ALLOWED HOSTS - A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.
allowed hosts = 88.88.88.88,99.99.99.99


; Undocumented section
[/modules]
NRPEListener.dll
NSClientListener.dll
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
CheckEventLog.dll
CheckHelpers.dll
CheckExternalScripts.dll


; Undocumented key
CheckExternalScripts = 0

; Undocumented key
CheckHelpers = 0

; Undocumented key
CheckNSCP = 0

; Undocumented key
CheckDisk = 0

; Undocumented key
CheckSystem = 0

; Undocumented key
NSClientServer = 0

; Undocumented key
CheckEventLog = 0

; Undocumented key
NSCAClient = 0

; Undocumented key
Scheduler = 0

; Undocumented key
NRPEServer = 0


[NRPE]
allow_arguments = 1
allow_nasty_meta_chars = 1

; Undocumented key
Scheduler = 0

; CheckSystem - Various system related checks, such as CPU load, process state, service state memory usage and PDH counters.
CheckSystem = 1

; NSClientServer - A server that listens for incoming check_nt connection and processes incoming requests.
NSClientServer = 1

; CheckExternalScripts - Execute external scripts
CheckExternalScripts = 1
allow_arguments=1
allow_nasty_meta_chars=1

; CheckHelpers - Various helper function to extend other checks.
CheckHelpers = 1

; CheckEventLog - Check for errors and warnings in the event log.
CheckEventLog = 1

; CheckNSCP - Use this module to check the healt and status of NSClient++ it self
CheckNSCP = 1

; CheckDisk - CheckDisk can check various file and disk related things.
CheckDisk = 1

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

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

; WRAPPING - An external script wrapping
bat = scripts\\%SCRIPT% %ARGS%

; WRAPPING - An external script wrapping
An alias is an internal command that has been predefined to provide a single command without arguments. Be careful so you don't create loops (ie check_loop = check_a, check_a=check_loop)

; WRAPPING - An external script wrapping
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%


[/settings/external scripts/alias]

; ALIAS - Query alias
alias_volumes_loose = check_drivesize

; ALIAS - Query alias
alias_volumes = check_drivesize

; ALIAS - Query alias
alias_sched_all = check_tasksched show-all "syntax=${title}: ${exit_code}" "crit=exit_code ne 0"

; ALIAS - Query alias
alias_process_stopped = check_process "process=$ARG1$" "crit=state != 'stopped'"

; ALIAS - Query alias
alias_service = check_service

; ALIAS - Query alias
alias_process_hung = check_process "filter=is_hung" "crit=count>0"

; ALIAS - Query alias
alias_process_count = check_process "process=$ARG1$" "warn=count > $ARG2$" "crit=count > $ARG3$"

; ALIAS - Query alias
alias_process = check_process "process=$ARG1$" "crit=state != 'started'"

; ALIAS - Query alias
alias_mem = check_memory

; ALIAS - Query alias
alias_file_size = check_files "path=$ARG1$" "crit=size > $ARG2$" "top-syntax=${list}" "detail-syntax=${filename] ${size}" max-dir-depth=10

; ALIAS - Query alias
alias_event_log = check_eventlog

; ALIAS - Query alias
alias_service_ex = check_service "exclude=Net Driver HPZ12" "exclude=Pml Driver HPZ12" exclude=stisvc

; ALIAS - Query alias
alias_disk = check_drivesize

; ALIAS - Query alias
alias_file_age = check_files "path=$ARG1$" "crit=written > $ARG2$" "top-syntax=${list}" "detail-syntax=${filename] ${written}" max-dir-depth=10

; ALIAS - Query alias
alias_cpu_ex = check_cpu "warn=load > $ARG1$" "crit=load > $ARG2$" time=5m time=1m time=30s

; ALIAS - Query alias
alias_cpu = check_cpu

; ALIAS - Query alias
alias_up = check_uptime

; ALIAS - Query alias
alias_disk_loose = check_drivesize

; ALIAS - Query alias
alias_sched_task = check_tasksched show-all "filter=title eq '$ARG1$'" "detail-syntax=${title} (${exit_code})" "crit=exit_code ne 0"

; ALIAS - Query alias
alias_sched_long = check_tasksched "filter=status = 'running'" "detail-syntax=${title} (${most_recent_run_time})" "crit=most_recent_run_time < -$ARG1$"
I restarted the NSClient++(x64) service, but now get the following:

Code: Select all

 ./check_nrpe -H 44.44.44.44 -t 30 -c check_drivesize -a drive=C: 'warning=free<10G' 'critical=free<ve_or_name} ${free} free / ${size} total}' top-syntax='${status}: ${problem_list}'
connect to address 44.44.44.44 port 5666: Connection refused
Can anyone see where I'm going wrong, please?

Thanks in advance

Pete
Last edited by dwhitfield on Thu Feb 23, 2017 11:07 am, edited 1 time in total.
Reason: marking with green check mark
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Using NRPE with Windows hosts

Post by rkennedy »

It looks like NRPE still isn't turned on -

Code: Select all

; Undocumented key
NRPEServer = 0

Then restart NSClient++ and try once again. I suspect it'll work. If not, show us the output of netstat -an | findstr 5666 on the Windows machine.
Former Nagios Employee
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Using NRPE with Windows hosts

Post by neworderfac33 »

Thanks for the prompt reply - having changed the value from 0 to 1 and restarted the service, I'm now I'm getting:

Code: Select all

 ./check_nrpe -H 44.44.44.44 -t 30 -c check_drivesize -a drive=C: 'warning=free<10G' 'critical=free<5G' show-all 'perf-config=*(unit:G)' detail-syntax='{${drive_or_name} ${free} free / ${size} total}' top-syntax='${status}: ${problem_list}'
CHECK_NRPE: Error - Could not complete SSL handshake.

Code: Select all

C:\software>netstat -an | findstr 5666
  TCP    0.0.0.0:5666           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:5666           0.0.0.0:0              LISTENING
  TCP    [::]:5666              [::]:0                 LISTENING
I SEEM to remember a long time ago needing to install the plugins with an -ssl parameter to stop this from happening on my 4.0.8 installation, but when I tried this in my new 4.2.4, I got an error message, so didn't pursue it. However, I've tried the same command from my 4.0.8 instance and i get the same response.

Thanks

Pete
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Using NRPE with Windows hosts

Post by rkennedy »

What error do you see in the nsclient.log file? This may tell us more.

What version is your NRPE plugin? /usr/local/nagios/libexec/check_nrpe -v

What version of NSClient++ did you install?
Former Nagios Employee
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Using NRPE with Windows hosts

Post by neworderfac33 »

Code: Select all

NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 2.15
Last Modified: 09-06-2013
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required

Code: Select all

NSClient++ on remote host is version 0.4.3.143
Log:

Code: Select all

2017-02-16 15:51:48: error:D:\source\nscp\modules\NRPEServer\NRPEServer.cpp:132: Certificate not found: C:\Program Files\NSClient++/security/certificate.pem (generating a default certificate)
2017-02-16 15:51:48: error:D:\source\nscp\modules\NRPEServer\NRPEServer.cpp:132: CA not found: C:\Program Files\NSClient++/security/ca.pem (generating a default CA)
2017-02-16 15:52:56: error:D:\source\nscp\include\socket/connection.hpp:240: Seems we cant agree on SSL: no shared cipher
2017-02-16 15:52:56: error:D:\source\nscp\include\socket/connection.hpp:241: PLease review the legacy as well as ssl options in settings.
2017-02-16 16:19:27: error:D:\source\nscp\include\socket/connection.hpp:240: Seems we cant agree on SSL: no shared cipher
2017-02-16 16:19:27: error:D:\source\nscp\include\socket/connection.hpp:241: PLease review the legacy as well as ssl options in settings.

Thanks

Pete
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Using NRPE with Windows hosts

Post by tgriep »

It looks like some settings in the nsclient.ini file needs to be changed to work with the check_nrpe command
Can you edit the nsclient.ini file and under this section

Code: Select all

[/settings/NRPE/server]
Set the options to the following

Code: Select all

ssl options = 
verify mode = none
insecure = true
allow arguments = true
allow nasty characters = true
use ssl = 1
port = 5666
extended response = 0
Save the nsclient.ini file and restart the service on the windows system.

If it still fails, can you post your nsclient.ini file so we can view it?
Be sure to check out our Knowledgebase for helpful articles and solutions!
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Using NRPE with Windows hosts

Post by neworderfac33 »

Still failing, folks :-(

Code: Select all

# 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 <MODULE NAME> --add-defaults
# For details run: nscp settings --help


; Undocumented section
[/settings/default]

; ALLOWED HOSTS - A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.
allowed hosts = 44.44.44.44,55.55.55.55

; Undocumented section
[/modules]
NRPEListener.dll
NSClientListener.dll
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
CheckEventLog.dll
CheckHelpers.dll
CheckExternalScripts.dll


; Undocumented key
CheckExternalScripts = 0

; Undocumented key
CheckHelpers = 0

; Undocumented key
CheckNSCP = 0

; Undocumented key
CheckDisk = 0

; Undocumented key
CheckSystem = 0

; Undocumented key
NSClientServer = 0

; Undocumented key
CheckEventLog = 0

; Undocumented key
NSCAClient = 0

; Undocumented key
Scheduler = 0

; Undocumented key
NRPEServer = 1


[NRPE]
ssl options = 
verify mode = none
insecure = true
allow_arguments = true
allow_nasty_meta_chars = true
use ssl = 1
port = 5666
extended response = 0


; Undocumented key
Scheduler = 0

; CheckSystem - Various system related checks, such as CPU load, process state, service state memory usage and PDH counters.
CheckSystem = 1

; NSClientServer - A server that listens for incoming check_nt connection and processes incoming requests.
NSClientServer = 1

; CheckExternalScripts - Execute external scripts
CheckExternalScripts = 1
allow_arguments=1
allow_nasty_meta_chars=1

; CheckHelpers - Various helper function to extend other checks.
CheckHelpers = 1

; CheckEventLog - Check for errors and warnings in the event log.
CheckEventLog = 1

; CheckNSCP - Use this module to check the healt and status of NSClient++ it self
CheckNSCP = 1

; CheckDisk - CheckDisk can check various file and disk related things.
CheckDisk = 1


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

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

; WRAPPING - An external script wrapping
bat = scripts\\%SCRIPT% %ARGS%

; WRAPPING - An external script wrapping
An alias is an internal command that has been predefined to provide a single command without arguments. Be careful so you don't create loops (ie check_loop = check_a, check_a=check_loop)

; WRAPPING - An external script wrapping
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%


[/settings/external scripts/alias]

; ALIAS - Query alias
alias_volumes_loose = check_drivesize

; ALIAS - Query alias
alias_volumes = check_drivesize

; ALIAS - Query alias
alias_sched_all = check_tasksched show-all "syntax=${title}: ${exit_code}" "crit=exit_code ne 0"

; ALIAS - Query alias
alias_process_stopped = check_process "process=$ARG1$" "crit=state != 'stopped'"

; ALIAS - Query alias
alias_service = check_service

; ALIAS - Query alias
alias_process_hung = check_process "filter=is_hung" "crit=count>0"

; ALIAS - Query alias
alias_process_count = check_process "process=$ARG1$" "warn=count > $ARG2$" "crit=count > $ARG3$"

; ALIAS - Query alias
alias_process = check_process "process=$ARG1$" "crit=state != 'started'"

; ALIAS - Query alias
alias_mem = check_memory

; ALIAS - Query alias
alias_file_size = check_files "path=$ARG1$" "crit=size > $ARG2$" "top-syntax=${list}" "detail-syntax=${filename] ${size}" max-dir-depth=10

; ALIAS - Query alias
alias_event_log = check_eventlog

; ALIAS - Query alias
alias_service_ex = check_service "exclude=Net Driver HPZ12" "exclude=Pml Driver HPZ12" exclude=stisvc

; ALIAS - Query alias
alias_disk = check_drivesize

; ALIAS - Query alias
alias_file_age = check_files "path=$ARG1$" "crit=written > $ARG2$" "top-syntax=${list}" "detail-syntax=${filename] ${written}" max-dir-depth=10

; ALIAS - Query alias
alias_cpu_ex = check_cpu "warn=load > $ARG1$" "crit=load > $ARG2$" time=5m time=1m time=30s

; ALIAS - Query alias
alias_cpu = check_cpu

; ALIAS - Query alias
alias_up = check_uptime

; ALIAS - Query alias
alias_disk_loose = check_drivesize

; ALIAS - Query alias
alias_sched_task = check_tasksched show-all "filter=title eq '$ARG1$'" "detail-syntax=${title} (${exit_code})" "crit=exit_code ne 0"

; ALIAS - Query alias
alias_sched_long = check_tasksched "filter=status = 'running'" "detail-syntax=${title} (${most_recent_run_time})" "crit=most_recent_run_time < -$ARG1$"
Cheers
Pete
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Using NRPE with Windows hosts

Post by tgriep »

There are a lot of errors in your nsclient.ini file and the simplest way is to replace all of the contents with the following and adding the IP address of the Nagios server in the correct location.

Code: Select all

# 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 <MODULE NAME> --add-defaults
# For details run: nscp settings --help


; Undocumented section
[/settings/default]

; PASSWORD - Password used to authenticate against server
password = password

; ALLOWED HOSTS - A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.
allowed hosts = 44.44.44.44

; CACHE ALLOWED HOSTS - If host names (DNS entries) should be cached, improves speed and security somewhat but won't allow you to have dynamic IPs for your Nagios server.
cache allowed hosts = 1

; TIMEOUT - Timeout when reading packets on incoming sockets. If the data has not arrived within this time we will bail out.
timeout = 30


[/settings/external scripts]
allow arguments = true
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


; Undocumented section
[/settings/NRPE/server]

; VERIFY MODE - Comma separated list of verification flags to set on the SSL socket.  default-workarounds	Various workarounds for what I understand to be broken ssl implementations no-sslv2	Do not use the SSLv2 protocol. no-sslv3	Do not use the SSLv3 protocol. no-tlsv1	Do not use the TLSv1 protocol. single-dh-use	Always create a new key when using temporary/ephemeral DH parameters. This option must be used to prevent small subgroup attacks, when the DH parameters were not generated using "strong" primes (e.g. when using DSA-parameters).   
ssl options = 

; VERIFY MODE - Comma separated list of verification flags to set on the SSL socket.  none	The server will not send a client certificate request to the client, so the client will not send a certificate. peer	The server sends a client certificate request to the client and the certificate returned (if any) is checked. fail-if-no-cert	if the client did not return a certificate, the TLS/SSL handshake is immediately terminated. This flag must be used together with peer. peer-cert	Alias for peer and fail-if-no-cert. workarounds	Various bug workarounds. single	Always create a new key when using tmp_dh parameters. client-once	Only request a client certificate on the initial TLS/SSL handshake. This flag must be used together with verify-peer   
verify mode = none

; ALLOW INSECURE CHIPHERS and ENCRYPTION - Only enable this if you are using legacy check_nrpe client.
insecure = true
allow arguments = true
allow nasty characters = true

; ENABLE SSL ENCRYPTION - This option controls if SSL should be enabled.
use ssl = 1

; PORT NUMBER - Port to use for NRPE.
port = 5666

; EXTENDED RESPONSE - Send more then 1 return packet to allow response to go beyond payload size (requires modified client if legacy is true this defaults to false).
extended response = 0

; Undocumented section
[/modules]

; NRPEServer - A server that listens for incoming NRPE connection and processes incoming requests.
NRPEServer = 1

; CheckSystem - Various system related checks, such as CPU load, process state, service state memory usage and PDH counters.
CheckSystem = 1

; NSClientServer - A server that listens for incoming check_nt connection and processes incoming requests.
NSClientServer = 0

; CheckExternalScripts - Execute external scripts
CheckExternalScripts = 1

; CheckHelpers - Various helper function to extend other checks.
CheckHelpers = 1

; CheckEventLog - Check for errors and warnings in the event log.
CheckEventLog = 1

; CheckNSCP - Use this module to check the healt and status of NSClient++ it self
CheckNSCP = 0

; CheckDisk - CheckDisk can check various file and disk related things.
CheckDisk = 1
CheckTaskSched = 1
WEBServer = 0

; Configure log properties.
[/settings/log]

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

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

; DATEMASK - The size of the buffer to use when getting messages this affects the speed and maximum size of messages you can recieve.
date format = %Y-%m-%d %H:%M:%S


[/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 = 2048000


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

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

; WRAPPING - An external script wrapping


; WRAPPING - An external script wrapping
bat = scripts\\%SCRIPT% %ARGS%

; WRAPPING - An external script wrapping
An alias is an internal command that has been predefined to provide a single command without arguments. Be careful so you don't create loops (ie check_loop = check_a, check_a=check_loop)

; WRAPPING - An external script wrapping
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%


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


[/settings/external scripts/alias]

; ALIAS - Query alias
alias_volumes_loose = check_drivesize

; ALIAS - Query alias
alias_volumes = check_drivesize

; ALIAS - Query alias
alias_sched_all = check_tasksched show-all "syntax=${title}: ${exit_code}" "crit=exit_code ne 0"

; ALIAS - Query alias
alias_process_stopped = check_process "process=$ARG1$" "crit=state != 'stopped'"

; ALIAS - Query alias
alias_service = check_service

; ALIAS - Query alias
alias_process_hung = check_process "filter=is_hung" "crit=count>0"

; ALIAS - Query alias
alias_process_count = check_process "process=$ARG1$" "warn=count > $ARG2$" "crit=count > $ARG3$"

; ALIAS - Query alias
alias_process = check_process "process=$ARG1$" "crit=state != 'started'"

; ALIAS - Query alias
alias_mem = check_memory

; ALIAS - Query alias
alias_file_size = check_files "path=$ARG1$" "crit=size > $ARG2$" "top-syntax=${list}" "detail-syntax=${filename] ${size}" max-dir-depth=10

; ALIAS - Query alias
alias_disk = check_drivesize

; ALIAS - Query alias
alias_cpu_ex = check_cpu "warn=load > $ARG1$" "crit=load > $ARG2$" time=5m time=1m time=30s

; ALIAS - Query alias
alias_file_age = check_files "path=$ARG1$" "crit=written > $ARG2$" "top-syntax=${list}" "detail-syntax=${filename] ${written}" max-dir-depth=10

; ALIAS - Query alias
alias_cpu = check_cpu

; ALIAS - Query alias
;alias_event_log = check_eventlog
;alias_event_log = check_eventlog file=security file=application file=system "filter=level in ('error', 'Audit Failure') AND generated > -5m"
alias_event_log = CheckEventLog file=security file=application MaxWarn=1 MaxCrit=1 "filter=level in ('error', 'Audit Failure') AND generated > -5m"

; ALIAS - Query alias
alias_service_ex = check_service "exclude=Net Driver HPZ12" "exclude=Pml Driver HPZ12" exclude=stisvc

; ALIAS - Query alias
alias_up = check_uptime

; ALIAS - Query alias
alias_disk_loose = check_drivesize

; ALIAS - Query alias
alias_sched_task = check_tasksched show-all "filter=title eq '$ARG1$'" "detail-syntax=${title} (${exit_code})" "crit=exit_code ne 0"

; ALIAS - Query alias
alias_sched_long = check_tasksched "filter=status = 'running'" "detail-syntax=${title} (${most_recent_run_time})" "crit=most_recent_run_time < -$ARG1$"


[/settings/external scripts/scripts]


; Section for NSClient (NSClientServer.dll) (check_nt) protocol options.
[/settings/NSClient/server]

; ENABLE SSL ENCRYPTION - This option controls if SSL should be enabled.
use ssl = 0

; PERFORMANCE DATA - Send performance data back to Nagios (set this to 0 to remove all performance data).
performance data = 1

; PORT NUMBER - Port to use for check_nt.
port = 12489


; Schedule definition for: Cpu Usage
[/settings/scheduler/schedules/Cpu Usage]


; Section for the EventLog Checker (CheckEventLog.dll).
[/settings/eventlog]

; DEBUG - Log more information when filtering (useful to detect issues with filters) not useful in production as it is a bit of a resource hog.
debug = 0

; BUFFER_SIZE - The size of the buffer to use when getting messages this affects the speed and maximum size of messages you can recieve.
buffer size = 131072

; LOOKUP NAMES - Lookup the names of eventlog files
lookup names = 1


; Files to be included in the configuration
[/includes]


; A set of filters to use in real-time mode
[/settings/eventlog/real-time/filters]


[/paths]

; Path for shared-path - 
shared-path = C:\Program Files\NSClient++

; Path for crash-folder - 
crash-folder = C:\Program Files\NSClient++

; Path for certificate-path - 
certificate-path = ${shared-path}/security

; Path for module-path - 
module-path = ${shared-path}/modules

; Path for base-path - 
base-path = C:\Program Files\NSClient++

If that fails, you can create a new nsclient.ini file by logging in to the Windows system and doing the following.
Open a command prompt
Type cd "\Program Files\NSClient++\" and press Enter
First we'll delete the existing file
Type del nsclient.ini and press Enter
Create the file with defaults

Code: Select all

nscp settings --generate --add-defaults --load-all
nscp settings --activate-module NRPEServer --add-defaults
nscp settings --path /settings/NRPE/server --key "allow arguments" --set true
nscp settings --path /settings/NRPE/server --key "allow nasty characters" --set true
nscp settings --path /settings/NRPE/server --key insecure --set true
nscp settings --activate-module CheckHelpers --add-defaults
nscp settings --activate-module CheckDisk --add-defaults
nscp settings --path /settings/default --key "allowed hosts" --set "127.0.0.1,xxx.xxx.xxx.xxx"
In the last command, replace xxx.xxx.xxx.xxx with the IP address of the nagios server.
Try that and let us know if this works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Using NRPE with Windows hosts

Post by neworderfac33 »

Yep, I got there using your new NSClient.ini, once I'd commented out the password reference and changed NSClientServer from 0 to 1, to enable my check_nt based services to work.

The ini file I provided (and which you modified) came from a 2012 server, and I've just confirmed that it also works on a 2008 server too.

Now, can anyone help me with defining a chck_nrpe service to monitor disk space on a Windows host - i can find lots of examples on how to do it on a Linux host (which I already know how to do), but not much for a specified drive on a Windows host?

(That was a brilliant response and turnaround, by the way - thank you VERY much! :-) )

Pete
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Using NRPE with Windows hosts

Post by tgriep »

Your very welcome. Glad it is working.
I do have an example of using check_nrpe to monitor the disk space.
The example below monitors all fixed drives and sens a warning at 10% and critical at 5%

Code: Select all

check_nrpe -H xxx.xxx.xxx.xxx -c check_drivesize -a "filter=type = 'fixed' and drive regexp '.*[C-Z].*'" "warn=free<10%" "crit=free<5%"
This example only checks the C Drive

Code: Select all

check_nrpe -H xxx.xxx.xxx.xxx -c check_drivesize -a 'drive=c:\
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked