View previous topic :: View next topic |
Author |
Message |
FLynch
Joined: 18 Jun 2002 Posts: 75 Location: London UK
|
Posted: Thu Apr 12, 2007 8:31 am Post subject: Request for amendment to AHM supplied script - RegRead.vbs |
|
|
Hi,
I am really exposing my programming ignorance here but it would be great if the guys at AHM or any other of you bright sparks could help me out with a specific active script.
I am trying to amend "RegRead.vbs" to read a registry key on a remote machine (the script works fine when run locally). I do not want to run RMA on the machines I am trying to monitor.
I am at a loss as how to start. I should imagine its some variation of prefixing the const with some form of "\\servername\".
Actually all I need to do is read a remote registry key and not compare it to any thing else, which is what RegRead.vbs was designed to do.
Thanks in Advance (!)
Fergus
***********************************************
Option Explicit
const statusAlive = "Host is alive:"
const statusDead = "No answer:"
const statusUnknown = "Unknown:"
const statusNotResolved = "Unknown host:"
const statusOk = "Ok:"
const statusBad = "Bad:"
const statusBadContents = "Bad contents:"
const IEkey = "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page"
'---- entry point ----
FUNCTION performtest()
Dim WshShell, KeyStr
IF "%Reply%"="%"+"Reply"+"%" THEN
performtest = statusUnknown+"Please enable 'Translate macros' option"
ELSE
Set WshShell = CreateObject("WScript.Shell")
KeyStr = WshShell.RegRead(IEkey)
IF (KeyStr<>"%Reply%") THEN
performtest = statusBad+KeyStr
ELSE
performtest = statusOk+KeyStr
END IF
END IF
END FUNCTION
**************************************** |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
|
Back to top |
|
|
FLynch
Joined: 18 Jun 2002 Posts: 75 Location: London UK
|
Posted: Fri Apr 13, 2007 8:17 am Post subject: Cheers! |
|
|
Thanks all.... ther is plenty here for me to start looking at.. |
|
Back to top |
|
|
FLynch
Joined: 18 Jun 2002 Posts: 75 Location: London UK
|
Posted: Tue Apr 17, 2007 1:04 am Post subject: Location of VB script files on remote servers |
|
|
Hi All,
I'm trying to run an Active Script with RMA on a remote server however I have hit a small problem with Active Scripts. All other types of monitor are working great!
When I add an active script monitor using RMA I get an error message:
Error: Cannot open file " c:\Program Files\AHM\script.vbs"
When I test the script while setting up the monitor it runs Ok.
Any ideas on this one?
Thanks in Advance
Fergus |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Tue Apr 17, 2007 1:26 am Post subject: Re: Location of VB script files on remote servers |
|
|
FLynch wrote: | Error: Cannot open file " c:\Program Files\AHM\script.vbs" | When "Active script" test method is performed by RMA, it assumes that script is located on the machine, where RMA is running. So, RMA is looking for "script.vbs" in "c:\Program Files\AHM\" folder on RMA's machine.
Regards,
Max |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Tue Apr 17, 2007 5:01 pm Post subject: |
|
|
3 possible solutions:
a) store script in a file on system where RMA is running
b) or you may use "Store script inside HML file" option of the test
c) or you may use Shell Script test method instead
Regards
Alex |
|
Back to top |
|
|
FLynch
Joined: 18 Jun 2002 Posts: 75 Location: London UK
|
Posted: Tue Apr 24, 2007 10:09 am Post subject: Resolved! |
|
|
Thanks for all the help on this - now working perfectly.
Basically I re-installed the RMA software using the supplied installer and choosing the "custom" option.
RMA is absolutely superb!
Cheers
Fergus |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Tue Apr 24, 2007 9:14 pm Post subject: |
|
|
Glad it works fine
Regards
Alex |
|
Back to top |
|
|
|