Installing Icinga DB from Source¶
Using go install
¶
You can build and install icingadb
as follows:
go install github.com/icinga/icingadb@latest
This should place the icingadb
binary in your configured $GOBIN
path which defaults to $GOPATH/bin
or
$HOME/go/bin
if the GOPATH
environment variable is not set.
Build from Source¶
Download or clone the source and run the following command from the source’s root directory.
go build -o icingadb cmd/icingadb/main.go
Setting up the Database¶
A MySQL (≥5.5), MariaDB (≥10.1), or PostgreSQL (≥9.6) database is required to run Icinga DB. Please follow the steps listed for your target database, which guide you through setting up the database and user and importing the schema.
Info
In high availability setups, all Icinga DB instances must write to the same database.
Setting up a MySQL or MariaDB Database¶
If you use a version of MySQL < 5.7 or MariaDB < 10.2, the following server options must be set:
innodb_file_format=barracuda
innodb_file_per_table=1
innodb_large_prefix=1
Set up a MySQL database for Icinga DB:
# mysql -u root -p
CREATE DATABASE icingadb;
CREATE USER 'icingadb'@'localhost' IDENTIFIED BY 'CHANGEME';
GRANT ALL ON icingadb.* TO 'icingadb'@'localhost';
After creating the database, import the Icinga DB schema using the following command:
mysql -u root -p icingadb </usr/share/icingadb/schema/mysql/schema.sql
Setting up a PostgreSQL Database¶
Set up a PostgreSQL database for Icinga DB:
# su -l postgres
createuser -P icingadb
createdb -E UTF8 --locale en_US.UTF-8 -T template0 -O icingadb icingadb
psql icingadb <<<'CREATE EXTENSION IF NOT EXISTS citext;'
The CREATE EXTENSION
command requires the postgresql-contrib
package.
Edit pg_hba.conf
, insert the following before everything else:
local all icingadb md5
host all icingadb 0.0.0.0/0 md5
host all icingadb ::/0 md5
To apply these changes, run systemctl reload postgresql
.
After creating the database, import the Icinga DB schema using the following command:
psql -U icingadb icingadb < /usr/share/icingadb/schema/pgsql/schema.sql
Configuring Icinga DB¶
Create a local config.yml
file using the sample configuration.
Most of the settings are pre-populated for a local setup.
Before running Icinga DB, adjust the Redis® and database credentials and, if necessary, the connection configuration.
The configuration file explains general settings.
All available settings can be found under Configuration.
Running Icinga DB¶
You can execute icingadb
by running it with the locally accessible config.yml
file:
icingadb -config /path/to/config.yml
Installing Icinga DB Web¶
With Icinga 2, Redis®, Icinga DB and the database fully set up, it is now time to install Icinga DB Web, which connects to both Redis® and the database to display and work with the monitoring data.
You have completed the instructions here and can proceed to installing Icinga DB Web From Source, which will also guide you through the setup of the Icinga Web PHP framework, which is required to run the Icinga DB web module. Below is a preview of how the interface visualizes monitoring data and also supports dark and light mode: