View previous topic :: View next topic |
Author |
Message |
Kris
Joined: 12 May 2010 Posts: 375
|
Posted: Fri Sep 04, 2020 1:12 am Post subject: Problem with existing VBscript test |
|
|
Hi,
Since today the following script stopped working:
Code: |
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFile = objFS.GetFile(WScript.Arguments(0))
WScript.StdOut.Write "ScriptRes:Ok:" & DateDiff("d",objFile.DateLastModified,Now())
|
The script is supposed to check the last time a specific file was modified and returns the days passed since the last modification.
It takes a filename with full unc path as parameter.
The specific file is accessible from the computer running HM.
Until today it ran fine. Now it only says:
Error: Script returns no results
However, when I run it from the script editor, it tests just fine.
Also, when I run it from a prompt or any VB editor, it runs fine.
And with a local file, it runs fine too.
It just won't run as a test in HM with a UNC formatted path\file.
Weird eh? Any ideas would be greatly appreciated!
HM 12.50 running on W10Pro/2004 |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Fri Sep 04, 2020 5:14 am Post subject: |
|
|
Your script does not handle errors/exceptions.
What happens if file is not accessible? It will not set Unknown test status and will not return error message.
File located on remote system? Are you sure hostmon.exe process has access to this resource(file)?
You may check what account is set to run HostMonitor, check if this account is not disabled..
Regards
Alex |
|
Back to top |
|
|
Kris
Joined: 12 May 2010 Posts: 375
|
Posted: Mon Sep 07, 2020 2:55 am Post subject: |
|
|
KS-Soft wrote: | Your script does not handle errors/exceptions.
What happens if file is not accessible? It will not set Unknown test status and will not return error message. |
True that... It was a Quick&Dirty solution.
KS-Soft wrote: | File located on remote system? |
Yes, full UNC filename
KS-Soft wrote: | Are you sure hostmon.exe process has access to this resource(file)?
You may check what account is set to run HostMonitor, check if this account is not disabled.. |
Good point! I'll have a look at that.
Allthough I would expect the HM script-editor to use the same HM service credentials to run the test-tests. Or doesn't it?
I'll report back ASAP! |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Mon Sep 07, 2020 6:31 am Post subject: |
|
|
Quote: | Allthough I would expect the HM script-editor to use the same HM service credentials to run the test-tests. |
Test uses account specified for HostMonitor.
Script editor? Do you mean you are using some external program to modify script? Remote Control Console? But how this relates to the problem? Tests performed by HostMonitor (or RMA agents).
Regards
Alex |
|
Back to top |
|
|
Kris
Joined: 12 May 2010 Posts: 375
|
Posted: Tue Sep 08, 2020 8:23 am Post subject: |
|
|
I mean the HM internal script editor aka 'Script Manager'.
If I do a 'Lets Try' from there, which credentials are used to run the script? |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Tue Sep 08, 2020 9:45 am Post subject: |
|
|
In both cases current user account is used - account you are using to run hostmon.exe process (or rcc.exe process in case you are using RCC for "Lets try" option)
Regards
Alex |
|
Back to top |
|
|
Kris
Joined: 12 May 2010 Posts: 375
|
Posted: Tue Sep 15, 2020 12:36 am Post subject: |
|
|
Just to close this case: it was indeed the account running the HM service not having enough rights on the UNC path it tried to access.
Thanks Alex for pointing me in the right direction. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Tue Sep 15, 2020 5:03 am Post subject: |
|
|
You are welcome
Regards
Alex |
|
Back to top |
|
|
|