How to monitor a file using OpManager?
OpManager provides extensive file monitoring capabilities. Follow the steps given below to configure file monitoring in OpManager.
Adding File Monitoring Template
You can now track changes on critical system and user files and be notified if a specific change occurs. For instance, you might want to be notified if the file size increases beyond a defined limit, if some files are missing, log prints etc. Configure meaningful templates in OpManager and apply them to devices on which you want the files monitored. Using the following file monitoring features you can monitor the following parameters:
File Content: Presence of a word/string or in a log file, supports regex as well
File size: Watch for an increase or decrease in the file size
Presence of a file: Check the availability of a file in the specified directory (may have been moved, renamed, or deleted)
File age: Keep track of the age of a file and take actions based on the age
File modification: Be notified if a file has been modified.
Steps to configure a file monitoring template
- Go to Admin-> File Monitoring Templates.
- Click New Template. Add New Template window opens.
- Template Name: Configure a name for the template.
- File Path: Specify the path in which OpManager should locate the file.
- Polling Interval: Configure the interval at which OpManager should monitor the file.
- Description: Provide a brief, meaningful description for the template and click Next.
Configuring Alerts for File Monitors
Configure the monitoring criteria based on which you want to be notified:
- File Contains: To monitor the print of a word/string in a log file, you have to install log file monitoring agent in the end server where the application is running. Click on Agent link to download and install the agent. Once you install the agent, it looks for the specified string in the said log file. If the word/string is printed in the log file, OpManager raises alert. If required, you can configure the agent to match the case when searching for the word/string. The notification can be triggered if the alert condition is met the specified number of times.
- File Existence: OpManager looks for the file in the specified path and alerts based on the conditions specified. You can configure to be notified if the file does not exist in the path specified, or be notified if the file exists , or you can choose not to monitor. Also, choose the severity that you would like to assign to this alert. The notification can be triggered if the alert condition is met the specified number of times. That is, OpManager alerts you if a particular file does not exist in a path during two consecutive polls.
- File Size: Configure OpManager to alert you if the file size goes over, or comes below a specified size. Select the relevant threshold for alerting. You can configure the size in terms of bytes, KB, MB, or GB. Choose the severity that you would like to assign to this alert. The alert can be triggered if the threshold is violated a specified number of times.
- File Age: Similarly, you can configure OpManager to alert you based on the age of the file. For instance, you can be notified if a file is over 20 days old.
- File Modification: When a file is modified, the date on which the file is modified is updated. You can configure OpManager to notify you whenever there is a change in the date modified. This option helps you keep track of any changes done in critical files. Choose the severity that you would like to assign to this alert.
Associating the File monitor to devices
Having created a template with the alert criteria, you can now associate the template to the devices.
- After configuring the threshold details, click Next. The devices are listed on the left.
- Select the devices for which you want to apply this template and move them to the right.
- Click on Associate button at the bottom of the column to associate the template to all the selected devices.
The monitor is added to the device and OpManager alerts based on the alert conditions configured.
- Ensure that the device in which in you are installing the agent has already been added in OpManager.
- Click on the download link to download the agent.
- Install it on the machine which has the log file. Double-click the exe to begin the installation.