WAS THIS PAGE HELPFUL? Leave Feedback
The data retention procedures are used for maintaining database events (log messages) and event reporting in case of low disk space or system performance issues. Additionally, you will find information on managing the different GroundWork Monitor generated logs files. This page covers how to maintain the Foundation and Insight Reports database. Specifically, how to delete event messages and report entries, and clean log files.
Setting up the Archive process archive_gwcollagedb
Maintaining the Insight Reports Database dashboard
To selectively delete report entries from the dashboard database that are older then a certain date, use the following procedure.
- Open a terminal session and login as root user.
- Make sure no one is logged into the system, then stop GroundWork services and the Apache httpd daemon with the following commands:
/etc/init.d/groundwork stop gwservices
/etc/init.d/groundwork stop apache
- Enter the following command:
psql -d dashboard
- Delete specific report entries by entering the following commands with specified dates. The example below will delete daily alert entries before January 1, 2017.
delete from measurements where TIMESTAMP < '2017-01-01';
This will delete daily host availability entries before January 1, 2017.
delete from host_availability where DATESTAMP < '2017-01-01'
This will delete daily service availability before January 1, 2017.
delete from service_availability where DATESTAMP < '2017-01-01'
This will delete host group availability entries before January 1, 2017.
delete from hostgroup_host_availability where DATESTAMP < '2017-01-01'
This will delete daily service availability entries before January 1, 2017.
delete from hostgroup_service_availability where DATESTAMP < '2017-01-01'
- Exit the psql command-line utility by entering the following command:
- Restart GroundWork services and the Apache httpd daemon with the following commands:
/etc/init.d/groundwork start gwservices
/etc/init.d/groundwork start apache
The packages that comprise GroundWork Monitor will generate log files in several places on the disk. This is by design, and is useful in many cases to find out what is happening with the data that the packages gather and store. Nagios, for example will use its log files for the default reports it generates. The down side is that log file take up space, and so there are several settings needed for the Linux utility program known as logrotate to clean up these files periodically. GroundWork has adjusted these settings according to parameters that will work in most cases. Sometimes, however, it will be necessary to add or remove logs from rotation. For example, if a package is added, and it generates log files, these should be rotated to avoid filling the disk.
- Log rotate settings:
All the settings specific to GroundWork can be found in the /etc/logrotate.d/groundwork file. This file is created when GroundWork Monitor is installed, and is removed upon and uninstall. This file may be edited to adjust the settings as necessary, however, when adjusting logrotate settings, be sure to test them with the following command using root user:
logrotate -d /etc/logrotate.d/
- Log files rotated by default:
The following log files are rotated by default at the interval of once a day, with old files saved for 8 days:
- Other files:
The following files may or may not exist, depending on user settings. They will be rotated once a day, with old files saved for 8 days, if they do exist:
- /usr/local/groundwork/common/var/log/syslog-ng/ (all files)
- The following files may be accidentally created, due to default settings in the Nagios tool. These settings are off by default in GroundWork's implementation of Nagios, but they would grow without bound if turned on, and that can fill the disk. Users should be aware that these files will be rotated by default every day, and that only one day's worth of old files will be kept.
- Nagios log files:
Finally, the Nagios log files are archived by Nagios, but are never deleted. These files are useful for reporting purposes within the Nagios system (Nagios Reports). They can be large, however, especially if the default logging is changed in the Nagios tool to log more information, such as state stalking. Thus GroundWork settings will remove old log files after a month. The old Nagios log files are located in the /usr/local/groundwork/nagios/var/archives directory.