Home Directory Plugins Operating Systems Windows Active Directory (AD) Check

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com


Remember Me

Directory Tree

Active Directory (AD) Check

25 votes
Current Version
Last Release Date
Compatible With
  • Nagios 3.x
Check_AD.vbsOriginal Script
check_active_directory.vbsGerman edition by J.V.
check_ad.vbsLatest version. Merged all changes, fixes and enhancements into this edition
check_ad.txtDaniel Esteves has made some changes
check_ad.txtPhil Randal has made some changes
check_ad_french.vbs.txtFrench version by Alexandre Rigaud
check_ad_french.vbs.txtUpdated version by Alexandre Rigaud
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Wrapper for dcdiag.exe for Active Directory monitoring written in VBS.

This is a re-work of a script originally found here: http://felipeferreira.net/?p=315&cpage=1#comments

Only tested with Nagios 3.2.3. It should work on any version which supports reporting back via NRPE etc. Let me know how it works for you and I'll update the listing.

Works on English windows and should / could work on German, French and Spanish (Your milage may vary)
Usage: (with or without //nologo)
cscript Check_AD.vbs //nologo
cscript Check_AD.vbs //nologo /test:advertising
cscript Check_AD.vbs /test:ridmanager,services,fsmocheck

Output examples: (If one or more tests fail, CRITICAL is used as I have no idea which of these should be WARNING vs. CRITICAL. I'm assuming any failure is bad. Very bad)

Sample outputs:
OK - ridmanager: OK. services: OK. fsmocheck: OK.

CRITICAL - ridmanager: OK. services: CRITICAL. fsmocheck: OK.

CRITICAL - services: OK. replications: OK. advertising: OK. fsmocheck: OK. ridmanager: OK. machineaccount: OK. CheckSDRefDom: OK. CheckSecurityError: OK. CheckSDRefDom: OK. CrossRefValidation: OK. CutoffServers: OK. FrsEvent: CRITICAL. DFSREvent: OK. SysVolCheck: OK. LocatorCheck: OK. Intersite: OK. KccEvent: OK. KnowsOfRoleHolders: OK. NetLogons: OK. ObjectsReplicated: OK. OutboundSecureChannels: OK. Topology: OK. VerifyReferences: OK. VerifyReplicas: OK. NCSecDesc: OK.

Use dcdiag.exe /? to find out what checks YOUR version of Windows/dcdiag supports. 5 default checks are hardcoded within the script if no /test parameter is used. I don't claim they all work on all version of windows.

Email me at the address within the script for bug fixes etc. Tested on W2K8 x86 and W2K3 x64 using NSClient++ 2010-05-27 and the NRPE module.


Update: check_active_directory should work on German Windows thanks to the work by Jonathan Vogt.

Update #2: Jonathan Vogt has updated his version to autodetect the Windows language, English or German, and run accordingly.

Update #3: I've merged JV's edition and added support for multipartition checks. I've left the old vbscripts in case of issues.

Update #4: Forgot to turn off verbose logging. Fixed.

Update #5: Daniel Esteves: "Fixed a problem alert for failed status and support for DNS test parameters". Download check_ad.txt file for DE's Version.

Update #6: Phil Randal: Fix multiline parsing. Added connectivity, sysvol, and kccevent tests and "dns /dnsbasic" check on 2008 and later. Tested on Windows 2003, 2008 R2, and 2012 R2 DCs

Update #7: Alexandre Rigaud added support for French OS.

Update #8: Alexandre Rigaud added support for initial Spanish OS ++

Thanks goes to those who provide updates and feedback.

Reviews (22)
bypablo.garciaa, December 1, 2011
If you have NSClient++ instead NRPE_NT, follow this instructions:
-Edit NSC.ini at nsclient folder.
-Below the line [NRPE Handlers] add this:
command[check_activedir]=cscript "C:Program FilesNagios
sclientscriptsCheck_AD.vbs" //nologo /test:$ARG1$

where "check_activedir" is the parameter that you pass from nagios with -c option, and "$ARG1$" are the services that you want check with -a option (separated by commas).

In Nagios, inside commands.cfg, you must put:
/usr/local/nagios/libexec/check_nrpe -H $HOSTNAME$ -c check_activedir -t TIMEOUT -a Replications,NetLogons,.....

byqk4l, November 29, 2010
Hi, I test your script under w2k8 x64 (RUS) and it don`t work correctly. Script always return CRITICAL.
When I run 'dcdiag /test:services' (for example) always OK.

I try increase verbose mode in your script but it didn`t get anything usefull.

What addition information can I get to you for find and replace this bug?

Thank you.
Owner's reply

Hi! sorry for not getting back to you, I was expecting Nagios Exchange to email me when this page was updated.

Can you email me the output of dcdiag as well as the output from my script? My email address is j-o-h-n@j-o-r-e.n-o (Remove the -)


Page 2 of 2