check_ad ok??

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.
nagiosjam
Posts: 81
Joined: Thu Feb 04, 2016 2:47 am

check_ad ok??

Post by nagiosjam »

Hello
I have problems when I run the check_ad
https://exchange.nagios.org/directory/P ... ck/details

check_ad file in the scripts directory
and this is my configuration file in the nsclient.ini
[/ Settings / external scripts / wrappings]
vbs = cscript.exe // T: 90 // \\ lib \\ NoLogo scripts SCRIPT wrapper.vbs%%% ARGS%

[/ Settings / external scripts / wrapped scripts]
check_ad = check_ad.vbs

Run the command
./check_nrpe -H -c SERVER1 check_ad
and I get
Ok -


but I do not see this output as stated on the download link

OK - RidManager: OK. services: OK. FsmoCheck: OK.

Is it right or is failing something ?, help please

Thank you
nagiosjam
Posts: 81
Joined: Thu Feb 04, 2016 2:47 am

Re: check_ad ok??

Post by nagiosjam »

Code: Select all

[icode]# 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
[/modules]

; Undocumented key
CheckDisk = 1

; Undocumented key
CheckEventLog = 1

; Undocumented key
CheckExternalScripts = 1

; Undocumented key
CheckHelpers = 1

; Undocumented key
CheckNSCP = 1

; Undocumented key
CheckSystem = 1

; Undocumented key
CheckWMI = 1

; Undocumented key
NRPEServer = 1

; Undocumented key
NSClientServer = 1


; Undocumented section
[/settings/default]

; Undocumented key
allowed hosts = xxxxxxxx

; Undocumented key
password = xxxxxxxx

[/settings/external scripts]
allow arguments = true
allow nasty characters = true
timeout = 90

[/settings/external scripts/wrappings]
bat = scripts\\%SCRIPT% %ARGS%
ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -
vbs = cscript.exe //T:90 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%
exe = cmd /c %SCRIPT% %ARGS%

[/settings/external scripts/wrapped scripts]

test_bat = check_ok.bat
test_ps = check_test.ps1
test_vbs = check_test.vbs
test_ping = check_ping.bat
test_files = check_files.vbs
test_battery = check_battery.vbs
test_printers = check_printer.vbs
alias_process = checkProcState "$ARG1$=started"
check_test = check_test.ps1
check_exchange2013= check_exchange2013.ps1
check_ad= check_ad.vbs

[/settings/external scripts/scripts]

check_tcp = scripts\check_tcp.exe -H $ARG1$ -p $ARG2$ -w $ARG3$ -c $ARG4$

[/icode]
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check_ad ok??

Post by dwhitfield »

For the sake of clarity, the output when you run the script is literally "Ok -"?

What version of AD are you checking? What version of Nagios Core are you using? Although I doubt this has any bearing on the issue, on what OS are you running Nagios Core? This will help us give you proper file paths. On the file path issue, did you compile from source or install from repos?

Lastly, what are the languages of both the Nagios server and the Windows machine? I'm not sure at this point why language is so important, but there seems to have been a lot of work on language for that script. I know AD has issues with special characters, but I would have thought a fix to allow the expanded European alphabet would have been enough. Anyway, I think it is worth noting at this point. Thanks!
nagiosjam
Posts: 81
Joined: Thu Feb 04, 2016 2:47 am

Re: check_ad ok??

Post by nagiosjam »

Literally "Ok - "

Nagios core 4.0.8 in Centos 6.5 language spanish
Windows 2012 Server r2 language spanish
Nsclient ++0.4.3

I tested with several versions and all the same "Ok -"
Check_AD.vbs Original Script
check_ad.vbs Latest version. Merged all changes, fixes and enhancements into this edition

thanks
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check_ad ok??

Post by dwhitfield »

How many users are in your AD? Some weird things happen once you get over 1000. This error wouldn't seem to be related, but I just want to rule it out.
nagiosjam
Posts: 81
Joined: Thu Feb 04, 2016 2:47 am

Re: check_ad ok??

Post by nagiosjam »

Yes
There are more than 1000 users :(
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check_ad ok??

Post by dwhitfield »

Again, I'm not entirely convinced this is the issue, but you are likely to run into issues with the user limit eventually, so we might as well go ahead and look into it.

This is something that is set for Windows:
http://windowsitpro.com/networking/conq ... ilt-limits (this article does not talk specifically about 2012 for obvious reasons, but this is still an issue)
Under heading "LDAP Maximum Page Size" - you can set MaxPageSize which is default to 1000. You can set it as high as 5000.

This is not really an AD issue, per se, but the way various applications deal with PageSize. Basically, for some applications you need to send them all at once. I'm not really sure what happens if you have over 5000.

Please let us know if that resolves the issue.
nagiosjam
Posts: 81
Joined: Thu Feb 04, 2016 2:47 am

Re: check_ad ok??

Post by nagiosjam »

No where I have to set MaxPageSize

where I have to change it?
Thank you
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check_ad ok??

Post by dwhitfield »

If you aren't the AD admin, you may have to get someone to help.

1. Go to the domain controller that we’re connecting to for the sync
2. Find the file ntdsutil.exe (most likely under c:\windows\system32 or c:\winnt\system32)
3. Run the ntdsutil.exe
4. Type “ldap policies” and enter
5. Type "connections" and enter
6. Type "Connect to server [YourDCName]" and enter
7. Type "q" and enter
8. Type "Show Values" to see the current settings
9. Type “Set MaxPageSize to 5000” and enter
10. Type “Commit Changes” and enter
11. Type “Show Values” and enter

Please let us know if this resolves your issue.
nagiosjam
Posts: 81
Joined: Thu Feb 04, 2016 2:47 am

Re: check_ad ok??

Post by nagiosjam »

OK thanks
I'll talk to the server administrator
Locked