script dont work in service mode

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
larswars
Posts: 3
Joined: Tue Jan 25, 2005 5:04 am

script dont work in service mode

Post by larswars »

I've running hostmonitor in service mode on win2003 server.

In normal mode the test and the script works fine.

But in service mode the test stop and reply "Error: unable to start script"

When I switch in normal mode the test start run whithout error.

The script: " WScript.stdout.write "scriptres:OK:"&" TESTTEST " "

I use the test "Shell Script" to start the script.

Any ideas?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

What account you have specified on Service page in the Options dialog (HostMonitor's Options dialog)? "Local system"?

Quote from the manual
Log on as
Specify user account (login and password) to impersonate the security context of the user.
When HostMonitor starts as a service, it uses the system account (as all interactive services). But this account may not have all the necessary permissions, so some tests will not work correctly (UNC test, "disk free space" test for shared drives, "CPU Usage" test for remote machines, etc). If you need these tests, you will need to assign a special user account. In this case HostMonitor will impersonate the security context of the user.
Note: Do not change the account using the system utility "Services". If you do so, HostMonitor will not be able to interact with the desktop.
Regards
Alex
larswars
Posts: 3
Joined: Tue Jan 25, 2005 5:04 am

Post by larswars »

No, the service use a Domain user account special for this service.

This account is in the group "local admin" and have the permissions to check the other Server in the Domain.

We use the tests "disk free space" and "CPU Usage" without problems.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

What command do you use to lauch script? cmd /c cscript /B /E:VBScript %Script% %Params%?
Could you try to specify full patch to cmd and cscript modules (in case environ variable does not contain path...)?

Regards
Alex
larswars
Posts: 3
Joined: Tue Jan 25, 2005 5:04 am

Post by larswars »

Good idea, I try this command to launch script:

"C:\WINDOWS\system32\cmd.exe /c C:\WINDOWS\system32\cscript /B /E:VBScript %Script% %Params%"

I’m so sorry to tell you that the script still doesn’t start in service mode.

Regards
Lars
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I cannot reproduce this error on our Win 2003 server :-( Scripts works fine in application and service modes.
Could you try to execute the same command line (cmd /c cscript /B /E:VBScript anything_here) using "Execute external program" action? You may assign action to some simple test with predefined result (e.g. "good" action for "ping 127.0.0.1" test).
In this case HostMonitor will request Windows and record text information about reason of the error into syslog.htm file (or some other file specified on Advanced Logs page in the Options dialog).

Regards
Alex
Post Reply