{"id":27165021,"url":"https://github.com/mocdaniel/dashing-icinga2","last_synced_at":"2025-04-09T02:50:49.379Z","repository":{"id":46052966,"uuid":"44397989","full_name":"mocdaniel/dashing-icinga2","owner":"mocdaniel","description":"Dashing dashboard for Icinga 2 using the REST API","archived":false,"fork":false,"pushed_at":"2023-07-07T15:13:15.000Z","size":6908,"stargazers_count":203,"open_issues_count":6,"forks_count":48,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-01T19:03:20.075Z","etag":null,"topics":["dashboard","dashing","icinga2","widgets"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mocdaniel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-10-16T16:40:10.000Z","updated_at":"2025-03-14T17:26:18.000Z","dependencies_parsed_at":"2023-01-19T02:46:07.754Z","dependency_job_id":"c5e4a2a4-0167-483d-8402-c701aefe310c","html_url":"https://github.com/mocdaniel/dashing-icinga2","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mocdaniel%2Fdashing-icinga2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mocdaniel%2Fdashing-icinga2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mocdaniel%2Fdashing-icinga2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mocdaniel%2Fdashing-icinga2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mocdaniel","download_url":"https://codeload.github.com/mocdaniel/dashing-icinga2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247968240,"owners_count":21025798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dashboard","dashing","icinga2","widgets"],"created_at":"2025-04-09T02:50:48.776Z","updated_at":"2025-04-09T02:50:49.366Z","avatar_url":"https://github.com/mocdaniel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://img.shields.io/docker/cloud/build/dbodky/dashing-icinga2)\n# Dashing with Icinga 2\n\n** As of v3.3 dashing-icinga2 will actually use** `smashing` and not `dashing` anymore.\n\n#### Table of Contents\n\n1. [Introduction](#introduction)\n2. [Support](#support)\n3. [License](#license)\n4. [Requirements](#requirements)\n4. [Installation](#installation)\n5. [Configuration](#configuration)\n6. [Run](#run)\n7. [Authors](#authors)\n8. [Troubleshooting](#troubleshooting)\n9. [Development](#development)\n\n## Introduction\n\n[Smashing](https://smashing.github.io/) is a Sinatra based framework\nthat lets you build beautiful dashboards.\n\nYou can put your important infrastructure stats and metrics on your office\ndashboard. Data can be pulled with custom jobs or pushed via REST API. You can re-arrange\nwidgets via drag\u0026drop. Possible integrations include [Icinga](https://www.icinga.com/), [Grafana](https://grafana.com/),\nticket systems such as [RT](https://bestpractical.com/request-tracker/) or [OTRS](https://www.otrs.com),\n[sensors](https://shop.netways.de/), [weather](https://github.com/Shopify/dashing/wiki/Additional-Widgets),\n[schedules](https://blog.netways.de/2013/06/21/netrp-netways-resource-planner/),\netc. -- literally anything which can be presented as counter or list.\n\n### Icinga 2 Dashboard\n\nThe Icinga 2 dashboard is built on top of Smashing and uses the [Icinga 2 API](https://www.icinga.com/products/icinga-2/)\nto visualize what's going on with your monitoring. It combines several popular widgets\nand provides development instructions for your own implementation. The dashboard\nalso allows to embed the [Icinga Web 2](https://www.icinga.com/products/icinga-web-2/)\nhost and service problem lists as Iframe.\n\n![Dashing Icinga 2](public/dashing_icinga2_overview.png \"Dashing Icinga 2\")\n\n## Support\n\nThis is a demo playground with jobs, widgets and dashboards. You can use and modify them for\nyour own needs. You can also send PRs with custom widgets and propose their use in the dashboard.\n\nIn terms of implementation specific questions, please read the [development docs](#development)\nfirst.\n\n## License\n\n* The code for jobs, dashboards and libraries is licensed under the MIT license.\n* Smashing is licensed under the [MIT license](https://github.com/Smashing/smashing/blob/master/MIT-LICENSE).\n* Chartjs is licensed under the [MIT license](https://github.com/chartjs/Chart.js/blob/master/LICENSE.md).\n\n## Requirements\n\n* Ruby, Gems and Bundler\n* Smashing Ruby Gem\n* Icinga 2 (v2.11+) and the REST API\n\nSupported browsers and clients:\n\n* Linux, Unix, \\*Pi\n* Chrome, Firefox, Safari\n* \"new\" Edge [v79 and above]\n\n**Windows with IE and old Edge (without Chromium) is not supported since SSE (Server Sent Events) are not implemented.**\n\n## Installation\n\n### Docker\n\nThe Docker image is located at [dbodky/dashing-icinga2](https://hub.docker.com/r/dbodky/dashing-icinga2).\nYou 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.\n\nThe environment variables from this project can be used to configure the container.\n\nExample on macOS with Docker for Mac:\n\n```\ndocker 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\n```\n\nNote that the Docker container exposes port 8005 by default. Modifying this requires you to build your own image.\n\n### Source\n\nEither clone this repository from GitHub or download the tarball.\n\nGit clone:\n\n```\ncd /usr/share\ngit clone https://github.com/mocdaniel/dashing-icinga2.git\ncd dashing-icinga2\n```\n\nTarball download:\n\n```\ncd /usr/share\nwget https://github.com/mocdaniel/dashing-icinga2/archive/master.zip\nunzip master.zip\nmv dashing-icinga2-master dashing-icinga2\ncd dashing-icinga2\n```\n\n\n### Linux\n\n#### RedHat/CentOS 7 (requires EPEL repository):\n\n```\nyum makecache\nyum -y install epel-release\nyum -y install rubygems rubygem-bundler ruby-devel openssl gcc-c++ make nodejs\n```\n\nNote: The development tools and header files are required for building the `eventmachine` gem.\n\n#### Debian/Ubuntu:\n\n```\napt-get update\napt-get -y install ruby bundler nodejs\n```\n\nProceed with the `bundler` gem installation.\n\n```\ngem install bundler\n```\n\nIn case the installation takes quite long and you do not need any documentation,\nadd the `--no-document` flags.\n\n#### Proceed with bundling for all systems (CentOS, Ubuntu, Debian etc.)\n\nInstall the dependencies using Bundler. **Do not run this as root.**\n\n```\ncd /usr/share/dashing-icinga2\nbundle\n```\n\n\u003e**Note**\n\u003e In case bundle complains about missing write access to `/usr/share/dashing-icinga2/Gemfile.lock`,\n\u003e add write permissions accordingly\n\nProceed to the [configuration](#configuration) section.\n\n### Unix and macOS\n\nOn macOS [OpenSSL was deprecated](https://github.com/eventmachine/eventmachine/issues/602),\ntherefore you'll need to fix the eventmachine gem:\n\n```\nbrew install openssl\nbundle config build.eventmachine --with-cppflags=-I/usr/local/opt/openssl/include\nbundle install --path binpaths\n```\n\nProceed to the [configuration](#configuration) section.\n\n\n## Configuration\n\n### Icinga 2 API\n\nThe Icinga 2 API requires either basic authentication or client certificates.\n\nAdd a new ApiUser object to your Icinga 2 configuration. Choose the\npath depending on your setup type. Keep in mind that synced ApiUser\nobjects expose the login information to other Icinga 2 instances.\n\n```\nvim /etc/icinga2/conf.d/api-users.conf\n\nvim /etc/icinga2/zones.d/global-templates/api-users.conf\n```\n\n```\nobject ApiUser \"dashing\" {\n  password = \"icinga2ondashingr0xx\"\n  permissions = [ \"status/query\", \"objects/query/*\" ]\n}\n```\n\nSet the [ApiUser permissions](https://www.icinga.com/docs/icinga2/latest/doc/12-icinga2-api/#permissions)\naccording to your needs. By default the Icinga 2 job fetches\ndata from the `/v1/status` and `/v1/objects` API endpoints, but does not require write\npermissions. If you're extending the API queries on your own, keep in mind to add\nproper permissions.\n\nIn case you want to use client certificates, set the `client_cn` attribute accordingly.\n\n### Smashing Configuration\n\n#### Configuration File\n\nCopy the example configuration from `config/icinga2.json` into `config/icinga2.local.json`\nand adjust the settings for the Icinga 2 API credentials in the `icinga2` section.\n\nThe `icingaweb2` section allows you to specify the Icinga Web 2 URL\nfor the iframe widgets. This is read on startup once.\n\n```\ncp config/icinga2.json config/icinga2.local.json\n```\n\n```\nvim config/icinga2.local.json\n\n{\n  \"icinga2\": {\n    \"api\": {\n      \"host\": \"localhost\",\n      \"port\": 5665,\n      \"user\": \"dashing\",\n      \"password\": \"icinga2ondashingr0xx\"\n    }\n  },\n  \"icingaweb2\": {\n    \"url\": \"http://localhost/icingaweb2\"\n  },\n  \"dashboard\": {\n    \"show_only_hard_state_problems\": false,\n    \"timezone\": \"UTC\",\n    \"url_prefix\": \"\"\n  }\n}\n```\n\nThe `show_only_hard_state_problems` option ignores NOT-OK states until they\nreach a hard NOT-OK state (off by default). The `timezone` option controls the clock widget's\ntimezone.\n\nIf you prefer to use client certificates, set the `pki_path` attribute. The Icinga 2\njob expects the certificate file names based on the local FQDN e.g. `pki/icinga2-master1.localdomain.crt`.\nYou can override this behaviour by specifying the `node_name` configuration option\nexplicitly.\n\n```\n{\n  \"icinga2\": {\n    \"api\": {\n      \"host\": \"localhost\",\n      \"port\": 5665,\n      \"user\": \"dashing\",\n      \"pki_path\": \"pki/\",\n      \"node_name\": \"icinga2-master1.localdomain\"\n    }\n  },\n  \"icingaweb2\": {\n    \"url\": \"http://localhost/icingaweb2\"\n  },\n  \"dashboard\": {\n    \"show_only_hard_state_problems\": false,\n    \"timezone\": \"UTC\",\n    \"url_prefix\": \"\"\n  }\n}\n```\n\n\u003e **Note:**\n\u003e\n\u003e If both methods are configured, the Icinga 2 job prefers client certificates.\n\n#### Environment Variables\n\nIf you prefer to configure the Icinga 2 settings in environment variables, you\ncan do so as well. This helps with containers or local development tests.\n\nVariable                 | Description\n-------------------------|-------------------------\nICINGA2\\_API\\_HOST       | **Required.** Host where the API is listening on.\nICINGA2\\_API\\_PORT       | **Required.** Port where the API is listening on.\nICINGA2\\_API\\_USERNAME   | **Optional.** Required for basic auth as username.\nICINGA2\\_API\\_PASSWORD   | **Optional.** Required for basic auth as password.\nICINGA2\\_API\\_CERT\\_PATH | **Optional.** Client certificate path.\nICINGA2\\_API\\_NODENAME   | **Optional.** If client certificates do not match the host name, override it.\nICINGAWEB2\\_URL          | **Optional.** Set the Icinga Web 2 Url. Defaults to `http://localhost/icingaweb2`.\nDASHBOARD_SHOW_ONLY_HARD_STATE_PROBLEMS | **Optional.** Set `show_only_hard_state_problems` configuration option, toggle with `0|1`.\nDASHBOARD_TIMEZONE       | **Optional.** Set the `timezone` option for the dashboard, overriding the default `UTC` value.\nDASHBOARD_URL_PREFIX     | **Optional.** Set the url prefix e.g. when running behind a reverse proxy\n\n\u003e **Note**\n\u003e\n\u003e Environment variables always override local configuration.\n\nExample:\n\n```\nICINGA2_API_HOST=localhost ICINGA2_API_PORT=5665 ICINGA2_API_USERNAME=root ICINGA2_API_PASSWORD=icinga puma config.ru -p 8005\n```\n\n## Run\n\n### Systemd Service\n\nInstall the provided Systemd service file from `tools/systemd`. It assumes\nthat the working directory is `/usr/share/dashing-icinga2` and the Smashing gem\nis installed to `/usr/local/bin/smashing`. Adopt these paths for your own needs.\n\n#### Redhat/CentOS\n\n```\ncp tools/systemd/dashing-icinga2.service /usr/lib/systemd/system/\nsystemctl daemon-reload\nsystemctl start dashing-icinga2.service\nsystemctl status dashing-icinga2.service\n```\n\n#### Debian\n\n```bash\ncp tools/systemd/dashing-icinga2.service /lib/systemd/system/\nsystemctl daemon-reload\nsystemctl start dashing-icinga2.service\nsystemctl status dashing-icinga2.service\n```\n\n### Script\n\nYou can start smashing as daemon by using this script:\n\n```\n./restart-dashing\n```\n\nAdditional options are available through `./restart-dashing -h`.\n\nNavigate to [http://localhost:8005](http://localhost:8005)\n\n\n### Foreground\n\nYou can run Smashing in foreground for tests and debugging too:\n\n```\nexport PATH=\"/usr/local/bin:$PATH\"\npuma config.ru -p 8005\n```\n\nOr with environment variables:\n\n```\nICINGA2_API_HOST=localhost ICINGA2_API_PORT=5665 ICINGA2_API_USERNAME=root ICINGA2_API_PASSWORD=icinga puma config.ru -p 8005\n```\n\n### Reverse Proxy / Subfolder\n\nTo configure the application to run in a subfolder, e.g. for a reverse proxy, set the `DASHBOARD_URL_PREFIX` environment\nvariable or set the corresponding value in `config/icinga2.local.json`\n\nApache 2 reverse proxy example for `DASHBOARD_URL_PREFIX=/icinga2-dashing`\n\n```\n\u003cLocation /icinga2-dashing/\u003e\n    ProxyPass http://127.0.0.1:8005/icinga2-dashing/\n    ProxyPassReverse http://127.0.0.1:8005/icinga2-dashing/\n\u003c/Location\u003e\n```\n\n### Logrotate\n\nYou can install the provided logrotate script to rotate the Dashing log in `/usr/share/dashing-icinga2/log`.\n\n```\ncp tools/logrotate/dashing-icinga2 /etc/logrotate.d\n```\n\n## Authors\n\nOriginal author:\n\n* [dnsmichi](https://github.com/dnsmichi)\n\nMaintainer as of May 2020:\n* [mocdaniel](https://github.com/mocdaniel)\n\nThanks to all contributors! :)\n\n* [flourish86](https://github.com/flourish86) for the UX design and CSS tips.\n* [marconett](https://github.com/marconett) for the [colorized and sorted problem list widget](https://github.com/dnsmichi/dashing-icinga2/pull/41).\n* [tutabeier](https://github.com/tutabeier) for [environment variables](https://github.com/dnsmichi/dashing-icinga2/pull/35) inspiration instead of a local configuration file.\n* [mcktr](https://github.com/mcktr) for helping out with [unhandled problems](https://github.com/dnsmichi/dashing-icinga2/pull/18).\n* [tachtler](https://github.com/tachtler) for the [Systemd service and logrotate](https://github.com/dnsmichi/dashing-icinga2/pull/6) additions.\n* [fugstrolch](https://github.com/fugstrolch) for the [Icinga Web 2 iframe integration](https://github.com/dnsmichi/dashing-icinga2/pull/4).\n* [tobiasvdk](https://github.com/tobiasvdk) for check stats widget and suggestions.\n* [bodsch](https://github.com/bodsch) for the [job rewrite and config file support](https://github.com/dnsmichi/dashing-icinga2/pull/3) inspiration, and [better error handling](https://github.com/dnsmichi/dashing-icinga2/pull/21).\n* [spjmurray](https://github.com/spjmurray) for [styling and 1080p resolution](https://github.com/spjmurray/dashing-icinga2/tree/1080p).\n* [micke2k](https://github.com/micke2k) for [proper time formatting](https://github.com/dnsmichi/dashing-icinga2/pull/2).\n* [lazyfrosch](https://github.com/lazyfrosch) for ideas on [Dashing with Icinga](https://github.com/lazyfrosch/dashing-icinga).\n* [roidelapliue](https://github.com/roidelapluie) for the [Icinga 1.x dashing script](https://github.com/roidelapluie/dashing-scripts).\n* [](https://github.com/austinjhung) for reevaluating switching to Puma + Smashing instead of Thin + Dashing.\n\n## Troubleshooting\n\nPlease add these details when you are asking a question on the community channels.\n\n### Required Information\n\n* Dashing/Smashing version (`gem list --local dashing`)\n* Ruby version (`ruby -V`)\n* Icinga 2 version (`icinga2 --version`)\n* Version of this project (tarball name, download date, tag name or `git show -1`)\n* Your own modifications to this project, if any\n\n### Widgets are not updated\n\n* Open your browser's development console and check for errors.\n* Ensure that the job runner does not log any errors.\n* Stop the smashing daemon and run it in foreground.\n\n### Connection Errors\n\nIf the connection to the Icinga 2 API was interrupted, check for possible network issues.\nThe Icinga 2 daemon might have been reloaded at that time.\n\n* Manually test the Icinga 2 API (check https://www.icinga.com/docs for the official documentation)\n* Verify that the configuration file contains the correct API details\n* Modify the `jobs/icinga2.rb` and add additional logging (use `puts` similar to existing examples)\n* Run Dashing in foreground\n\n### Misc Errors\n\n* Port 8005 is not reachable. Ensure that the firewall rules are setup accordingly.\n\n## Development\n\nFork the repository on GitHub, commit your changes and send a PR please :)\n\nThe Icinga 2 dashboard mainly depends on the following files:\n\n* `dashboards/icinga2.erb`\n* `jobs/icinga2.rb`\n* `lib/icinga2.rb`\n* `config/icinga2.json`\n\nAdditional changes are inside the widgets. `simplemon` and `simplelist` have been added. `meter` was modified to update the\nmaximum value at runtime. `list` was updated to highlight colors and change font sizes.\n\n### Configuration\n\nYou can use environment variables to quickly set the required configuration settings:\n\n```\nICINGA2_API_HOST=localhost ICINGA2_API_PORT=5665 ICINGA2_API_USERNAME=root ICINGA2_API_PASSWORD=icinga puma config.ru -p 8005\n```\n\n### Icinga 2 Library\n\n`lib/icinga2.rb` provides a class `icinga` which is responsible\nfor reading the configuration file, initializing the api connection\nand fetching data.\n\nSeveral public attributes are exposed by this class already. You'll\nneed to instantiate a new object and then call the `run` method.\n\nThen you are able to access these attributes and public functions\nsuch as `getHostobjects` and `getServiceObjects`. These two functions\ncan be called by passing\n\n* attrs as an array of attribute strings\n* filter as Icinga 2 API filter string\n* joins as an array of joined objects and/or attributes\n\nA simple test runner for testing own modifications has been added\ninto `test/icinga2.rb`. You can find additional examples over there as\nwell.\n\n\u003e **Note**\n\u003e\n\u003e These code parts may change. Keep this in mind on updates.\n\n\n### Icinga 2 Job\n\nWidgets are updated by calling `send_event` inside the `jobs/icinga2.rb` file\nin the event scheduler.\n\nThe widget data is calculated from the `Icinga2` object class.\n\nInclude the Icinga 2 library:\n\n```ruby\nrequire './lib/icinga2'\n```\n\nInstantiate a new object called `icinga` from the `Icinga2` class. Add the\npath to the configuration file.\n\n```ruby\n# initialize data provider\nicinga = Icinga2.new('config/icinga2.json') # fixed path\n```\n\nRun the scheduler every five seconds and start it now.\n\n```ruby\nSCHEDULER.every '5s', :first_in =\u003e 0 do |job|\n```\n\nThen call the `run` method to fetch the current data into the `icinga` object\n\n```ruby\n# run data provider\nicinga.run\n```\n\nNow you are able to access the exported object attributes and call available\nobject methods. Please check `libs/icinga2.rb` for specific options. If you\nrequire more attributes and/or methods please send a PR!\n\n### Icinga 2 Dashboard\n\nThe dashboard is located in the `dashboards/icinga2.erb` file and mostly\nconsists of an HTML list. It can be used as template where variables are\nread from the `config.ru` file but that's for advanced usage.\n\nExample:\n\n```html\nvim dashboards/icinga2.erb\n\n\u003cli data-row=\"1\" data-col=\"1\" data-sizex=\"1\" data-sizey=\"1\"\u003e\n  \u003cdiv data-id=\"icinga-host-meter\" data-view=\"Meter\" data-title=\"Host Problems\" data-min=\"0\" data-max=\"100\" style=\"background-color: #0095bf;\"\u003e\u003c/div\u003e\n\u003c/li\u003e\n```\n\nThe following attributes are important:\n\n* `data-row` and `data-col` specify the location of the widget on screen.\n* `data-sizex` and `data-sizey` specify the width and height of a widget by tiles.\n* `data-view` defines the name of the widget to use\n* `data-id` specifies the name of the data source for the used widget (important for `send_event` later)\n* `data-title` defines the widget's title on top\n* `data-min` and `data-max` are widget specific in this example. They are referenced inside the Coffee script file inside the widget code.\n* `style` can be used to specify certain CSS to make the widget look more beautiful if not already.\n* `class=scrollable` allows for scrolling of crammed widgets. Works for most widgets but is mostly meant to be used with `List` and `Simplelist`.\n\n### Dashboard Widgets\n\nThe widgets are located inside the `widgets` directory. Each widget consists of three files:\n\n* `widget.html` defines the basic layout\n* `widget.scss` specifies required styling\n* `widget.coffee` implements the event handlng for the widget, e.g. `OnData` when `send_event` pushes new data.\n\n#### Meter\n\nThis widget is used to display host and service problem counts. The maximum value is updated\nat runtime too because of API-created objects.\n\nExample:\n\n```ruby\nvim jobs/icinga2.rb\n\n  send_event('icinga-host-meter', {\n   value: host_meter,\n   max:   host_meter_max,\n   moreinfo: \"Total hosts: \" + host_meter_max.to_s,\n   color: 'blue' })\n```\n\n`icinga-host-meter` is the value of the `data-id` field in the `dashboards/icinga2.erb` file.\n\n```\nvim dashboards/icinga2.erb\n\n    \u003cli data-row=\"1\" data-col=\"2\" data-sizex=\"1\" data-sizey=\"1\"\u003e\n      \u003cdiv data-id=\"icinga-host-meter\" data-view=\"Meter\" data-title=\"Host Problems\" data-min=\"0\" data-max=\"100\"\u003e\u003c/div\u003e\n    \u003c/li\u003e\n```\n\nIn order to update the widget you'll need to send a hash which contains the following keys\nand values:\n\n* `value` containing the current problem count\n* `max` specifying the current object count\n* `moreinfo` creating a string which is displayed below the meter as legend\n* `color` for specifying the widget's color\n\n#### List\n\nUsed to print the average checks per minute and list service problems by severity.\n\nExample for check statistics:\n\nCreate a new array containing a hash for each table row. The `label` key is required,\n`value` is optional.\n\n```ruby\nvim jobs/icinga2.rb\n\n  icinga_stats = [\n    {\"label\" =\u003e \"Host checks/min\", \"value\" =\u003e icinga.host_active_checks_1min},\n    {\"label\" =\u003e \"Service checks/min\", \"value\" =\u003e icinga.service_active_checks_1min},\n  ]\n```\n\nUse this array inside the `icinga-stats` event (`data-id` in the `dashboards/icinga2.erb` file)\nas `items` attribute. You can add `moreinfo` which provides an additional legend for this widget.\n`color` is optional.\n\n```ruby\nvim jobs/icinga2.rb\n\n  send_event('icinga-stats', {\n   title: icinga.version + \" (\" + icinga.version_revision + \")\",\n   items: icinga_stats,\n   moreinfo: \"Avg latency: \" + icinga.avg_latency.to_s + \"s\",\n   color: 'blue' })\n```\n\n#### Simplelist\n\nPrint problem counts by state as background color in a simple list.\n\nExample:\n\n```ruby\nvim jobs/icinga2.rb\n\n  # Combined view of unhandled host problems (only if there are some)\n  unhandled_host_problems = []\n\n  if (icinga.host_count_problems_down \u003e 0)\n    unhandled_host_problems.push(\n      { \"color\" =\u003e icinga.stateToColor(1, true), \"value\" =\u003e icinga.host_count_problems_down },\n    )\n  end\n\n  send_event('icinga-host-problems', {\n    items: unhandled_host_problems,\n    moreinfo: \"All Problems: \" + icinga.host_count_problems_down.to_s\n  })\n```\n\n#### Simplemon\n\nPrint problem counts by state and coloring. Also add acknowledged objects and those\nin downtime.\n\nExample:\n\n```ruby\nvim jobs/icinga2.rb\n\nsend_event('icinga-service-critical', {\n value: icinga.service_count_critical.to_s,\n color: 'red' })\n```\n\n`icinga-service-critical` is the value of `data-id` field inside the `dashboards/icinga2.erb`\nfile. In order to update the widget you need to send a `value` and a `color` as hash values.\n\n#### IFrame\n\nYou can edit `dashboards/icinga2.erb` to modify the iframe widget\nfor Icinga Web 2. Keep in mind that you keep the template function `\u003c%=getIcingaWeb2Url()%\u003e`\nin order to read the Icinga Web 2 Host and URL from the configuration.\n\nExample URL:\n\n```\n/icingaweb2/monitoring/list/services?service_problem=1\u0026sort=service_severity\u0026dir=desc\n```\n\nAdd the fullscreen and compact options for those views.\n\n```\n\u0026showFullscreen\u0026showCompact\n```\n\nExample:\n\n```html\n    \u003c!-- Icinga Web 2 iFrame. getIcingaWeb2Url() is defined in config.ru and reads from config/icinga2*.json --\u003e\n    \u003cli data-row=\"3\" data-col=\"1\" data-sizex=\"2\" data-sizey=\"2\"\u003e\n      \u003cdiv data-id=\"iframe\" data-view=\"Iframe\" data-url=\"\u003c%=getIcingaWeb2Url()%\u003e/monitoring/list/hosts?host_problem=1\u0026sort=host_severity\u0026showFullscreen\u0026showCompact\"\u003e\u003c/div\u003e\n    \u003c/li\u003e\n    \u003cli data-row=\"3\" data-col=\"3\" data-sizex=\"2\" data-sizey=\"2\"\u003e\n      \u003cdiv data-id=\"iframe\" data-view=\"Iframe\" data-url=\"\u003c%=getIcingaWeb2Url()%\u003e/monitoring/list/services?service_problem=1\u0026sort=service_severity\u0026dir=desc\u0026showFullscreen\u0026showCompact\"\u003e\u003c/div\u003e\n    \u003c/li\u003e\n```\n\n#### Chartjs\n\nOriginal from [tywhang](https://github.com/tywhang/smashing-chartjs-example).\n\n\n#### Roundchartjs\n\nA fork of [tywhang's](https://github.com/tywhang/smashing-chartjs-example) Chartjs widget, with minimal HTML changes in order to render round charts (specifically `doughnut` and `pie` in the correct size for dashing-icinga2's default widget settings.\n\n\n#### Clock\n\nShow the time in a specific timezone. Enter the timezone as found in `/usr/share/zoneinfo` on Linux.\n\nExample:\n\n```html\n    \u003cli data-row=\"1\" data-col=\"1\" data-sizex=\"1\" data-sizey=\"1\"\u003e\n      \u003cdiv data-view=\"Clock\" data-title=\"UTC\" data-timezone=\"UTC\"\u003e\u003c/div\u003e\n    \u003c/li\u003e\n    \u003cli data-row=\"1\" data-col=\"2\" data-sizex=\"1\" data-sizey=\"1\"\u003e\n      \u003cdiv data-view=\"Clock\" data-title=\"New York\" data-timezone=\"America/New_York\"\u003e\u003c/div\u003e\n    \u003c/li\u003e\n```\n\n### Docker\n\n```\ndocker build . -t dbodky/dashing-icinga2\ndocker login\ndocker push dbodky/dashing-icinga2\n```\n\nTest with Docker for Mac:\n\n```\ndocker run -it -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\n```\n\nIn order to test things, add `bash` as the last parameter. This avoids running `start.sh` and allows to test further.\n\n\n### References\n\n- https://community.icinga.com/t/extend-icinga-dashing-for-your-own-needs/763\n- https://community.icinga.com/t/dashing-for-icinga-3-0-0/2523\n- https://www.icinga.com/2016/01/28/awesome-dashing-dashboards-with-icinga-2/\n- https://www.icinga.com/2016/12/22/merry-xmas-dashing-with-icinga-2-v1-1-0-is-here/\n- https://www.icinga.com/2017/07/13/dashing-for-icinga-2-v1-3-0-released/\n\n- https://www.antonissen.net/2017/02/19/monitoring-your-network-with-icinga-2-final-part-6/\n- https://community.spiceworks.com/how_to/147719-icinga2-dashing\n- https://linoxide.com/monitoring-2/setup-monitoring-dashing-icinga2/\n- http://brunner-it.de/2016/08/04/icinga2-dashing-installieren/\n- https://www.unixe.de/icinga2-dashing/\n\n#### Feedback\n\n- https://twitter.com/Mikeschova/status/1229415489627181056 \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmocdaniel%2Fdashing-icinga2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmocdaniel%2Fdashing-icinga2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmocdaniel%2Fdashing-icinga2/lists"}