Delete file using RMA

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
oryagel
Posts: 92
Joined: Wed Jul 28, 2010 10:23 am

Delete file using RMA

Post by oryagel »

Hi,

I created an action profile which should send an email with specific file attached and then delete that file.

The email part is OK.

To delete the file I created an "Execute external program" action:
cmd /c del C:\ProgramData\ABC\BatchErrors\%NewestFile%
I configured the action to be executed by RMA.
The RMA has permission to execute external program.

The file isn't being deleted.
Any idea what could be the issue?

Thanks
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

%NewestFile% can be specified for test parameters of test methods:
- Folder/File Size
- File/Folder Availability
- Count Files
- Text Log
- Compare Files

Also %NewestFile% can be specified in the "Attach file" parameter of Send e-mail (SMTP) action.

Please check the manual or visit our web site for more information about:
Send e-mail (SMTP) action: http://www.ks-soft.net/hostmon.eng/mfra ... m#actEMail
where can be used Macro variables http://www.ks-soft.net/hostmon.eng/mfra ... htm#macros
oryagel
Posts: 92
Joined: Wed Jul 28, 2010 10:23 am

Post by oryagel »

Thanks

Can you think of a way to delete the file after email was sent?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

HostMonitor/RMA actions allow you to remove specific file so its not a problem when you know file name.
If you don't know name, that's the problem...
May be there is some workaround but I need to understand your settings.

I am confused at the moment:
- RMA cannot send e-mails, so I assume you are using some 3rd party application? Then I do not understand how you pass %NewestFile% to that application :roll:
- If you send e-mail using HostMonitor then HostMonitor has access to the file so it can remove it. Why do you use RMA? Read-only access for account used by HostMonitor?

What kind of test triggers this actions?

Regards
Alex
oryagel
Posts: 92
Joined: Wed Jul 28, 2010 10:23 am

Post by oryagel »

HostMonitor sends the emails, not RMA.

How can I use HostMonitor to delete the file with the %NewestFile% variable?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

There is no such option. May be there is some workaround but I need to understand your settings.
What kind of test triggers this actions?

Regards
Alex
oryagel
Posts: 92
Joined: Wed Jul 28, 2010 10:23 am

Post by oryagel »

Hi,

The test type is: Folder/File Availability


The alert is executed if the %NewestFile% in specific folder is newer than 10 minutes.


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

Post by KS-Soft »

Then you may use %FileName% variable for both actions
http://www.ks-soft.net/hostmon.eng/mfra ... .htm#macro

Note: there is another problem. This action should be started after Send-EMail sends the file, right? Then I think you need to start this action after "2nd consecutive bas result" (if you send e-mail after 1st bad result). If some 3rd party application can add another file between actions, then this file will not be removed...

Regards
Alex
oryagel
Posts: 92
Joined: Wed Jul 28, 2010 10:23 am

Post by oryagel »

Thanks.
I can't know the fle name before it's being created, that is why I want to use the %NewestFile%.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

%NewestFile% can be used as parameter of "FileFolder Availability" test. Then test will find such newest file and set %FileName% variable that can be used by actions triggered by this test method. Please check the manual.

Regards
Alex
oryagel
Posts: 92
Joined: Wed Jul 28, 2010 10:23 am

Post by oryagel »

Thanks
Post Reply