Goal
This document explains the steps that can be followed to delete old Denodo Monitor log files using Custom Monitors. We recommend testing the changes in lower environments before applying the changes on a production environment.
Introduction
The Denodo Monitor is the component which is majorly used to monitor the Denodo servers and by default it stores all the information in log files. We can keep the Denodo Monitor running indefinitely to log all the events happening in the server which can later be used for diagnosis purposes.
Over time, the amount of log files may increase and it may consume a lot of space in the system. For instance, there may be log files which have been generated for more than one year and at some point of time, we will want to either archive the old log files or simply delete them. We will see how Custom Monitors can be used to delete older log files.
Custom Monitors
Custom Monitors are local monitors which can be used to execute different customizable commands. These monitors can be configured in the ConfigurationParameters.properties file located under <DENODO_MONITOR_HOME>/conf folder.
Typically, the below properties are available for Custom Monitors:
monitors.custom=<name_of_custom_monitor> <name_of_custom_monitor>.interval <name_of_custom_monitor>.log.datepattern <name_of_custom_monitor>.command |
- The property ‘monitors.custom’ contains the list of names of the different Custom Monitors that are used.
- For each Custom Monitor, the interval (in seconds) is the property which indicates when the monitor should be executed based on the time interval.
- The Custom Monitor log file’s date pattern can be altered based on the log.datepattern property.
- The command property is the action that will be performed by the Custom Monitor.
This article explains examples related to the monitor configurations which can be used in the following two scenarios:
- Monitoring started using the standalone Denodo Monitor setup.
- Monitoring started via Solution Manager.
Monitoring started using the standalone Denodo Monitor setup
When Denodo Monitor (by default, available under the <DENODO_HOME>\tools\monitor\denodo-monitor\ folder) is used, stop the process and edit the ConfigurationParameters.properties file located under <DENODO_MONITOR_HOME>\conf folder to include the below lines. These properties are available under Custom monitors settings and you can just uncomment and edit the properties as below.
monitors.custom=monitor1_deleteOldLogs monitor1_deleteOldLogs.interval=10 monitor1_deleteOldLogs.log.datepattern=yyyy-MM-dd monitor1_deleteOldLogs.command=cmd /c FORFILES /p ..\\logs /D -5 /C "cmd /C del /q @PATH" |
The above example command is based on a Windows environment.
NOTE: On Windows environments make sure to escape the backslash character for the path of the log files (use \\ instead of \ as path separator).
In case if Denodo Monitor is being used in a Linux environment, a command based on below example format can be used:
monitor1_deleteOldLogs.command=find ../logs -type f -mtime +5 -exec rm -f {} \; |
The example based on the above properties will delete log files which are older than 5 days. Ideally, it would backtrack to the logs folder where the Denodo Monitor logs are available and remove the appropriate files. The values of the properties and commands can be modified as required.
After saving the above configuration, when the Denodo Monitor is started, the related Custom Monitor is also started.
Now, the log files older than 5 days would get deleted from the Denodo Monitor logs folder.
Monitoring started via Solution Manager
When Monitoring is started via the Solution Manager, then modify the template file of Denodo Monitor’s Configuration file available in the Solution Manager installation.
To enable the Custom Monitor, edit the file ConfigurationParametersGeneral.template located under <SOLUTION_MANAGER_HOME>\conf\solution-manager\denodo-monitor folder in the same way as in the previous section.
Now, on starting Monitoring via the Solution Manager Administration Tool, the log files older than 5 days will get deleted from the respective folder.
Similarly, users can configure the Custom Monitor’s commands based on the requirements and the OS used.
Note that the above examples will delete the log files and it may not be possible to retrieve them back. Keep this in mind before configuring the Denodo Monitor to delete log files.
References
The information provided in the Denodo Knowledge Base is intended to assist our users in advanced uses of Denodo. Please note that the results from the application of processes and configurations detailed in these documents may vary depending on your specific environment. Use them at your own discretion.
For an official guide of supported features, please refer to the User Manuals. For questions on critical systems or complex environments we recommend you to contact your Denodo Customer Success Manager.