Debian – Nagios NRPE plugin check_ad – Fixed

active-directorydebiannagioswindows-server-2003

i've reading about this problem much and trying to solve it on my own ways but still not luck.

I've running debian 7 as nagios server.
Problem is that i cant check state of my Active Directory Domain Controller (Win Server 2003) via this plugin based on nrpe scan – https://www.itefix.no/i2/check_ad

192.168.1.12 – my Domain Controller

NRPE on win server is working and listening correctly:

root@nagios:~ > check_nrpe -u -H 192.168.1.12 -p 5666
I (0,4,1,102 2013-07-15) seem to be doing fine...

but when i try to check AD via plugin it fails with this error:

root@nagios:~ > check_nrpe -u -H 192.168.1.12 -p 5666 -c check_ad
No handler for command: check_ad

By the way: i succesfuly run this command directly from win server:

Here is my NSClient++ config (I've enabled external script checking):
C:\Program Files\NSClient++\nsclient.ini

CheckExternalScripts = 1

and add this to bottom of file:

[NRPE Handlers]

check_ad=scripts\check_ad.exe --dc
check_ad_member=scripts\check_ad.exe –-member

Best Answer

I found solution. Looks like the nsclient has some troubles with running external commands. I didnt want to dig it even more so now i am using 2 nrpe servers on my ADDC. 1 - Standart NSClient++ for collecting information about Uptime, Storage and othet thinks. 2 - nrpe_nt.0.8b - for monitoring Active Directory state

Just download it to server and install it via:

cd C:\nrpe_nt.0.8b-bin\bin\
NRPE_NT.exe -i

then i've changed listening port into config file 'nrpe.cfg' so it wouldnt conflict with nsclient++

server_port=5667

Added ip address of this machine: server_address=192.168.1.12

Allow connections from my nagios server: allowed_hosts=192.168.1.250

Allow command arguments: dont_blame_nrpe=1

And finally add command 'check_ad': command[check_ad]=C:\nrpe_nt.0.8b-bin\bin\check_ad\check_ad.exe --member