Grafana dashboard: OpenNMS World Map example
Description: Sample dashboard to visualize metrics for your OpenNMS nodes on a world map.

Example how to use the https://grafana.com/plugins/grafana-worldmap-panel with OpenNMS / PostgreSQL.

At first you have to install the worldmap panel:

    # grafana-cli plugins install grafana-worldmap-panel

And create a PostgreSQL datasource of your OpenNMS database within grafana.

Don't forget to add longitude/latitude assets to your nodes! 

{
  "__inputs": [],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "5.2.3"
    },
    {
      "type": "panel",
      "id": "grafana-worldmap-panel",
      "name": "Worldmap Panel",
      "version": "0.1.2"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 7765,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1535829455942,
  "links": [
    {
      "icon": "external link",
      "tags": [],
      "title": "Worldmap Panel",
      "type": "link",
      "url": "https://github.com/grafana/worldmap-panel#geohashes-as-the-data-source"
    }
  ],
  "panels": [
    {
      "circleMaxSize": "20",
      "circleMinSize": "5",
      "colors": [
        "#508642",
        "rgba(237, 129, 40, 0.89)",
        "#bf1b00"
      ],
      "datasource": "$datasource",
      "decimals": 3,
      "esMetric": "Count",
      "gridPos": {
        "h": 17,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "hideEmpty": false,
      "hideZero": false,
      "id": 2,
      "initialZoom": "5",
      "links": [],
      "locationData": "table",
      "mapCenter": "Europe",
      "mapCenterLatitude": 46,
      "mapCenterLongitude": 14,
      "maxDataPoints": 1,
      "mouseWheelZoom": true,
      "showLegend": true,
      "stickyLabels": true,
      "tableQueryOptions": {
        "geohashField": "geohash",
        "labelField": "name",
        "latitudeField": "latitude",
        "longitudeField": "longitude",
        "metricField": "metric",
        "queryType": "coordinates"
      },
      "targets": [
        {
          "alias": "",
          "format": "table",
          "rawSql": "SELECT\n    now() AS time,\n    nodelabel AS name,\n    longitude,\n    latitude,\n    10 - random() * 10 AS metric\nFROM\n    node\n    INNER JOIN assets ON (node.nodeid = assets.nodeid)\nWHERE\n    longitude IS NOT NULL\nand\n    latitude IS NOT NULL",
          "refId": "A"
        }
      ],
      "thresholds": "3.333,6.666",
      "title": "Nodes",
      "transparent": false,
      "type": "grafana-worldmap-panel",
      "unitPlural": "",
      "unitSingle": "",
      "unitSingular": "",
      "valueName": "current"
    }
  ],
  "schemaVersion": 16,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "text": "OpenNMS Database",
          "value": "OpenNMS Database"
        },
        "hide": 0,
        "label": null,
        "name": "datasource",
        "options": [],
        "query": "postgres",
        "refresh": 1,
        "regex": "",
        "type": "datasource"
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "hidden": true,
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "OpenNMS World Map example",
  "uid": "5AGHqphmk",
  "version": 8,
  "description": "Sample dashboard to visualize metrics for your OpenNMS nodes on a world map."
}