Script returns no results

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
jensfoeller
Posts: 7
Joined: Thu Mar 08, 2007 7:49 am

Script returns no results

Post by jensfoeller »

Hi *.*,
we have the following problem with a ShellScript Test.

Problem:
Our ShellScript Test runs without problems if we run Hostmonitor in Application Mode. It runs also fine when we do a "Lets Try" in RCC.
The Script Parameters are always the same.

If we run Hostmonitor in Service Mode (Local System Account, Interaction with Desktop allowed) we get the following error meassage: "Error: Script returns no results"

To sum it up: ShellScript runs fine in "Application Mode" but does not work in "Service Mode".

Environment:
Windows 2003 Server SP1
Hostmonitor Version 6.54

What can we do?
Regards,
Jens
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

I suppose, service does not have necessary rights to run the script. You may specify account for the HostMonitor's service using menu Options > Service. We recommend to start HostMonitor under admin account.

Regards,
Max
jensfoeller
Posts: 7
Joined: Thu Mar 08, 2007 7:49 am

Post by jensfoeller »

We specified an AD-Account "EMEA\hostmon" which is member of the local Administrators group.
Something else we could check?
Regards,
Jens
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Do you see the message "Logged on as user "EMEA\hostmon"" in Event Log?
Probably, you are trying to use mapped drives in the script? You should know, that service is running under different account and does not recognize any mapped drive letters. You should use UNC path instead (e.g. \\server\share_name instead of P:\ )

Could you send the script body to support@ks-soft.net?

Regards,
Max
jensfoeller
Posts: 7
Joined: Thu Mar 08, 2007 7:49 am

Post by jensfoeller »

Hi,
i tried it with a very simple Script (see below). The results are the same.

'-- ---------------------------------------------------------------------------
'-- Main
'-- ---------------------------------------------------------------------------
WScript.StdOut.Write "scriptRes" & ":" & "Ok" & ":" & "42"
jensfoeller
Posts: 7
Joined: Thu Mar 08, 2007 7:49 am

Post by jensfoeller »

Forgot an info: Yes, Logon/Logoff messages of EMEA\hostmon are shown in eventlog.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

jensfoeller wrote:WScript.StdOut.Write "scriptRes" & ":" & "Ok" & ":" & "42"
Actually, I yhink you should use "Active Script" test method with such syntax. Quote from the manual:
http://www.ks-soft.net/hostmon.eng/mfra ... htm#script
==================
Starting from HostMonitor version 3.40 you can create your own tests using different script languages such as Visual Basic Script or Java Script
==================
If you want to use "Schell Script" test method, you should use the following syntax:

Code: Select all

echo ScriptRes:Ok:42
Regards,
Max
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

H'm.. I just tested your script on Windows 2000, XP, 2003 SP1 in application and service mode under local system and admins account.
Everything works fine except the following configuration: Windows 2003 SP1, HostMonitor started as sevice under admins account. So we have reproduced the problem.
Test fails because Windows returns the following error: "Cmd.exe - Application Error. The application failed to initialize properply (0xc00000142). Click on OK to terminated the application."
Did not find anything useful in Microsoft manuals yet. Will continue tomorrow...

Regards
Alex
jensfoeller
Posts: 7
Joined: Thu Mar 08, 2007 7:49 am

Post by jensfoeller »

Hi,
great. Waiting fpr your answer.
Thx.
Jens
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

We checked Microsoft manuals, did not find any explanation of this problem related to CMD.EXE. What is interesting, we tried different user account (member of administrators group) - it works fine.
So, possible workarounds
a) use different user account (make sure it belongs to administrators).
b) use Active Script, it works fine
c) use Windows 2000 SP4
If you choose a), please restart the service

Regards
Alex
jensfoeller
Posts: 7
Joined: Thu Mar 08, 2007 7:49 am

Post by jensfoeller »

Hi,
i changed the test to an ActiveScript.

Works but with a very strange behaviour.

A test of the new Script [Test properties] - [Test] runs fine (expected result, and an expected runtime ~ 5s.

If the test is started from Hostmonitor (background execution) it runs fine (expected results) but with a runtime of ~ 40s.

Any idea?

Btw the script calls an external exe which normaly runs 4-5s.

Regards,
Jens
jensfoeller
Posts: 7
Joined: Thu Mar 08, 2007 7:49 am

Post by jensfoeller »

Oh, forgot an info. I configured 10 tests and it seems, that there is always only one test active (at least the is only one exe active) or the other are waiting for the running test.
Regards,
Jens
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

If the test is started from Hostmonitor (background execution) it runs fine (expected results) but with a runtime of ~ 40s.
...
I configured 10 tests and it seems, that there is always only one test active (at least the is only one exe active) or the other are waiting for the running test
I think second phrase is answer to 1st one.
Some Windows components do not work well in multithreaded environment. To avoid problems HostMonitor executes scripts one by one, this may lead to delayed execution when you are using several Active Script test methods.

Regards
Alex
Post Reply