RMA and external applications

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
dmgaddy
Posts: 1
Joined: Fri Jun 25, 2004 9:07 am
Location: Asheville, NC
Contact:

RMA and external applications

Post by dmgaddy »

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?
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

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
mattb
Posts: 8
Joined: Fri May 28, 2004 11:42 am

Post by mattb »

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
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Was running a program on a remote server ever implimented?
Yes, this option implemented...
http://www.ks-soft.net/hostmon.eng/news.htm#v470

Regards
Alex
User avatar
mpriess
Posts: 112
Joined: Tue Jul 02, 2002 6:00 pm
Location: Arizona, USA

" " getting put around put around external command

Post by mpriess »

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?
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I assume you are using "Execute external program" action?
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
User avatar
mpriess
Posts: 112
Joined: Tue Jul 02, 2002 6:00 pm
Location: Arizona, USA

Created share so I could remove quotes around path - works

Post by mpriess »

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
User avatar
Marcus
Posts: 367
Joined: Mon Nov 18, 2002 6:00 pm

Post by Marcus »

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.
User avatar
mpriess
Posts: 112
Joined: Tue Jul 02, 2002 6:00 pm
Location: Arizona, USA

Works with quotes outside of hostmonitor...

Post by mpriess »

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.
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

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
Post Reply