Hi, I have Hostmonitor monitoring a service on a remote agent.
When the service status goes bad, i want Hostmonitor to restart the service. Can it do that?
I am using the %Agent% in teh computer field and %ServiceName% in the Service field. Thats not working.
How can i do that
Thanks
Tony
Restarting a Remote Agent
RMA cannot perform actions, this functionality will be implemented in future versions.
As workaround you can use additional "External" test.
E.g.
- if you have TestA that checks whether or not service is running, create another "External" test (TestB) for the same RMA. TestB (for example) can start simple BAT file
-----
NET STOP service_name
NET START service_name
-----
- by default TestB should be disabled!
- test interval for TestB should be longer than test interval for TestA.
- now you just need to add 2 actions (1 "bad" action, and 1 "good" action) into action profile that is assigned to TestA
1st "bad" action should execute HMScript with single command "EnableTest TestB"
2nd "good" action should execute HMScript with single command "DisableTest TestB"
That's it.
Now if TestA fails, it will enable TestB that in turn will execute BAT file on the remote system. When TestA detects that process is running, it will disable TestB (to avoid unnecessary restarts of the service).
Regards
Alex
As workaround you can use additional "External" test.
E.g.
- if you have TestA that checks whether or not service is running, create another "External" test (TestB) for the same RMA. TestB (for example) can start simple BAT file
-----
NET STOP service_name
NET START service_name
-----
- by default TestB should be disabled!
- test interval for TestB should be longer than test interval for TestA.
- now you just need to add 2 actions (1 "bad" action, and 1 "good" action) into action profile that is assigned to TestA
1st "bad" action should execute HMScript with single command "EnableTest TestB"
2nd "good" action should execute HMScript with single command "DisableTest TestB"
That's it.
Now if TestA fails, it will enable TestB that in turn will execute BAT file on the remote system. When TestA detects that process is running, it will disable TestB (to avoid unnecessary restarts of the service).
Regards
Alex