Housekeeping Tasks

There are a number of housekeeping tasks you may want to do regularly to ensure optimum system performance. We also recommend you complete some of these housekeeping tasks before upgrading Horizon.

Prior to upgrading

Prune unneeded events

Use vacuumd or cron to regularly prune unneeded events. This helps to clean up your events table, and reduces the amount of data in your backups. We also recommend doing this before you begin the Horizon upgrade process.

For example, run the following to delete events older than six weeks that have no associated outages:

--# this deletes any events that are not associated with outages
(SELECT svclosteventid FROM outages WHERE svclosteventid = events.eventid
SELECT svcregainedeventid FROM outages WHERE svcregainedeventid = events.eventid
SELECT eventid FROM notifications WHERE eventid = events.eventid)
AND eventtime < now() - interval '6 weeks';

After Upgrading

Delete cache folder

Run the Fix Karaf script to delete cached items so that your system is cleaned up. We recommend doing this after an upgrade. This script tries to fix Karaf configuration problems by pruning opt/opennms/data and restoring all Karaf-related configuration files to a pristine state.

Back up /opt/opennms/etc before running the script.

Data collection

When enabled, the Data Choices module collects anonymous use statistics. It publishes them on system startup and every 24 hours after. Usage statistics include the following data points:

  • System ID (a randomly generated, universally unique identifier (UUID))

  • Horizon release

  • Horizon version

  • OS architecture

  • OS name

  • OS version

  • Number of available processors (CPU)

  • Amount of free physical memory

  • Amount of total physical memory

  • Number of alarms in the alarms table

  • Number of situations in the alarms table

  • Number of events in the events table

  • Number of IP interfaces in the ipinterface table

  • Number of nodes in the node table

  • Number of nodes, grouped by System OID

  • Number of locations

  • Number of Minions

  • Number of provisiond requisitions by scheme

  • Provisiond thread pool sizes

  • List of enabled/disabled services

  • List of installed features in Karaf

  • Global notification enablement status

  • Destination path count

  • On-call role count

  • Relational Database Management System (RDBMS) name

  • RDBMS version

  • Pollerd tasks completed

  • Event logs processed count

  • Core Flows persisted count

  • Core Newts samples inserted count

  • Core Queued updates completed

Enable or disable usage statistics collection

Admin users can enable or disable usage statistics collection at any time by logging into the UI, clicking the gear icon  Additional Tools  Data Choices and selecting Opt-in or Opt-out.