Page 3 of 3

Re: Check Windows Files

Posted: Tue Oct 18, 2016 12:54 pm
by rkennedy
You'll want to make sure this part is enabled under the NRPE section. NSClient++ is really picky where things are located.

Code: Select all

allow arguments = true
allow nasty characters = true
For when you're getting the can't open file error, try this -

Code: Select all

check_files_win = C:\Python27\python.exe 'C:\Program Files\NSClient++\scripts\check_files_win.py' C:\xyz.txt C:\abc.txt
The single quotes will make sure it doesn't see Files\ as a new line.

Re: Check Windows Files

Posted: Tue Oct 18, 2016 1:03 pm
by rlinux57
It's already under nrpe section:

Code: Select all

[/settings/NRPE/server]

; Undocumented key
 ssl options = no-sslv2,no-sslv3

; Undocumented key
; verify mode = peer-cert
verify mode = none
; Undocumented key
insecure = true
allow arguments = true
allow nasty characters = true
Tried with single quote:

Code: Select all

[/settings/external scripts/scripts]
check_files_win = C:\Python27\python.exe 'C:\Program Files\NSClient++\scripts\check_files_win.py' C:\xyz.txt C:\abc.txt

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H WinIP -t 40 -c check_files_win
Output:
C:\Python27\python.exe: can't open file ''C:\Program': [Errno 22] Invalid argument

Re: Check Windows Files

Posted: Tue Oct 18, 2016 1:06 pm
by rlinux57
Yes got it. Thanks a lot for your nagios team cooperation :)

Works with double quotes :D

Code: Select all

[/settings/external scripts/scripts]
check_files_win = C:\Python27\python.exe "C:\Program Files\NSClient++\scripts\check_files_win.py" C:\xyz.txt C:\abc.txt
Output:
CRITICAL [email protected]
CRITICAL [email protected]

Re: Check Windows Files

Posted: Tue Oct 18, 2016 1:51 pm
by dwhitfield
Awesome! Is it okay if we lock this thread? Thanks for choosing the Nagios forums!

Re: Check Windows Files

Posted: Tue Oct 18, 2016 1:56 pm
by rlinux57
Yes you can locked it.