Common Install

This guide contains instructions for installing ALEC that are common to both the monolithic and distributed installs.

OpenNMS Configuration

$OPENMS_HOME

The installation instructions will refer to the $OPENNMS_HOME environment variable which is expected to be set.

If running OpenNMS on RHEL or CentOS, this is commonly set as:

export OPENNMS_HOME=/opt/opennms

If running OpenNMS on Ubuntu or Debian, this is commonly set as:

export OPENNMS_HOME=/usr/share/opennms

Health check

We’re going to use the health:check command in the Karaf shell to help validate our deployment. Let’s make sure all of the health checks pass before going any further.

From the OpenNMS Karaf shell, run:

health:check

In my case, the output looks like:

admin@opennms> health:check
Verifying the health of the container

Verifying installed bundles                    [ Success  ]
Connecting to ElasticSearch ReST API (Flows)   [ Timeout  ] => Health Check did not finish within 5000 ms

=> Oh no, something is wrong

The opennms-flows feature is installed by default, and the health check will fail no Elasticsearch server is configured. You can choose to either uninstall the feature (using feature:uninstall opennms-flows), or point the feature to an Elasticsearch instance using:

config:edit org.opennms.features.flows.persistence.elastic
config:property-set elasticUrl http://elastic:9200
config:update
Update the URL accordingly to point to your Elasticsearch instance.

We can now run the health check again, and expect to see output like:

admin@opennms> health:check
Verifying the health of the container

Verifying installed bundles                    [ Success  ]
Connecting to ElasticSearch ReST API (Flows)   [ Success  ]

=> Everything is awesome

Everything is awesome.

Enable alarm history storage for Elasticsearch

When using ALEC, we strongly recommend that leverage our integration for maintaining alarm history in Elasticsearch. This data can be used for analysis and to help train the correlation engine.

From the OpenNMS Karaf shell, run:

config:edit org.opennms.features.alarms.history.elastic
config:property-set elasticUrl http://elastic:9200
config:update
Update the URL accordingly to point to your Elasticsearch instance.

And install the feature using:

feature:install opennms-alarm-history-elastic

If everything is configured properly, the health check should show output similar to:

admin@opennms> health:check
Verifying the health of the container

Verifying installed bundles                                       [ Success  ]
Connecting to ElasticSearch ReST API (Flows)                      [ Success  ]
Number of active alarms stored in Elasticsearch (Alarm History)   [ Success  ] => Found 0 alarms.

=> Everything is awesome

Enable Syslogd

Let’s take advantage of the Syslog patterns and event definitions provided in ALEC by enabling Syslogd.

Enable Syslogd by editing $OPENNMS_HOME/etc/service-configuration.xml and changing:

<service enabled="false">
    <name>OpenNMS:Name=Syslogd</name>

to:

<service>
    <name>OpenNMS:Name=Syslogd</name>

This change will come in effect next time OpenNMS is restarted - we don’t need to do this yet.

ALEC/OpenNMS Package Repositories

Packages for ALEC are made available the same Debian and YUM repositories as OpenNMS. If you already have the stable repository installed, you may skip this step.

Setup APT repository (Ubuntu/Debian)

For Ubuntu or Debian based distributions, install the repository using:

cat << EOF | sudo tee /etc/apt/sources.list.d/opennms.list
deb https://debian.opennms.org stable main
deb-src https://debian.opennms.org stable main
EOF
wget -O - https://debian.opennms.org/OPENNMS-GPG-KEY | apt-key add -
apt update

Setup YUM repository (RHEL/CentOS)

For RHEL or CentOS based distributions, install the repository using:

yum -y install https://yum.opennms.org/repofiles/opennms-repo-stable-rhel7.noarch.rpm
rpm --import https://yum.opennms.org/OPENNMS-GPG-KEY