Installation and Configuration (2024)

DNS considerations

If you are planning a large deployment, you may need to review your DNS configuration to ensure name lookups can be processed quickly.DNS lookups may be preformed by different processes, including while provisioning new nodes and when receiving syslog messages.It is vital that DNS lookups can be performed quickly to prevent them from becoming a bottleneck, which can happen if your deployment covers thousands of nodes.One way to mitigate DNS performance is to setup your Horizon as a secondary DNS server so that it is able to self-host DNS records for your network.

Pool size and maximum database connections

You must configure the PostgreSQL max_connections setting to at least twice the maximum pool size in Horizon.

The default maximum pool size value in Horizon is 50, but it applies to each connect in opennms-datasources.xml: opennms (the main connection used at runtime) and opennms-admin (the connection used during administrative operations, including installation).Therefore, your max_connections setting should be at least 100.

If you change the default pool size, make sure you also update the max_connections.You typically set this in PG_HOME/data/postgresql.conf, but you may also use the ALTER SYSTEM syntax.You must restart the PostgreSQL server for the changes to take effect.

You may find PGTune useful to calculate configuration parameters for PostgreSQL.As with all third-party tools, we do not endorse or guarantee it.Use it at your own discretion.
  • CentOS/RHEL 9

  • CentOS/RHEL 8

  • CentOS/RHEL 7

  • Debian/Ubuntu

  • Docker

Install language packs and set language

sudo dnf install langpacks-en glibc-all-langpacks -ysudo localectl set-locale LANG=en_US.UTF-8sudo localectlsudo dnf makecachesudo dnf update -ysudo rebootsudo dnf info postgresql-server
These procedures use a specific PostgreSQL version.Make sure you reference your current PostgreSQL version.

Install PostgreSQL client and server

sudo dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpmsudo dnf -y install postgresql14-server

Initialize the PostgreSQL database

sudo /usr/pgsql-14/bin/postgresql-14-setup initdb

Enable PostgreSQL on system boot and start immediately

sudo systemctl enable --now postgresql-14

Create an opennms database user and password

sudo -i -u postgres createuser -P opennms
You must provide a secure password for the opennms database user account.This guide uses YOUR-OPENNMS-PASSWORD as a placeholder.

Create an empty database and set the owner to the opennms user

sudo -i -u postgres createdb -O opennms opennms

Set a password for PostgreSQL superuser

sudo -i -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'YOUR-POSTGRES-PASSWORD';"
Change YOUR-POSTGRES-PASSWORD to a secure one.The superuser is required to be able to initialize and change the database schema for installation and updates.

Change the access policy for PostgreSQL

sudo vi /var/lib/pgsql/14/data/pg_hba.conf

Allow Horizon to access the database over the local network with an MD5 hashed password

host all all 127.0.0.1/32 md5 (1)host all all ::1/128 md5 (1)
1Change method from ident to md5 for IPv4 and IPv6 on localhost.

Apply configuration changes for PostgreSQL

sudo systemctl reload postgresql-14

Install PostgreSQL client and server

sudo dnf -y install postgresql-server postgresql

Initialize the PostgreSQL database

sudo postgresql-setup --initdb --unit postgresql

Enable PostgreSQL on system boot and start immediately

sudo systemctl enable --now postgresql

Create an opennms database user and password

sudo -i -u postgres createuser -P opennms
You must provide a password for the opennms database user. This guide uses YOUR-OPENNMS-PASSWORD as a placeholder. Please set a secure password.

Create an empty database and set the owner to the opennms user

sudo -i -u postgres createdb -O opennms opennms

Set a password for PostgreSQL superuser

sudo -i -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'YOUR-POSTGRES-PASSWORD';"
Change YOUR-POSTGRES-PASSWORD to a secure one. The superuser is required to be able to initialize and change the database schema for installation and updates.

Change the access policy for PostgreSQL

sudo vi /var/lib/pgsql/data/pg_hba.conf

Allow Horizon to access the database over the local network with an MD5 hashed password

host all all 127.0.0.1/32 md5(1)host all all ::1/128 md5(1)

Apply configuration changes for PostgreSQL

sudo systemctl reload postgresql

Add PostgreSQL 12 package repository

sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Install PostgreSQL 12 client and server

sudo yum -y install postgresql12-server postgresql12

Initialize PostgreSQL database

sudo /usr/pgsql-12/bin/postgresql-12-setup initdb

Enable PostgreSQL on system boot and start immediately

sudo systemctl enable --now postgresql-12

Create an opennms database user and password

sudo -i -u postgres createuser -P opennms
You must provide a password for the opennms database user. This guide uses YOUR-OPENNMS-PASSWORD as a placeholder. Please set a secure password.

Create an empty database and set the owner to the opennms user

sudo -i -u postgres createdb -O opennms opennms

Set a password for PostgreSQL superuser

sudo -i -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'YOUR-POSTGRES-PASSWORD';"
Change YOUR-POSTGRES-PASSWORD to a secure one. The superuser is required to initialize and change the database schema for installation and updates.

Change the access policy for PostgreSQL

sudo vi /var/lib/pgsql/12/data/pg_hba.conf

Allow Horizon to access the database over the local network with an MD5 hashed password

host all all 127.0.0.1/32 md5(1)host all all ::1/128 md5(1)
1Change method from ident to md5 for IPv4 and IPv6 on localhost.

Apply configuration changes for PostgreSQL

sudo systemctl reload postgresql-12

Install PostgreSQL client and server

sudo apt -y install postgresql

Create an opennms database user and password

sudo -u postgres createuser -P opennms
You must provide a password for the opennms database user. This guide uses YOUR-OPENNMS-PASSWORD as a placeholder. Please set a secure password.

Create an empty database and set the owner to the opennms user

sudo -u postgres createdb -O opennms opennms

Set a password for PostgreSQL superuser

sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'YOUR-POSTGRES-PASSWORD';"
Change YOUR-POSTGRES-PASSWORD to a secure one. The superuser is required to initialize and change the database schema for installation and updates.

Create a project directory for PostgreSQL and create a docker-compose.yml file

mkdir postgrescd postgresvi docker-compose.yml

Create the PostgreSQL service and publish the port on your local host

---version: '3'volumes: data-postgres: {}(1)services: database:(2) image: postgres:15(3) container_name: database environment:(4) TZ: 'America/New_York' POSTGRES_USER: 'postgres' POSTGRES_PASSWORD: 'my-postgres-password' volumes:(5) - 'data-postgres:/var/lib/postgresql/data' healthcheck:(6) test: [ "CMD-SHELL", "pg_isready -U postgres" ] interval: 10s timeout: 3s retries: 3 ports: - '5432:5432/tcp'
1Persist the PostgreSQL database in a local volume.
2PostgreSQL service is named database with a friendly container_name.
3Image reference using the official PostgreSQL image.
4Set the time zone and the postgres credentials for administrative tasks (for example, creating and changing database schemas for upgrades).
5Mount the volume for persisting the PostgreSQL database files.
6Run an internal health check to see if the PostgreSQL instance is ready.

Start the service and run it in background

docker-compose up -d

Verify the PostgreSQL process is up and running

docker-compose ps

The state should be Up (healthy) and the TCP port should be available on all interfaces

 Name Command State Ports--------------------------------------------------------------------------------database docker-entrypoint.sh postgres Up (healthy) 0.0.0.0:5432->5432/tcp

Install the core instance

For security reasons, Horizon is designed to run within an organization’s protected intranet.Do not expose the web console or sign in pages directly to the Internet without appropriate isolation controls (for example, a VPN with multi-factor authentication).

Add repository and import GPG key

sudo dnf -y install https://yum.opennms.org/repofiles/opennms-repo-stable-rhel9.noarch.rpmsudo rpm --import https://yum.opennms.org/OPENNMS-GPG-KEY

Install Horizon with all built-in dependencies

sudo dnf -y install {package-prefix}

If you want time series trending and forecast functions, you must install the R project packages.The additional download size for packages is ~390MB.

Note that R-core packages require that you have a PowerTools repository enabled.

(Optional) Install R-core packages for time series trending and forecasting

sudo dnf config-manager --set-enabled powertoolssudo dnf -y install epel-releasesudo dnf -y install R-core
Disable the OpenNMS Horizon repository after installation to prevent unwanted upgrades when upgrading other packages on the server.After upgrading, Horizon requires manual steps to upgrade configuration files or migrate database schemas to a new version.We recommend that you exclude the Horizon packages from updates except when you plan to perform an upgrade.

Disable auto updates for OpenNMS Horizon

sudo dnf config-manager --disable opennms-repo-stable-*

Verify directory structure with the tree command

sudo dnf -y install treetree /opt/opennms -L 1

Directory structure after successful installation

/opt/opennms├── bin├── contrib├── data├── deploy├── etc├── jetty-webapps├── lib├── logs -> /var/log/opennms├── share -> /var/opennms└── system

Add repository and import GPG key

sudo dnf -y install https://yum.opennms.org/repofiles/opennms-repo-stable-rhel8.noarch.rpmsudo rpm --import https://yum.opennms.org/OPENNMS-GPG-KEY

Install Horizon with all built-in dependencies

sudo dnf -y install {package-prefix}

If you want time series trending and forecast functions you must install the R project packages.The additional download size for packages is ~390 MB.

Note that R-core packages require that you have a PowerTools repository enabled.

Install R-core packages for time series trending and forecasting (optional)

sudo dnf config-manager --set-enabled powertoolssudo dnf -y install epel-releasesudo dnf -y install R-core
Disable the OpenNMS Horizon repository after installation to prevent unwanted upgrades when upgrading other packages on the server. After upgrade, Horizon requires manual steps to upgrade configuration files or migrate database schemas to a new version. We recommend that you exclude the Horizon packages from update except when you plan to perform an upgrade.

Disable auto updates for OpenNMS Horizon

sudo dnf config-manager --disable opennms-repo-stable-*

Verify directory structure with the tree command

sudo dnf -y install treetree /opt/opennms -L 1

Directory structure after successful installation

/opt/opennms├── bin├── contrib├── data├── deploy├── etc├── jetty-webapps├── lib├── logs -> /var/log/opennms├── share -> /var/opennms└── system

Add repository and import GPG key

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

Install Horizon with all built-in dependencies

sudo yum -y install {package-prefix}

If you want time series trending and forecast functions you must install the R project packages.The additional download size for packages is ~390 MB.

Note that R-core packages require that you have a PowerTools repository enabled.

Install R-core packages for time series trending and forecasting (optional)

sudo dnf config-manager --set-enabled powertoolssudo yum -y install epel-releasesudo yum -y install R-core
Disable the OpenNMS Horizon repository after installation to prevent unwanted upgrades when upgrading other packages on the server. After upgrade, Horizon requires manual steps to upgrade configuration files or migrate database schemas to a new version. We recommend that you exclude the Horizon packages from update except when you plan to perform an upgrade.

Disable auto updates for OpenNMS Horizon

sudo yum -y install yum-utilssudo yum-config-manager --disable opennms-repo-stable-*

Verify directory structure with the tree command

sudo yum -y install treetree /opt/opennms -L 1

Directory structure after successful installation

/opt/opennms├── bin├── contrib├── data├── deploy├── etc├── jetty-webapps├── lib├── logs -> /var/log/opennms├── share -> /var/opennms└── system

Add OpenNMS repository GPG key

curl -fsSL https://debian.opennms.org/OPENNMS-GPG-KEY | sudo gpg --dearmor -o /usr/share/keyrings/opennms.gpg

Add and update apt repository

echo "deb [signed-by=/usr/share/keyrings/opennms.gpg] https://debian.opennms.org stable main" | sudo tee /etc/apt/sources.list.d/opennms.listsudo apt update
You can safely ignore the message about conflicting distributions (expected stable but got opennms-xx).

Install OpenNMS Horizon with built-in dependencies (optional)

sudo apt -y install opennms

Install R packages for trending and forecasting (optional)

If you want time series trending and forecast functions you have to install the R project packages.The additional download size for packages is ~152 MB.

sudo apt -y install r-recommended
Disable the OpenNMS Horizon repository after installation to prevent unwanted upgrades when upgrading other packages on the server. After upgrade, Horizon requires manual steps to upgrade configuration files or migrate database schemas to a new version. We recommend that you exclude the Horizon packages from update except when you are planning on performing an upgrade.
sudo apt-mark hold libopennms-java \ libopennmsdeps-java \ opennms-common \ opennms-db

Verify directory structure with the tree command

sudo apt -y install treetree /usr/share/opennms -L 1

Directory structure after successful installation

/usr/share/opennms├── bin├── data├── deploy├── etc -> /etc/opennms├── jetty-webapps├── lib -> ../java/opennms├── logs -> /var/log/opennms├── share -> /var/lib/opennms└── system

Install GnuPG and add OpenNMS repository GPG key

sudo apt -y install curl gnupg ca-certificatescurl -fsSL https://debian.opennms.org/OPENNMS-GPG-KEY | sudo gpg --dearmor -o /usr/share/keyrings/opennms.gpg

Add and update apt repository

echo "deb [signed-by=/usr/share/keyrings/opennms.gpg] https://debian.opennms.org stable main" | sudo tee /etc/apt/sources.list.d/opennms.listsudo apt update
You can safely ignore the message about conflicting distributions (expected stable but got opennms-xx).

Install OpenNMS Horizon with built-in dependencies

sudo apt -y install opennms

Install R packages for trending and forecasting (optional)

If you want time series trending and forecast functions you must install the R project packages.The additional download size for packages is ~134 MB.

sudo apt -y install r-recommended
Disable the OpenNMS Horizon repository after installation to prevent unwanted upgrades when upgrading other packages on the server. After upgrade, Horizon requires manual steps to upgrade configuration files or migrate database schemas to a new version. We recommend that you exclude the Horizon packages from update except when you plan perform an upgrade.
sudo apt-mark hold libopennms-java \ libopennmsdeps-java \ opennms-common \ opennms-db

Verify directory structure with the tree command

sudo apt -y install treetree /usr/share/opennms -L 1

Directory structure after successful installation

/usr/share/opennms├── bin├── data├── deploy├── etc -> /etc/opennms├── jetty-webapps├── lib -> ../java/opennms├── logs -> /var/log/opennms├── share -> /var/lib/opennms└── system

Create a project directory for Horizon Core and create a docker-compose.yml file.

mkdir horizoncd horizonvi docker-compose.yml
---version: '3'volumes:(1) data-opennms: {} data-config: {}services: horizon:(2) image: opennms/horizon:33.0.5(3) container_name: horizon environment: TZ: 'America/New_York'(4) POSTGRES_HOST: 'my-database-host'(5) POSTGRES_PORT: 5432 POSTGRES_USER: 'postgres' POSTGRES_PASSWORD: 'my-postgres-password' OPENNMS_DBNAME: 'opennms-core-db' OPENNMS_DBUSER: 'opennms' OPENNMS_DBPASS: 'my-opennms-db-password' volumes:(6) - data-opennms:/opennms-data - data-config:/opt/opennms/etc command: ["-s"] ports:(7) - '8980:8980/tcp' - '8101:8101/tcp' healthcheck: test: [ 'CMD', 'curl', '-f', '-I', 'http://localhost:8980/opennms/login.jsp' ](8) interval: 1m timeout: 5s retries: 3
1Volume definitions to persist the Horizon Core data and configuration files.
2The Horizon Core instance service is named horizon with a friendly container_name.
3Image reference using the Horizon container image with the Core services.
4Set the time zone and the postgres credentials to initialize the database that the Horizon Core instance uses. To list all available time zones, use timedatectl list-timezones.
5Set the host or IP address of the host that runs the PostgreSQL database.
6Mount directories to store RRD files, PDF reports, and configuration files in a persistent volume.
7Publish ports to access the web UI and the Karaf shell.
8Run an internal health check against the web UI to verify service health status.
The process inside the container runs as a non-privileged user with user id 10001. If you want the configuration files in a bind mount on your local host system, make sure you set permissions and ownership accordingly with chown 10001:10001 ./path/to/my/config-dir.
To run a release candidate or a different version, use the public image tags from our repository on DockerHub.

Validate your Docker Compose file

docker-compose config -q

First-time sign in

After you start the Horizon core services, you can access the web application at http://core-instance-ip:8980/opennms.The default user credentials are as follows:

  • Username: admin

  • Password: admin

When you try to sign in with these credentials, Horizon prompts you to change your password.Although you also have the option to skip this action and sign in with default the credentials, we strongly recommend that you change the admin account’s password to a secure one.

  1. Type your current password.

  2. Type your new password and confirm it.

  3. Click Change Password.

Change password after first sign in

To change your account’s password after the first time you sign in, follow these steps:

  1. On the top menu bar, click Admin Change Password.

  2. Type your current password and new password in the appropriate fields.

  3. Confirm your new password, and click Submit.

The password is updated.

We encourage you to use Horizon with individual user accounts instead of using only the admin account.If all users have individual accounts, you can see who is completing tasks (for example, clearing or acknowledging alarms).For information on how to create personalized user accounts, see Create a new user in the Quick Start guide.

Usage statistics

The first time you sign in, Horizon notifies you that it collects anonymized usage statistics and publishes them to https://stats.opennms.com.Consent to share collected usage statistics is assumed by default.

The OpenNMS Group uses this information to help determine product use and to improve the Horizon software.We do not share it with third parties, and we will not use it for sales purposes.

Click Learn More to view the information that we collect and share.This also hides the notification.

Click Dismiss to simply hide the notification.You can view the usage statistics at any time on the admin page.

Admin users can opt out of sharing the statistics at any time.
Installation and Configuration (2024)
Top Articles
Latest Posts
Article information

Author: Msgr. Benton Quitzon

Last Updated:

Views: 5455

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Msgr. Benton Quitzon

Birthday: 2001-08-13

Address: 96487 Kris Cliff, Teresiafurt, WI 95201

Phone: +9418513585781

Job: Senior Designer

Hobby: Calligraphy, Rowing, Vacation, Geocaching, Web surfing, Electronics, Electronics

Introduction: My name is Msgr. Benton Quitzon, I am a comfortable, charming, thankful, happy, adventurous, handsome, precious person who loves writing and wants to share my knowledge and understanding with you.