Calling a PowerShell script in HostMonitor

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
jimholcomb
Posts: 13
Joined: Wed Jul 25, 2007 12:12 pm

Calling a PowerShell script in HostMonitor

Post by jimholcomb »

I have a PowerShell script that I've added to Script Manager, it works fine when I take the "Lets try" option in Script Manager but when I try to execute the test in HM it fails with "Error: unable to start script". I'm running version 8.14

The start command is C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe "D:\Tools\AsyncWarning.ps1" %Params% and I've tried running this as an external script specified on the command line and also entering the script directly into Script Manager, same results.

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

Post by KS-Soft »

Sorry, we cannot reproduce the problem.
- What Windows do you use? Service Pack?
- HostMonitor started as service or application?
- Can it start some other scripts (processed by cmd.exe or cscript.exe)?

Regards
Alex
jimholcomb
Posts: 13
Joined: Wed Jul 25, 2007 12:12 pm

Post by jimholcomb »

KS-Soft wrote:Sorry, we cannot reproduce the problem.
- What Windows do you use? Service Pack?
- HostMonitor started as service or application?
- Can it start some other scripts (processed by cmd.exe or cscript.exe)?

Regards
Alex
I'm running Windows 2003 Server, SP2, HostMonitor is started as a service with a domain account that is part of the local administrators group.

I took the bat script sample in the Script Monitor and had the same results, works in application mode and fails with "Error: unable to start script".

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

Post by KS-Soft »

I took the bat script sample in the Script Monitor and had the same results, works in application mode and fails with "Error: unable to start script".
Do you mean you stop service and start application everytime you are using "Lets try" option? or you are using RCC installed on different system to setup and test script while test is performed by HostMonitor installed on different system?

Regards
Alex
jimholcomb
Posts: 13
Joined: Wed Jul 25, 2007 12:12 pm

Post by jimholcomb »

It does not work as a service at all unless I run hostmon.exe with the service running and take the "click No to keep service and launch 2nd instance in application mode." I've verified the service is still running when I take this option.

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

Post by KS-Soft »

It does not work as a service at all unless I run hostmon.exe with the service running and take the "click No to keep service and launch 2nd instance in application mode." I've verified the service is still running when I take this option.
Well, its really bad idea to run 2 instances using the same configuration files. We added warnings to the manual and software itself. Do you really need to do this?

Ok, so problem is not related to power shell scripts. Its related to permissions - HostMonitor cannot start any external program at all. What acount is specified for the service in Windows Services applet? "Local system" account? or domain admin account?
Then you use domain admin account in HostMonitor Options dialog? Right? Could you try to specify local admin account instead of domain admin?

Regards
Alex
jimholcomb
Posts: 13
Joined: Wed Jul 25, 2007 12:12 pm

Post by jimholcomb »

I'm only running 2 instances for troubleshooting this problem.

The service is running with my domain admin account, and the test seems to run ok using the local service account.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

The service is running with my domain admin account, and the test seems to run ok using the local service account
So problem is solved?
Please note: local service account should be specified in Windows Services applet while admin account should be provided in HostMonitor Options dialog.

Regards
Alex
jimholcomb
Posts: 13
Joined: Wed Jul 25, 2007 12:12 pm

Post by jimholcomb »

KS-Soft wrote:
The service is running with my domain admin account, and the test seems to run ok using the local service account
So problem is solved?
Please note: local service account should be specified in Windows Services applet while admin account should be provided in HostMonitor Options dialog.

Regards
Alex
Changing the logon in the Windows Services applet to local service account along with the admin account in the options dialog fixed the problem.

Thanks!
Jim
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Great :)

Regards
Alex
Post Reply