NCPA and windows Passive checks over NRDP
Re: NCPA and windows Passive checks over NRDP
mbellerue,
man, I've never used a VBSCript before, it has been a struggle to get it usable.
had to change the windows registry and set the default script engine to CScript.exe
all new to me
Anyway, I can successfully run the plugin script on the client windows machine.
C:\Program Files (x86)\Nagios\NCPA\plugins>check_files.vbs -p "D:\Delta Incoming\incomingData\PersistentStore\Delta IBM MQ Series" -w 50 -c 60
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
OK: 19 files were matched.|count=19
BUT I cannot seem to get the Nagios server to call it successfully??
[root@alpcts000001083 libexec]# ./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 fixed it so cscript.exe doesn't need to proceed the plugin call. I had corrected this issue on the Windows server.
would you have any ideas? seems I'm missing something, I'll keep looking, see if I can get it first this time thank you!
man, I've never used a VBSCript before, it has been a struggle to get it usable.
had to change the windows registry and set the default script engine to CScript.exe
all new to me
Anyway, I can successfully run the plugin script on the client windows machine.
C:\Program Files (x86)\Nagios\NCPA\plugins>check_files.vbs -p "D:\Delta Incoming\incomingData\PersistentStore\Delta IBM MQ Series" -w 50 -c 60
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
OK: 19 files were matched.|count=19
BUT I cannot seem to get the Nagios server to call it successfully??
[root@alpcts000001083 libexec]# ./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 fixed it so cscript.exe doesn't need to proceed the plugin call. I had corrected this issue on the Windows server.
would you have any ideas? seems I'm missing something, I'll keep looking, see if I can get it first this time thank you!
Re: NCPA and windows Passive checks over NRDP
this is my service definition
define service {
host_name GEIPALPDLTPRC01
service_description Delta File Count
check_command check_ncpa!-t 'gold3726' -P 5693 -M 'plugins/check_files.vbs' -a '-p D:\Delta Incoming\IncomingData\PersistentStore\Delta IBM MQ Series' -w 180 -c 200
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contact_groups Delta-Admins
register 1
}
define service {
host_name GEIPALPDLTPRC01
service_description Delta File Count
check_command check_ncpa!-t 'gold3726' -P 5693 -M 'plugins/check_files.vbs' -a '-p D:\Delta Incoming\IncomingData\PersistentStore\Delta IBM MQ Series' -w 180 -c 200
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contact_groups Delta-Admins
register 1
}
Re: NCPA and windows Passive checks over NRDP
That sounds like it was quite the adventure. Let's do this. What version of Windows is NCPA running on? Can you send me your ncpa.cfg file? And can you also send me the registry changes that you needed to make?
Speaking of the registry changes. You said you needed to change the script engine in order to run the plugin. What was the error that caused you to make that change?
Speaking of the registry changes. You said you needed to change the script engine in order to run the plugin. What was the error that caused you to make that change?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NCPA and windows Passive checks over NRDP
thanks mbellerue, and happy Friday! have a great weekend!
Windows Version: Windows 12 R2
registry changes:
HKCR\CLSID\{B54F3741-5B07-11cf-A4B0-00AA004A55E8}\InprocServer32
changed to C:\Windows\system32\vbscript.dll WAS pointing to McAfee
I also performed the following - didn't do anything
cd %windir%\system32
regsvr32 vbscript.dll
lastly...
wscript.exe //H:cscript - set cscript.exe as default script host globally and persistent
NCPA.cfg is attached
the ERROR that started all this due that the VB Script was not executable.
the ERROR
there was also, invalid handle caused by scripts sending to STDIN,STDOUT, STDERROR
CScript Error: Cant find script engine VBScript for script C:\Program Files (x86)\Nagios\NCPA\plugins
Now it runs successfully on the Windows machine, I can't get it to successfully run from NRPE on Nagios server
thank you for your help!!!
Windows Version: Windows 12 R2
registry changes:
HKCR\CLSID\{B54F3741-5B07-11cf-A4B0-00AA004A55E8}\InprocServer32
changed to C:\Windows\system32\vbscript.dll WAS pointing to McAfee
I also performed the following - didn't do anything
cd %windir%\system32
regsvr32 vbscript.dll
lastly...
wscript.exe //H:cscript - set cscript.exe as default script host globally and persistent
NCPA.cfg is attached
the ERROR that started all this due that the VB Script was not executable.
the ERROR
there was also, invalid handle caused by scripts sending to STDIN,STDOUT, STDERROR
CScript Error: Cant find script engine VBScript for script C:\Program Files (x86)\Nagios\NCPA\plugins
Now it runs successfully on the Windows machine, I can't get it to successfully run from NRPE on Nagios server
thank you for your help!!!
- Attachments
-
- ncpa.cfg
- NCPA.CFG
- (8.33 KiB) Downloaded 158 times
Re: NCPA and windows Passive checks over NRDP
Hey, have a great weekend yourself!
I will probably look at this a little more closely next week, but the first thing that's jumping out at me is this.
What I'm getting at here is that the current user registry is for your user alone. So when NCPA tries to run the VB script, it uses whatever user the service is assigned (system by default), and that doesn't have the registry tweak, so it's running into the same error.
That's the result of my quick overview from what you've sent in. I would advise great caution if you're considering making a change to the system wide registry at 4PM on a Friday. This is how weekends are ruined.
I will probably look at this a little more closely next week, but the first thing that's jumping out at me is this.
That's the current user registry. And if I'm understanding this correctly, running the VB script via NCPA is giving you the same error that you got when you ran it manually, and that prompted you to make the registry change.HKCR\CLSID\{B54F3741-5B07-11cf-A4B0-00AA004A55E8}\InprocServer32
changed to C:\Windows\system32\vbscript.dll WAS pointing to McAfee
What I'm getting at here is that the current user registry is for your user alone. So when NCPA tries to run the VB script, it uses whatever user the service is assigned (system by default), and that doesn't have the registry tweak, so it's running into the same error.
That's the result of my quick overview from what you've sent in. I would advise great caution if you're considering making a change to the system wide registry at 4PM on a Friday. This is how weekends are ruined.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NCPA and windows Passive checks over NRDP
right on... I get it. makes sense...
yeah, because it runs on Windows box, and not from Nagios call.
let me look in to this...
thank you!!!!
funny, but correct... no long weekend this weekend
yeah, because it runs on Windows box, and not from Nagios call.
let me look in to this...
thank you!!!!
funny, but correct... no long weekend this weekend
Re: NCPA and windows Passive checks over NRDP
Sounds good, in addition, please see here as well for the NPCA Passives doc, I didn't see it listed earlier:
https://assets.nagios.com/downloads/ncp ... Checks.pdf
@mbellerue is correct about the reg fix though, when the service runs in the backend it runs in the local system context an not as a specific user.
This could be McAfee limiting it as well, please try these:
http://lifeofageekadmin.com/cant-find-s ... dows-2008/
https://assets.nagios.com/downloads/ncp ... Checks.pdf
@mbellerue is correct about the reg fix though, when the service runs in the backend it runs in the local system context an not as a specific user.
This could be McAfee limiting it as well, please try these:
http://lifeofageekadmin.com/cant-find-s ... dows-2008/
Re: NCPA and windows Passive checks over NRDP
thank you Saax,
I have actually used that procedure. I still cannot call the vbs script successfully.
I'm in a pickle too, I have not very much windows experience, wonder if you have any trouble shooting help here?
I can't find anything in any logs????
I have actually used that procedure. I still cannot call the vbs script successfully.
I'm in a pickle too, I have not very much windows experience, wonder if you have any trouble shooting help here?
I can't find anything in any logs????
Re: NCPA and windows Passive checks over NRDP
Is my command correct?
###############################################################################
# NCPA(Nagios Cross Platform Agent) CHECK COMMAND
#
# Command to use NRPE to check remote host systems
###############################################################################
define command {
command_name check_ncpa
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$ $ARG2$
}
###############################################################################
# NCPA(Nagios Cross Platform Agent) CHECK COMMAND
#
# Command to use NRPE to check remote host systems
###############################################################################
define command {
command_name check_ncpa
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$ $ARG2$
}
Re: NCPA and windows Passive checks over NRDP
Let's clarify a few things. You would like to run a script on the Windows machine as a passive check, and send results back to your Nagios server via NRDP, correct?
If this is the case, you would need to make some modifications in the ncpa.cfg file.
1. Add nrdp as your handler by changing this:
to this:
2. Under the [nrdp] section, set the parent:
3. Define your passive check in the nrdp.cfg file if you haven't done it yet.
Read more on configuring passive checks in NCPA here:
https://www.nagios.org/ncpa/help.php#passive
4. Save exit, and restart both services - "NCPA Listener" and "NCPA Passive" on the Windows machine.
5. Wait for 5+ minutes, and check the ncpa_passive.log to see if your script ran, and results were sent to your Nagios server.
If this is the case, you would need to make some modifications in the ncpa.cfg file.
1. Add nrdp as your handler by changing this:
Code: Select all
handlers =None
Code: Select all
handlers =nrdp
Code: Select all
parent = http://<ip address>/nrdp
token =<nrdp token>
Code: Select all
[passive checks]
%HOSTNAME%|<Service Description> = plugins/<your script> <args and thresholds if required>
https://www.nagios.org/ncpa/help.php#passive
4. Save exit, and restart both services - "NCPA Listener" and "NCPA Passive" on the Windows machine.
5. Wait for 5+ minutes, and check the ncpa_passive.log to see if your script ran, and results were sent to your Nagios server.
Be sure to check out our Knowledgebase for helpful articles and solutions!