Check_reg_key.vbs "folder not found"

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
lpereira
Posts: 143
Joined: Thu Jul 27, 2017 4:23 pm

Check_reg_key.vbs "folder not found"

Post by lpereira »

Hello All:
I'm trying to monitor the content of the "Excluded folder" REG_SZ using the script i founded here: https://exchange.nagios.org/directory/P ... bs/details

The thing is.. i got an output with a prompt

This is the path for the reg key "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\TrendMicro\PC-cillinNTCorp\CurrentVersion\Real Time Scan Configuration" and the name of the key is ExcludedFolder. We need to know when the content of this value changes.

the error i got is:

[root@nagios libexec]# [root@nagios libexec]# ./check_nrpe -H HOSTADDRESS -p 5666 -c check_reg_key -a "HKEY_LOCAL_MACHINE" "SOFTWARE\Wow6432Node\TrendMicro\PC-cillinNTCorp\CurrentVersion\" "Real Time Scan Configuration" "ExcludedFolder" -n 0
>



help is appreciated.
lpereira
Posts: 143
Joined: Thu Jul 27, 2017 4:23 pm

Re: Check_reg_key.vbs "folder not found"

Post by lpereira »

i made some changes on the .ini file, and i added there the folder i want to monitor. Basically i did this server side

; A list of scripts available to run from the CheckExternalScripts module. Syntax is: <command>=<script> <arguments>
[/settings/external scripts/scripts]
check_reg_key=cscript.exe //T:30 //Nologo scripts\check_reg_key.vbs "HKEY_LOCAL_MACHINE" "SOFTWARE\Wow6432Node\TrendMicro\PC-cillinNTCorp\CurrentVersion\Real Time Scan Configuration" "ExcludedFolder"


if i run the script from CMD on the server i got the following error.

Can ayone please assist?

thanks
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Check_reg_key.vbs "folder not found"

Post by lmiltchev »

This is a 3rd party plugin, and we are not familiar with it. We will try to help you out but your best bet would be to contact the plugin's owner.

This is the command line example shown in the plugin:
./check_nrpe -H $HOSTADDRESS$ -p 5666 -c check_reg_key -a "HKEY_LOCAL_MACHINE" "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" "WinStationsDisabled" 0
It seems like you are missing the last argument in your command (the value)... You last arg is the "ExcludedFolder".
Be sure to check out our Knowledgebase for helpful articles and solutions!
lpereira
Posts: 143
Joined: Thu Jul 27, 2017 4:23 pm

Re: Check_reg_key.vbs "folder not found"

Post by lpereira »

lmiltchev wrote:This is a 3rd party plugin, and we are not familiar with it. We will try to help you out but your best bet would be to contact the plugin's owner.

This is the command line example shown in the plugin:
./check_nrpe -H $HOSTADDRESS$ -p 5666 -c check_reg_key -a "HKEY_LOCAL_MACHINE" "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" "WinStationsDisabled" 0
It seems like you are missing the last argument in your command (the value)... You last arg is the "ExcludedFolder".
i have modified the ini file (and restarted the service)

Code: Select all

; A list of scripts available to run from the CheckExternalScripts module. Syntax is: <command>=<script> <arguments>
[/settings/external scripts/scripts]
check_reg_key=cscript.exe //T:30 //Nologo scripts\check_reg_key.vbs "HKEY_LOCAL_MACHINE" "SOFTWARE\Wow6432Node\TrendMicro\PC-cillinNTCorp\CurrentVersion\Real Time Scan Configuration" "ExcludedFolder" 0

from command line i now got the following error.

Code: Select all

[root@nagios libexec]# ./check_nrpe -H SERVER IP -p 5666 -c check_reg_key -n
CHECK_NRPE: Invalid packet type received from server.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_reg_key.vbs "folder not found"

Post by scottwilkerson »

Before we get any further, you are going to need to be able to make the command run sucessfully on the client system before you can ever make it work from XI.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
lpereira
Posts: 143
Joined: Thu Jul 27, 2017 4:23 pm

Re: Check_reg_key.vbs "folder not found"

Post by lpereira »

scottwilkerson wrote:Before we get any further, you are going to need to be able to make the command run sucessfully on the client system before you can ever make it work from XI.
Let me know if on the .ini file things should be ok

Code: Select all

; A list of scripts available to run from the CheckExternalScripts module. Syntax is: <command>=<script> <arguments>
[/settings/external scripts/scripts]
check_reg_key=cscript.exe //T:30 //Nologo scripts\check_reg_key.vbs "HKEY_LOCAL_MACHINE" "SOFTWARE\Wow6432Node\TrendMicro\PC-cillinNTCorp\CurrentVersion\Real Time Scan Configuration\" "ExcludedFolder" "0"
i'm still having erros on the CMD
You do not have the required permissions to view the files attached to this post.
lpereira
Posts: 143
Joined: Thu Jul 27, 2017 4:23 pm

Re: Check_reg_key.vbs "folder not found"

Post by lpereira »

Maybe this script does not work for me.

Let's do a clean start. I need to monitor a Registry key under "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\TrendMicro\PC-cillinNTCorp\CurrentVersion\Real Time Scan Configuration, the String is ExcludedFolder, and inside this String, i need to get alerted if someone (or something) modify the values inside it.

The string is extense, it contains all the excluded folders for our Anti Virus.

Does this script work? or should i need to find a different one.
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_reg_key.vbs "folder not found"

Post by scottwilkerson »

We are unfamiliar with the plugin, you need to be able to tell us what you run the the command line successfully before we can assist with putting it in the ini file
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
lpereira
Posts: 143
Joined: Thu Jul 27, 2017 4:23 pm

Re: Check_reg_key.vbs "folder not found"

Post by lpereira »

scottwilkerson wrote:We are unfamiliar with the plugin, you need to be able to tell us what you run the the command line successfully before we can assist with putting it in the ini file
we just posted at the same time. See my previous answer.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_reg_key.vbs "folder not found"

Post by scottwilkerson »

lpereira wrote:Does this script work? or should i need to find a different one.
as I had stated, we are not familiar with the plugin, you need to test it to see if it works from the Windows command line, if you cannot successfully do that, I would try something different.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked