Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

dashing-icinga2

> DevOps
Open source

Dashing dashboard for Icinga 2 using the REST API

197 stars0 likes2 views
WebsiteGitHub

About

Dashing dashboard for Icinga 2 using the REST API

Dashing with Icinga 2

** As of v3.3 dashing-icinga2 will actually use** smashing and not dashing anymore.

Table of Contents

  1. Introduction
  2. Support
  3. License
  4. Requirements
  5. Installation
  6. Configuration
  7. Run
  8. Authors
  9. Troubleshooting
  10. Development

Introduction

Smashing is a Sinatra based framework that lets you build beautiful dashboards.

You can put your important infrastructure stats and metrics on your office dashboard. Data can be pulled with custom jobs or pushed via REST API. You can re-arrange widgets via drag&drop. Possible integrations include Icinga, Grafana, ticket systems such as RT or OTRS, sensors, weather, schedules, etc. -- literally anything which can be presented as counter or list.

Icinga 2 Dashboard

The Icinga 2 dashboard is built on top of Smashing and uses the Icinga 2 API to visualize what's going on with your monitoring. It combines several popular widgets and provides development instructions for your own implementation. The dashboard also allows to embed the Icinga Web 2 host and service problem lists as Iframe.

Support

This is a demo playground with jobs, widgets and dashboards. You can use and modify them for your own needs. You can also send PRs with custom widgets and propose their use in the dashboard.

In terms of implementation specific questions, please read the development docs first.

License

  • The code for jobs, dashboards and libraries is licensed under the MIT license.
  • Smashing is licensed under the MIT license.
  • Chartjs is licensed under the MIT license.

Requirements

  • Ruby, Gems and Bundler
  • Smashing Ruby Gem
  • Icinga 2 (v2.11+) and the REST API

Supported browsers and clients:

  • Linux, Unix, *Pi
  • Chrome, Firefox, Safari
  • "new" Edge [v79 and above]

Windows with IE and old Edge (without Chromium) is not supported since SSE (Server Sent Events) are not implemented.

Installation

Docker

The Docker image is located at dbodky/dashing-icinga2. You can also build your own Docker image from the provided Dockerfile. Modify it when needed. When pulling the image from DockerHub, the correct image architecture should get pulled automatically.

The environment variables from this project can be used to configure the container.

Example on macOS with Docker for Mac:

bash
docker run -it -p 5666:5665 -p 8005:8005 -e ICINGA2_API_HOST='docker.for.mac.localhost' -e ICINGA2_API_PORT=5665 -e ICINGA2_API_USERNAME='root' -e ICINGA2_API_PASSWORD='icinga' dbodky/dashing-icinga2

Note that the Docker container exposes port 8005 by default. Modifying this requires you to build your own image.

Source

Either clone this repository from GitHub or download the tarball.

Git clone:

bash
cd /usr/share
git clone https://github.com/mocdaniel/dashing-icinga2.git
cd dashing-icinga2

Tarball download:

bash
cd /usr/share
wget https://github.com/mocdaniel/dashing-icinga2/archive/master.zip
unzip master.zip
mv dashing-icinga2-master dashing-icinga2
cd dashing-icinga2

Linux

RedHat/CentOS 7 (requires EPEL repository):

bash
yum makecache
yum -y install epel-release
yum -y install rubygems rubygem-bundler ruby-devel openssl gcc-c++ make nodejs

Note: The development tools and header files are required for building the eventmachine gem.

Debian/Ubuntu:

apt-get update
apt-get -y install ruby bundler nodejs

Proceed with the bundler gem installation.

gem install bundler

In case the installation takes quite long and you do not need any documentation, add the --no-document flags.

Proceed with bundling for all systems (CentOS, Ubuntu, Debian etc.)

Install the dependencies using Bundler. Do not run this as root.

cd /usr/share/dashing-icinga2
bundle

Note In case bundle complains about missing write access to /usr/share/dashing-icinga2/Gemfile.lock, add write permissions accordingly

Proceed to the configuration section.

Unix and macOS

On macOS OpenSSL was deprecated, therefore you'll need to fix the eventmachine gem:

bash
brew install openssl
bundle config build.eventmachine --with-cppflags=-I/usr/local/opt/openssl/include
bundle install --path binpaths

Proceed to the configuration section.

Configuration

Icinga 2 API

The Icinga 2 API requires either basic authentication or client certificates.

Add a new ApiUser object to your Icinga 2 configuration. Choose the path depending on your setup type. Keep in mind that synced ApiUser objects expose the login information to other Icinga 2 instances.

vim /etc/icinga2/conf.d/api-users.conf

vim /etc/icinga2/zones.d/global-templates/api-users.conf
object ApiUser "dashing" {
  password = "icinga2ondashingr0xx"
  permissions = [ "status/query", "objects/query/*" ]
}

Set the ApiUser permissions according to your needs. By default the Icinga 2 job fetches data from the /v1/status and /v1/objects API endpoints, but does not require write permissions. If you're extending the API queries on your own, keep in mind to add proper permissions.

In case you want to use client certificates, set the client_cn attribute accordingly.

Smashing Configuration

Configuration File

Copy the example configuration from config/icinga2.json into config/icinga2.local.json and adjust the settings for the Icinga 2 API credentials in the icinga2 section.

The icingaweb2 section allows you to specify the Icinga Web 2 URL for the iframe widgets. This is read on startup once.

cp config/icinga2.json config/icinga2.local.json
vim config/icinga2.local.json

{
  "icinga2": {
    "api": {
      "host": "localhost",
      "port": 5665,
      "user": "dashing",
      "password": "icinga2ondashingr0xx"
    }
  },
  "icingaweb2": {
    "url": "http://localhost/icingaweb2"
  },
  "dashboard": {
    "show_only_hard_state_problems": false,
    "timezone": "UTC",
    "url_prefix": ""
  }
}

The show_only_hard_state_problems option ignores NOT-OK states until they reach a hard NOT-OK state (off by default). The timezone option controls the clock widget's timezone.

If you prefer to use client certificates, set the pki_path attribute. The Icinga 2 job expects the certificate file names based on the local FQDN e.g. pki/icinga2-master1.localdomain.crt. You can override this behaviour by specifying the node_name configuration option explicitly.

{
  "icinga2": {
    "api": {
      "host": "localhost",
      "port": 5665,
      "user": "dashing",
      "pki_path": "pki/",
      "node_name": "icinga2-master1.localdomain"
    }
  },
  "icingaweb2": {
    "url": "http://localhost/icingaweb2"
  },
  "dashboard": {
    "show_only_hard_state_problems": false,
    "timezone": "UTC",
    "url_prefix": ""
  }
}

Note:

If both methods are configured, the Icinga 2 job prefers client certificates.

Environment Variables

If you prefer to configure the Icinga 2 settings in environment variables, you can do so as well. This helps with containers or local development tests.

Variable Description
ICINGA2_API_HOST Required. Host where the API is listening on.
ICINGA2_API_PORT Required. Port where the API is listening on.
ICINGA2_API_USERNAME Optional. Required for basic auth as username.
ICINGA2_API_PASSWORD Optional. Required for basic auth as password.
ICINGA2_API_CERT_PATH Optional. Client certificate path.
ICINGA2_API_NODENAME Optional. If client certificates do not match the host name, override it.
ICINGAWEB2_URL Optional. Set the Icinga Web 2 Url. Defaults to http://localhost/icingaweb2.
DASHBOARD_SHOW_ONLY_HARD_STATE_PROBLEMS Optional. Set show_only_hard_state_problems configuration option, toggle with `0
DASHBOARD_TIMEZONE Optional. Set the timezone option for the dashboard, overriding the default UTC value.
DASHBOARD_URL_PREFIX Optional. Set the url prefix e.g. when running behind a reverse proxy

Note

Environment variables always override local configuration.

Example:

ICINGA2_API_HOST=localhost ICINGA2_API_PORT=5665 ICINGA2_API_USERNAME=root ICINGA2_API_PASSWORD=icinga puma config.ru -p 8005

Run

Systemd Service

Install the provided Systemd service file from tools/systemd. It assumes that the working directory is /usr/share/dashing-icinga2 and the Smashing gem is installed to /usr/local/bin/smashing. Adopt these paths for your own needs.

Redhat/CentOS

cp tools/systemd/dashing-icinga2.service /usr/lib/systemd/system/
systemctl daemon-reload
systemctl start dashing-icinga2.service
systemctl status dashing-icinga2.service

Debian

bash
cp tools/systemd/dashing-icinga2.service /lib/systemd/system/
systemctl daemon-reload
systemctl start dashing-icinga2.service
systemctl status dashing-icinga2.service

Script

You can start smashing as daemon by using this script:

./restart-dashing

Additional options are available through ./restart-dashing -h.

Navigate to http://localhost:8005

Foreground

You can run Smashing in foreground for tests and debugging too:

bash
export PATH="/usr/local/bin:$PATH"
puma config.ru -p 8005

Or with environment variables:

ICINGA2_API_HOST=localhost ICINGA2_API_PORT=5665 ICINGA2_API_USERNAME=root ICINGA2_API_PASSWORD=icinga puma config.ru -p 8005

Reverse Proxy / Subfolder

To configure the application to run in a subfolder, e.g. for a reverse proxy, set the DASHBOARD_URL_PREFIX environment variable or set the corresponding value in config/icinga2.local.json

Apache 2 reverse proxy example for DASHBOARD_URL_PREFIX=/icinga2-dashing


    ProxyPass http://127.0.0.1:8005/icinga2-dashing/
    ProxyPassReverse http://127.0.0.1:8005/icinga2-dashing/

Logrotate

You can install the provided logrotate script to rotate the Dashing log in /usr/share/dashing-icinga2/log.

cp tools/logrotate/dashing-icinga2 /etc/logrotate.d

Authors

Original author:

  • dnsmichi

Maintainer as of May 2020:

  • mocdaniel

Thanks to all contributors! :)

  • flourish86 for the UX design and CSS tips.
  • marconett for the colorized and sorted problem list widget.
  • tutabeier for environment variables inspiration instead of a local configuration file.
  • mcktr for helping out with unhandled problems.
  • tachtler for the Systemd service and logrotate additions.
  • fugstrolch for the [Icinga Web 2 iframe integration](https://github.co

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptdashboarddashingicinga2widgets

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理