NCPA and windows Passive checks over NRDP

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.
gmills
Posts: 114
Joined: Wed Jun 12, 2019 2:08 pm

Re: NCPA and windows Passive checks over NRDP

Post by gmills »

I'm sorry, during the progression of this ticket we moved to Active checks Not passive.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA and windows Passive checks over NRDP

Post by lmiltchev »

OK, no worries. Can you successfully call your script from the Nagios server? Show us the actual check run from the command line along with the output of it.

Example:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H <ip address> -t 'token' -P 5693 -T 30 -M 'plugins/<your script goes here>'
Be sure to check out our Knowledgebase for helpful articles and solutions!
gmills
Posts: 114
Joined: Wed Jun 12, 2019 2:08 pm

Re: NCPA and windows Passive checks over NRDP

Post by gmills »

thanks so much lmiltchev,

Can you successfully call your script from the Nagios server? NO.
I can however run it successfully on the Windows box or client machine.

Show us the actual check run from the command line along with the output of it

./check_ncpa.py -H 3.239.245.147 -t gold3726 -M plugins/check_files.vbs -a '-p "D:\Delta Incoming\IncomingData\PersistentStore\Delta IBM MQ Series" -w 100 -c 200'

CScript Error: Can't find script engine "VBScript" for script "C:\Program Files (x86)\Nagios\NCPA\plugins\check_files.vbs".

I ran it with verbose flag

# ./check_ncpa.py -v -H 3.239.245.147 -t gold3726 -M plugins/check_files.vbs -a '-p "D:\Delta Incoming\IncomingData\PersistentStore\Delta IBM MQ Series" -w 100 -c 200'
Connecting to: https://3.239.245.147:5693/api/plugins/ ... 26&check=1
File returned contained:
{
"returncode": 1,
"stdout": "CScript Error: Can't find script engine \"VBScript\" for script \"C:\\Program Files (x86)\\Nagios\\NCPA\\plugins\\check_files.vbs\"."
}
CScript Error: Can't find script engine "VBScript" for script "C:\Program Files (x86)\Nagios\NCPA\plugins\check_files.vbs".

I'm finding I don't like windows :lol:

I enabled the NCPA listener loggging, but it doesn't show much, I can't find anything in the event viewer, ????
Attachments
ncpa_listener.log
ncpa listener log
(32.91 KiB) Downloaded 145 times
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA and windows Passive checks over NRDP

Post by lmiltchev »

I'm finding I don't like windows :lol:
You are not the only one... :)

Let's try to run the script locally on your Windows machine. Open a CMD prompt, copy the command below:

Code: Select all

cscript "C:\Program Files (x86)\Nagios\NCPA\plugins\check_files.vbs" -p "D:\Delta Incoming\IncomingData\PersistentStore\Delta IBM MQ Series" //NoLogo
paste it in the CMD prompt windows, and hit "Enter". Take a screenshot of the output and post it on the forum. Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!
gmills
Posts: 114
Joined: Wed Jun 12, 2019 2:08 pm

Re: NCPA and windows Passive checks over NRDP

Post by gmills »

Hey Lmiltchev, it works executing on the client windows machine. please see attachment screen shot.

I'm really thinking this is something to do with the user account...

how do you set this up to know to execute script with cscript.exe from Nagios or Windows ?
from nagios core server, the response shows we are connecting, and issuing command, however, the OS, can't find the script engine. that is what it is looking like to me... ???

./check_ncpa.py -v -H 3.239.245.147 -t gold3726 -M plugins/check_files.vbs -a '-p "D:\Delta Incoming\IncomingData\PersistentStore\Delta IBM MQ Series" -w 100 -c 200'
Connecting to: https://3.239.245.147:5693/api/plugins/ ... 26&check=1
File returned contained:
{
"returncode": 1,
"stdout": "CScript Error: Can't find script engine \"VBScript\" for script \"C:\\Program Files (x86)\\Nagios\\NCPA\\plugins\\check_files.vbs\"."
}
CScript Error: Can't find script engine "VBScript" for script "C:\Program Files (x86)\Nagios\NCPA\plugins\check_files.vbs".
Attachments
shows script execution on windows box
shows script execution on windows box
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA and windows Passive checks over NRDP

Post by lmiltchev »

It is very strange that you can run the script locally, but not call it remotely... I did some digging into it, and I mostly find online posts that claim that issue is caused by an anti-virus software. I am not sure if this is the case for you, but it is definitely something related to your specific environment. I tried calling various VB scripts on a couple of Windows machines, and I didn't have any issues.

Here's a video that describes how to solve an issue caused by an anti-virus software.

https://youtu.be/gix_hB8nXfU
Important: I haven't tried these steps, so I cannot guarantee that they will work for you. If you decide to try this method, take all of the necessary precautions, e.g. backup your registry before making any changes. Do it at your own risk.

It is also possible that there are some, Group Policy/other rules that don't allow you to run vbscripts remotely. You would need to talk to your System Administrator to find out if this is the case.
Be sure to check out our Knowledgebase for helpful articles and solutions!
gmills
Posts: 114
Joined: Wed Jun 12, 2019 2:08 pm

Re: NCPA and windows Passive checks over NRDP

Post by gmills »

thank you,

I have actually done all those.

I have tried, also note, that I had to do the following to get the script to run locally.

cd %windir%\system32 regsvr32 vbscript.dll regsvr32 jscript.dll

changing the registry HKCR\CLSID{B54F3741-5B07-11cf-A4B0-00AA004A55E8}\InprocServer32 C:\Windows\system32\vbscript.dll

wscript.exe //H:cscript

But nothing works. Do you think this may work passively???
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA and windows Passive checks over NRDP

Post by lmiltchev »

You can try setting up a passive check - I don't see a reason why it would not work.

Follow the documents below:

https://assets.nagios.com/downloads/ncp ... Checks.pdf

https://www.nagios.org/ncpa/help.php#passive

Let us know how it went.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA and windows Passive checks over NRDP

Post by lmiltchev »

One more thing... Can you right-click on your script, go to "Properties", then to the "Security" tab, and show us a screenshot?
Be sure to check out our Knowledgebase for helpful articles and solutions!
gmills
Posts: 114
Joined: Wed Jun 12, 2019 2:08 pm

Re: NCPA and windows Passive checks over NRDP

Post by gmills »

please find attached.

I just entered a ticket with our internal Windows team. Hopefully they will work and give solution, sometimes like pulling teeth.

I also entered a case on stacktrace.

I'm going to wait to hear back from them before moving to passive checking.
can I use the docs outlining passive checks for Nagios XI for Nagios Core?
I may need your assistance to plug the correct values in the installer. I'll need to uninstall the agent and reinstall it, this time for passive and active checks.

if you come up with anything, please don't hesitate to push it my way.. thank you!
Attachments
security properties on check_files.vbs
security properties on check_files.vbs
Last edited by gmills on Tue Dec 10, 2019 12:02 pm, edited 1 time in total.
Locked