KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Problem with existing VBscript test

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
Kris



Joined: 12 May 2010
Posts: 375

PostPosted: Fri Sep 04, 2020 1:12 am    Post subject: Problem with existing VBscript test Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12791
Location: USA

PostPosted: Fri Sep 04, 2020 5:14 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Kris



Joined: 12 May 2010
Posts: 375

PostPosted: Mon Sep 07, 2020 2:55 am    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12791
Location: USA

PostPosted: Mon Sep 07, 2020 6:31 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Kris



Joined: 12 May 2010
Posts: 375

PostPosted: Tue Sep 08, 2020 8:23 am    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12791
Location: USA

PostPosted: Tue Sep 08, 2020 9:45 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Kris



Joined: 12 May 2010
Posts: 375

PostPosted: Tue Sep 15, 2020 12:36 am    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12791
Location: USA

PostPosted: Tue Sep 15, 2020 5:03 am    Post subject: Reply with quote

You are welcome

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index