Icinga2 with InfluxDB and Grafana HowTo

This forum was archived to /woltlab and is now in read-only mode.
  • This Howto describes how to install InfluxDB and Grafana on CentOS 7.


    InfluxDB:

    • Enable the repository:
    Code
    1. cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo
    2. [influxdb]
    3. name = InfluxDB Repository - RHEL \$releasever
    4. baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
    5. enabled = 1
    6. gpgcheck = 1
    7. gpgkey = https://repos.influxdata.com/influxdb.key
    8. EOF
    9. yum makecache fast
    • Install:
    Code
    1. yum install -y influxdb
    2. systemctl enable influxdb
    3. systemctl start influxddb
    • Create Icinga user
    Code
    1. create database icinga2;
    2. create user icinga2 with password '$PASSWORD';
    3. grant all on icinga2 to icinga2;
    4. quit

    Icinga2:

    • Enable feature:
    Code
    1. icinga2 feature enable influxdb
    • Configure InfluxdbWriter
    • Restart icinga2 and check logfile:
    Code
    1. systemctl restart icinga2 && tail -f /var/log/icinga2/icinga2.log

    Grafana:

    • Enable the repository:
    • Install:
    Code
    1. yum install -y grafana
    2. systemctl enable grafana-server
    3. systemctl start grafana-server
    • Configure Datasource
    1. Go to http://localhost:3000 and login with admin:admin
    2. Go to 'Create your first data source'.

    1. Download the Dashboard Icinga2 with InfluxDB
    2. Click at 'Home' in the upper left corner and click 'Import'
    3. Select the imported Dashboard below 'Home'

    Grafana behind a reverse proxy / Nginx:


    Code
    1. location /grafana {
    2. proxy_set_header Host $host;
    3. rewrite ^/grafana/(.*) /$1 break;
    4. proxy_pass http://localhost:3000/;
    5. }
  • If you're looking for automation, try the Vagrant box. It is far from perfect but there are good Puppet modules out there.


    https://github.com/icinga/icinga-vagrant#icinga-2-influxdb