Page 1 of 1

Monitoring AD with Nagios

Posted: Thu Jul 18, 2019 2:03 pm
by dca_admin
Hello team,

Service 1: Need to monitor replication synchronization in Nagios. I tried one plugin but its not working please check below links of powershell script i used (may be i don't understand how to work on this plugin). Please share document and need help how to work on it.

https://exchange.nagios.org/directory/P ... nc/details
https://github.com/juangranados/nagios- ... cation.ps1


Service 2: Need to monitor ADFS and AD Directory Sync Services. Please share document and need help how to work on it.

Re: Monitoring AD with Nagios

Posted: Thu Jul 18, 2019 5:02 pm
by cdienger
Let's address these one at a time.

See https://support.nagios.com/kb/article/n ... a-722.html for how to run scripts with NCPA.

The first step is to copy the powershell script into the plugins directory( Usually C:\Program Files (x86)\Nagios\NCPA\plugins)

and then testing it from the XI command line. For example:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H your_windows_server_ip_address -t your_windows_server_ncpa_token -P 5693 -M 'plugins/check_adreplication.ps1' -q 'args=-Warning 5 -Critical 10'
Does this work?

Re: Monitoring AD with Nagios

Posted: Wed Jul 31, 2019 1:28 pm
by dca_admin
Hi Cdienger,

Thank for your response.

I have tried as per your suggestion but we are facing replication error. Please find attached screenshot.

Re: Monitoring AD with Nagios

Posted: Wed Jul 31, 2019 3:00 pm
by lmiltchev
I haven't used this script, so I am going to speculate here... The example that is shown is this:

Code: Select all

.\Get-ADReplication.ps1 -Warning 5 -Critical 10
so, you are supposed to be able to pass arguments, even though they are "hard-coded" in the script.
Param(
[Parameter(Mandatory=$false,Position=0)]
[ValidateNotNullOrEmpty()]
[int]$Warning=1,
[Parameter(Mandatory=$false,Position=1)]
[ValidateNotNullOrEmpty()]
[int]$Critical=5
)
Having said that, you can try passing only the values (without the "-Warning" and "-Critical" part).

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H your_windows_server_ip_address -t your_windows_server_ncpa_token -P 5693 -M 'plugins/check_adreplication.ps1' -q 'args=5 10'
You can also try not passing any arguments to see what would be the status that is returned with the "hard-coded" parameters. The plugins seems to be working, however the status should be "Warning", not "Critical" (with the returned value of 7 that is).