Check Windows Files

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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check Windows Files

Post 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.
Former Nagios Employee
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check Windows Files

Post 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
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check Windows Files

Post 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]
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Check Windows Files

Post by dwhitfield »

Awesome! Is it okay if we lock this thread? Thanks for choosing the Nagios forums!
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check Windows Files

Post by rlinux57 »

Yes you can locked it.
Locked