Have installed HM on my application server and want to monitor and restart a program on another server.
DETAILS: Svr1: HM Svr2: RMA
Test Name: Outlook on Svr2
Test By: Agent:Svr2
Test Method Check Process: OUTLOOK
Alert Profile: Restart Outlook
Action Properties: Execute External Program
Command Line: outlook.exe
Syslog.htm
Error: cannot execute command "outlook.exe". The system cannot find the file specified.
Why will this not work? Is HM trying to run outlook.exe from Svr1 or Svr2? I have tried a simple batch file (NSOutlook.bat) but get the same error. Help?
RMA and external applications
Agent performs the tests but it cannot execute actions. This option will be implemented in future.
Workaround - use additional "External" test that will be executed by RMA and restart program
E.g.
- if you have TestA that checks process on remote system, create another "External" test (TestB) for the same RMA. TestB will start your BAT file;
- 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 working, it will disable TestB (to avoid unnecessary restart).
Regards
Alex
Workaround - use additional "External" test that will be executed by RMA and restart program
E.g.
- if you have TestA that checks process on remote system, create another "External" test (TestB) for the same RMA. TestB will start your BAT file;
- 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 working, it will disable TestB (to avoid unnecessary restart).
Regards
Alex
Yes, this option implemented...Was running a program on a remote server ever implimented?
http://www.ks-soft.net/hostmon.eng/news.htm#v470
Regards
Alex
" " getting put around put around external command
I'm testing the execute external program from RMA using the following command line script:
xcopy "c:\Program Files\CA\eTrust Intrusion Detection\Engine\%CommentLine1%\*.*" \\dacsnap01\LAN\Logs\idslogs\DAC-IDS\%CommentLine1% /E /F /R
The script above works fine when run manually on the server where RMA is installed.
However, according to the hostmonitor logs the script being generated \executed within Hostmonitor has quotes ("s)around it. Here is the external command as posted in the system log:
[10/25/2004 11:39:50 AM] Sys Command "xcopy c:\Program Files\CA\eTrust Intrusion Detection\Engine\Day19 \\dacsnap01\LAN\Logs\idslogs\DAC-IDS\Day19 /E /F /R" executed
The quotes generate a parse error. Are the quotes I have placed in the script getting it confused?
xcopy "c:\Program Files\CA\eTrust Intrusion Detection\Engine\%CommentLine1%\*.*" \\dacsnap01\LAN\Logs\idslogs\DAC-IDS\%CommentLine1% /E /F /R
The script above works fine when run manually on the server where RMA is installed.
However, according to the hostmonitor logs the script being generated \executed within Hostmonitor has quotes ("s)around it. Here is the external command as posted in the system log:
[10/25/2004 11:39:50 AM] Sys Command "xcopy c:\Program Files\CA\eTrust Intrusion Detection\Engine\Day19 \\dacsnap01\LAN\Logs\idslogs\DAC-IDS\Day19 /E /F /R" executed
The quotes generate a parse error. Are the quotes I have placed in the script getting it confused?
I assume you are using "Execute external program" action?
Script doesn't work correctly when it started by RMA? Probably RMA uses account that does not have enough permissions?
Regards
Alex
No, script does not have quotes (I mean HostMonitor does not add quotes to the command line). HostMonitor uses quotes for the log only, this way you can see what is the command and what is HostMonitor's comment.However, according to the hostmonitor logs the script being generated \executed within Hostmonitor has quotes ("s)around it. Here is the external command as posted in the system log:
[10/25/2004 11:39:50 AM] Sys Command "xcopy c:\Program Files\CA\eTrust Intrusion Detection\Engine\Day19 \\dacsnap01\LAN\Logs\idslogs\DAC-IDS\Day19 /E /F /R" executed
Script doesn't work correctly when it started by RMA? Probably RMA uses account that does not have enough permissions?
Regards
Alex
Created share so I could remove quotes around path - works
I created a share so the script would not need quotes around the source path and now the execute external program action works correctly for the xcopy command.
I can use this workaround but would prefer not to have to create a share if a foldername contains spaces.
Can you duplicate this issue?
Thx,
Mark
I can use this workaround but would prefer not to have to create a share if a foldername contains spaces.
Can you duplicate this issue?
Thx,
Mark
Works with quotes outside of hostmonitor...
Correct Marcus. The script works with quotes when I run it outside of hostmonitor...from the command line on the server. But, when it is triggered via the external program execution within hostmonitor it does not work.
So, to get around having to use quotes I just created a share (without spaces in the name) so I wouldn't have to use quotes.
So, to get around having to use quotes I just created a share (without spaces in the name) so I wouldn't have to use quotes.