Problem with existing VBscript test

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
Kris
Posts: 375
Joined: Wed May 12, 2010 3:22 am

Problem with existing VBscript test

Post by Kris »

Hi,

Since today the following script stopped working:

Code: Select all

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
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

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
Kris
Posts: 375
Joined: Wed May 12, 2010 3:22 am

Post by Kris »

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... :D 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!
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

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
Kris
Posts: 375
Joined: Wed May 12, 2010 3:22 am

Post by Kris »

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?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

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
Kris
Posts: 375
Joined: Wed May 12, 2010 3:22 am

Post by Kris »

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. :-)
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

You are welcome

Regards
Alex
Post Reply