How to check if a File exists or not using Monitor Solution
search cancel

How to check if a File exists or not using Monitor Solution

book

Article ID: 426606

calendar_today

Updated On:

Products

IT Management Suite Server Management Suite

Issue/Introduction

When files go missing on Servers apps can crash and time can be spent trying to find the files that went missing.  This Monitory Policy was created for such a case where the admin needs to know when important files are deleted that cause app instability.

NOTE: the method shown in this Monitor Policy can be adapted for any other Command Line or Batch file scripted checks as needed.

Resolution

A Command Metric was created and used in a Policy to find if a file exists or not.  If not, alerts are enabled, and you can also add additional tasks, such as Email alerts.  This policy was Exported and attached to this KB.

The command checks: 

We used a test file named MonitorFile.log on the root of C:\.  Change this as needed.

To Import the attached XML file: 

    1. Import the Monitor Pack
    2. Very Important:  Schedule the Import to Run Now so that this Monitor Policy is imported to your SMP.
    3. Refresh the Console to see this new Policy
    4. Edit as needed for your application

Attachments

Monitor policy agent based - check if MonitorFile.log exists on disk C__.xml get_app