View previous topic :: View next topic |
Author |
Message |
dmgaddy
Joined: 25 Jun 2004 Posts: 1 Location: Asheville, NC
|
Posted: Fri Jun 25, 2004 9:26 am Post subject: RMA and external applications |
|
|
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? |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Fri Jun 25, 2004 10:19 am Post subject: |
|
|
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 |
|
Back to top |
|
|
mattb
Joined: 28 May 2004 Posts: 8
|
Posted: Fri Sep 24, 2004 1:12 pm Post subject: |
|
|
Was running a program on a remote server ever implimented?
If there is a test that is running through the RMA client and the test returns "Bad" then can you have Host Monitor "command" the remote server to run a program locally?
Thanks |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
|
Back to top |
|
|
mpriess
Joined: 02 Jul 2002 Posts: 112 Location: Arizona, USA
|
Posted: Mon Oct 25, 2004 1:14 pm Post subject: " " 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? |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Mon Oct 25, 2004 2:48 pm Post subject: |
|
|
I assume you are using "Execute external program" action?
Quote: | 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 |
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.
Script doesn't work correctly when it started by RMA? Probably RMA uses account that does not have enough permissions?
Regards
Alex |
|
Back to top |
|
|
mpriess
Joined: 02 Jul 2002 Posts: 112 Location: Arizona, USA
|
Posted: Mon Oct 25, 2004 3:48 pm Post subject: 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 |
|
Back to top |
|
|
Marcus
Joined: 18 Nov 2002 Posts: 367
|
Posted: Tue Oct 26, 2004 1:38 am Post subject: |
|
|
What xcopy is trying to do is the following:
xcopy c:\Program
with: Files\CA\eTrust Intrusion Detection\Engine\Day19 \\dacsnap01
as parameters (3 in this case).
That's the reason why you have to use quotes. A space is seen as a delimiter on the command line. |
|
Back to top |
|
|
mpriess
Joined: 02 Jul 2002 Posts: 112 Location: Arizona, USA
|
Posted: Tue Oct 26, 2004 9:43 am Post subject: 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. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Tue Oct 26, 2004 1:35 pm Post subject: |
|
|
mpriess,
What exactly I should use? I just tested HostMonitor 4.74 & RMA 2.0 on Windows 2000 SP4. Everything works fine (I used directory with spaces, used quotation marks...
Regards
Alex |
|
Back to top |
|
|
|