Running Grafana and OpenNMS Helm in Docker

Grafana with Helm in Docker

If you want to run Grafana with the OpenNMS Helm plugin and data sources in Docker becomes now a little bit easier. The Grafana Docker image has now an environment variable that can have a list with the plugins you want to install on startup.

Docker Compose

As I’m writing this the latest OpenNMS Helm 4.0.2 plugin works with Grafana 6.4.5. The following docker-compose.yml spins up a Grafana instance and installs two plugins from the Grafana repository:

  • opennms-helm-app: The OpenNMS plugin with the data sources and custom Alarm tables
  • grafana-piechart-panel: The pie chart panel which is used in some custom community dashboards like the OpenNMS Basic SNMP data from Danny Sonnenschein.

You need a current installation of Docker and Docker-Compose installed. Just create a directory grafana and create docker-compose.yml file with the following content:

---
version: '3'

volumes:
  data-grafana: {}

services:
  grafana:
    image: grafana/grafana:6.4.5
    container_name: grafana
    environment:
      - TZ=Europe/Berlin
      - GF_SERVER_ROOT_URL=http://my-host.domain
      - GF_SECURITY_ADMIN_PASSWORD=my-pass
      - GF_INSTALL_PLUGINS=https://github.com/OpenNMS/opennms-helm/archive/v5.0.1.zip;opennms-helm,grafana-piechart-panel
    volumes:
      - data-grafana:/var/lib/grafana
    ports:
      - "3000:3000"

Replace the important parts, like the GF_SERVER_ROOT_URL, GF_SECURITY_ADMIN_PASSWORD. We use the default sqlite database which is persisted in a volume data-grafana. You can now run docker-compose up -d, connect to your instance on port 3000 and login with your admin password.

gl & hf

1 Like