Page 1 of 1

NCPA - Configuring Passive Check

Posted: Wed Jan 13, 2016 6:58 am
by comfone
Hi
I'm a Nagios XI and NCPA newbie.
I would like to conifgure a NCPA passive check.
We are using Nagios XI 5.2.3 and NPCA 1.8.1.
Plugin used (https://exchange.nagios.org/directory/P ... ll/details)
When I run the plugin check_windows_updates.ps1 as https://localhost:5693/api/agent/plugin ... pdates.ps1 I get the result below:
{
"value": {
"returncode": 2,
"stdout": "Updates: 11 critical, 0 optional\nSecurity Update for Windows Server 2008 R2 x64 Edition (KB3124000) \nSecurity Update for Windows Server 2008 R2 x64 Edition (KB3108664) \nSecurity Update for Windows Server 2008 R2 x64 Edition (KB3109560) \nSecurity Update for Windows Server 2008 R2 x64 Edition (KB3110329) \nSecurity Update for Windows Server 2008 R2 x64 Edition (KB3121918) \nSecurity Update for Windows Server 2008 R2 x64 Edition (KB3121212) \nSecurity Update for Windows Server 2008 R2 x64 Edition (KB3124001) \nCumulative Security Update for Internet Explorer 11 for Windows Server 2008 R2 for x64-based Systems (KB3124275) \nSecurity Update for Windows Server 2008 R2 x64 Edition (KB3123479) \nWindows Malicious Software Removal Tool x64 - January 2016 (KB890830) \nDefinition Update for Microsoft Endpoint Protection - KB2461484 (Definition 1.213.2668.0)"
}
}


But I can't make it this output via NRDP to Nagios XI.
Thank you in advance for your help.

Re: NCPA - Configuring Passive Check

Posted: Wed Jan 13, 2016 4:55 pm
by jolson
I recommend you hit up the API of your windows host and navigate to the following location: https://windowsserver:5693/api/agent/plugin

Does your plugin appear in the API? If so, that's good - your command definition looks a little off, it should _likely_ be configured as follows:
%HOSTNAME%|WinUpdates = /agent/plugin/check_windows_updates.ps1

Most things in NCPA will be referenced using the API - let me know if the above helps! Thanks!

Re: NCPA - Configuring Passive Check

Posted: Wed Jan 13, 2016 4:56 pm
by lmiltchev
Have you tried using any other powershell scripts as passive checks? The script requires passing arguments:

Code: Select all

.ps1 = powershell -ExecutionPolicy Bypass -File $plugin_name $plugin_args
but your check is defined with no args:

Code: Select all

%HOSTNAME%|WinUpdates = check_windows_updates.ps1
I am not sure if this is the problem but we will try to recreate the issue in-house and get back to you.

Re: NCPA - Configuring Passive Check

Posted: Thu Jan 14, 2016 2:38 am
by comfone
Hi jolson
It works now.
My command definition was wrong.
After having changed it the way you recommended it worked.
Thank you. :)