Page 1 of 5

NCPA and windows Passive checks over NRDP

Posted: Tue Dec 03, 2019 5:04 pm
by gmills
Hello, and thank you in advance!

my Nagios Core 4.4.3 monitoring server is Linux platform. I need to issue passive checks on a Windows machine.
I am using the NCPA agent, with NRDP for passive checks.

Q1. how do you set up such monitoring on the Windows box using NCPA/NRDP ? I can't find any instructions/configurations to add plugin on NCPA on Windows?
Q2. All the plugins available I see for such purpose use NSClient for passive tests, do I need to use NSClient or can I accomplish this with NCPA?
Q3. if I can use NRDP, I want to use the Check_Filecount or Check_Files plugins, do I need to install NRDP on my Nagios monitoring server?

Re: NCPA and windows Passive checks over NRDP

Posted: Wed Dec 04, 2019 10:43 am
by mbellerue
A1. Adding plugins to NCPA in Windows is much the same as it is in Linux. In the location where you installed NCPA, there is a plugins directory. Just put the plugins that you need to run in that directory. When you call them with the check_ncpa.py plugin on the Nagios machine, you will use -M plugins/plugin_name to call that plugin.

Active check example,

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H hostname -t SecretToken -M plugins/my_powershell_plugin.ps1 -a '-argument1 argument1value -argument2 argument2value'
Passive check example,

Code: Select all

%HOSTNAME%|ServiceCheckName = plugins/my_powershell_plugin.ps1/-argument1/argument1value/-argument2/argument2/value
Often times people have a harder time grasping the passive check configuration, so I will link to documentation below.

A2. Do you have an example of these plugins? If you can give me an example, I can try it out and make sure it works with NCPA. Basically as long as it provides the typical Nagios-parsable output, it should work just fine.

A3. Yes, NRDP is the Nagios Remote Data Processor. This gets intalled to your Nagios server, and is accessed at http://yourNagiosIP/nrdp. NCPA will send passive results to this URL, as defined in your ncpa.cfg file.

Here is some documentation that will help you along.

Install NRDP in Nagios Core
https://support.nagios.com/kb/article/n ... e-602.html

NCPA passive checks
https://www.nagios.org/ncpa/help/2.1/passive.html

Re: NCPA and windows Passive checks over NRDP

Posted: Wed Dec 04, 2019 11:08 am
by gmills
hey mbellerue, thank you so much!!!

Hey, yeah, I will use the Active check example you provided, I've done this before on Linux, I understand this. and thanks for info!!!

please find the plugins attached. and THANKS!

please remove the .txt on attached files

Re: NCPA and windows Passive checks over NRDP

Posted: Wed Dec 04, 2019 2:10 pm
by mbellerue
They seem to work just fine. Here's my result.

Code: Select all

root@weylandxi:/usr/local/nagios/libexec# ./check_ncpa.py -H 192.168.145.90 -t ASecretToken -M plugins/check_files.vbs -a '-p C:\Monitoring\ReadHere\ -w 5 -c 7'
OK: 1 files were matched.|count=1

Re: NCPA and windows Passive checks over NRDP

Posted: Wed Dec 04, 2019 2:13 pm
by gmills
mbellerue,

can't show the appreciation I have for you! thank you so much! this is GREAT NEWS!

I will give it a shot, actually already did, however, trying to resolve a VBScript engine issue now so to execute the plugin... LOL always something.

but thank you!!!!

Re: NCPA and windows Passive checks over NRDP

Posted: Wed Dec 04, 2019 2:31 pm
by mbellerue
You're welcome! Good luck with the engine issue! Just a quick tip, if you need to alter how cscript.exe calls VBScripts, like with a special command line switch or something, you can make that change permanent in the ncpa.cfg file. Down at the bottom of the file are definitions on how files with different extensions are executed. The default for VBScripts is .vbs = cscript $plugin_name $plugin_args //NoLogo

Re: NCPA and windows Passive checks over NRDP

Posted: Wed Dec 04, 2019 2:54 pm
by gmills
very nice! you're excellent my friend! thank you
once I get this VBScript thing in, I'll let you know how this works, I am confident it will work just fine.

Re: NCPA and windows Passive checks over NRDP

Posted: Wed Dec 04, 2019 4:06 pm
by mbellerue
Excellent! We will keep this thread open, and wait to hear back.

Re: NCPA and windows Passive checks over NRDP

Posted: Thu Dec 05, 2019 12:21 pm
by gmills
thanks for waiting ...

unfortunately, I am at the mercy of other teams to do this, and it requires a reboot :).

I should be able to let you know end of day today or tomorrow.

thank you!!!

Re: NCPA and windows Passive checks over NRDP

Posted: Thu Dec 05, 2019 4:32 pm
by mbellerue
Okay, no worries. It doesn't hurt to keep the thread open, so no rush.