Configure Horizon to Use Newts

This section describes how to configure your Horizon instance to use Newts.

Setup

Follow these steps to set up Newts on your Horizon instance:

  1. Create a configuration file with your time series database settings:

    sudo vi etc/opennms.properties.d/timeseries.properties
  2. Configure the storage strategy:

    org.opennms.rrd.storeByForeignSource=true (1)
    org.opennms.timeseries.strategy=newts (2)
    1 Associate time series data using the foreign source and ID instead of the database-generated node ID.
    2 Set time series strategy to use Newts. If you are enabling the dual write plugin on an existing Horizon installation and you want to keep historical metrics, make sure that the written data has expired before you set org.opennms.timeseries.strategy to newts.
  3. Configure the Newts time series storage connection:

    org.opennms.newts.config.hostname=cassandra-ip1,cassandra-ip2 (1)
    org.opennms.newts.config.keyspace=newts (2)
    org.opennms.newts.config.port=9042 (3)
    1 Host or IP addresses of the Cassandra cluster nodes. Can be a comma-separated list.
    2 Name of the keyspace which is initialized and used.
    3 Port to connect to Cassandra.
  4. Set the retention rate and shard rate:

    # One year in seconds
    org.opennms.newts.config.ttl=31540000 (1)
    
    # Seven days in seconds
    org.opennms.newts.config.resource_shard=604800 (2)
    1 Retention rate for the time series data.
    2 Shard metrics every 7 days.
  5. (Optional) If your Horizon data collection or polling intervals have been modified, set the query minimum and heartbeat rates:

    org.opennms.newts.query.minimum_step=30000 (1)
    org.opennms.newts.query.heartbeat=45000 (2)
    1 The shortest collection interval configured for any collectable or pollable service, in milliseconds (in this case, 30 seconds).
    2 The communication interval for the Newts service, in milliseconds. Should be set to 1.5 times the maximum value of the collection interval configured for any collectable or pollable service, in milliseconds (in this case, 45 seconds).
  6. Initialize the Newts schema in Cassandra:

    bin/newts init
  7. Connect to Cassandra using the CQL shell:

    cd ${CASSANDRA_HOME}/bin
    ./cqlsh

Verify setup

After you have set the time series database to Newts and configured its settings, you must verify your setup and restart Horizon:

  1. Verify keyspace initialization:

    use newts;
    describe table terms;
    describe table samples;
  2. Restart Horizon to apply your changes and verify your configuration:

    systemctl restart opennms

After it restarts, Horizon will begin to persist metrics using the Newts engine. You can go to the Node Detail page for any SNMP-managed device to verify your setup; you should see response time graphs for the node’s ICMP and node-level performance data.

Only metrics stored in Newts are displayed in graphs. If you have data stored in RRD or JRB files, it will not be displayed unless it is migrated to Newts.