Grafana dashboard: NCPA Metrics
Description: This dashboard shows a few metrics extracted from Nagios Cross-Platform Agent (ncpa) using a python script from https://github.com/juanjo-vlc/ncpa2es which uses Elasticsearch as a timeseries database.

## Getting Started

1. Copy ncpa2es.py and config.yml-dist from [juanjo-vlc/ncpa2es](https://github.com/juanjo-vlc/ncpa2es) to somewhere on a system capable of reaching ncpa_listener on your hosts and your ES cluster.
2. Grab a copy [check_ncpa.py](https://github.com/NagiosEnterprises/ncpa/tree/master/client) and put it on the same place.
3. Rename config.yml-dist to config.yml and tailor it to match your setup
4. Rut ncpa2es.py at regular intervals, for instance, using cron.


{
  "__inputs": [
    {
      "name": "DS_NCPA-METRICS",
      "label": "ncpa-metrics",
      "description": "A elasticsearch datasource with ncpa2es metrics",
      "type": "datasource",
      "pluginId": "elasticsearch",
      "pluginName": "Elasticsearch"
    }
  ],
  "__requires": [
    {
      "type": "datasource",
      "id": "elasticsearch",
      "name": "Elasticsearch",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "gauge",
      "name": "Gauge",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.7.2"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "$$hashKey": "object:86",
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 12103,
  "graphTooltip": 1,
  "id": null,
  "iteration": 1587384494877,
  "links": [],
  "panels": [
    {
      "collapsed": true,
      "datasource": "${DS_NCPA-METRICS}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 9,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_NCPA-METRICS}",
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 9,
            "w": 12,
            "x": 0,
            "y": 1
          },
          "hiddenSeries": false,
          "id": 4,
          "interval": "1m",
          "legend": {
            "alignAsTable": true,
            "avg": false,
            "current": true,
            "max": false,
            "min": false,
            "rightSide": true,
            "show": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "bucketAggs": [
                {
                  "$$hashKey": "object:288",
                  "fake": true,
                  "field": "host.keyword",
                  "id": "4",
                  "settings": {
                    "min_doc_count": 1,
                    "order": "desc",
                    "orderBy": "_term",
                    "size": "10"
                  },
                  "type": "terms"
                },
                {
                  "$$hashKey": "object:279",
                  "fake": true,
                  "field": "name.keyword",
                  "id": "3",
                  "settings": {
                    "min_doc_count": 1,
                    "order": "desc",
                    "orderBy": "_term",
                    "size": "10"
                  },
                  "type": "terms"
                },
                {
                  "$$hashKey": "object:263",
                  "field": "@timestamp",
                  "id": "2",
                  "settings": {
                    "interval": "1m",
                    "min_doc_count": 0,
                    "trimEdges": 0
                  },
                  "type": "date_histogram"
                }
              ],
              "metrics": [
                {
                  "$$hashKey": "object:261",
                  "field": "bytes_sent",
                  "id": "1",
                  "meta": {},
                  "settings": {},
                  "type": "avg"
                }
              ],
              "query": "type:interface AND NOT name.keyword:lo AND host.keyword:$host AND name.keyword:$iface",
              "refId": "A",
              "timeField": "@timestamp"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Network OUT KB/s",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:356",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:357",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_NCPA-METRICS}",
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 9,
            "w": 12,
            "x": 12,
            "y": 1
          },
          "hiddenSeries": false,
          "id": 7,
          "interval": "1m",
          "legend": {
            "alignAsTable": true,
            "avg": false,
            "current": true,
            "max": false,
            "min": false,
            "rightSide": true,
            "show": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "bucketAggs": [
                {
                  "$$hashKey": "object:288",
                  "fake": true,
                  "field": "host.keyword",
                  "id": "4",
                  "settings": {
                    "min_doc_count": 1,
                    "order": "desc",
                    "orderBy": "_term",
                    "size": "10"
                  },
                  "type": "terms"
                },
                {
                  "$$hashKey": "object:279",
                  "fake": true,
                  "field": "name.keyword",
                  "id": "3",
                  "settings": {
                    "min_doc_count": 1,
                    "order": "desc",
                    "orderBy": "_term",
                    "size": "10"
                  },
                  "type": "terms"
                },
                {
                  "$$hashKey": "object:263",
                  "field": "@timestamp",
                  "id": "2",
                  "settings": {
                    "interval": "1m",
                    "min_doc_count": 0,
                    "trimEdges": 0
                  },
                  "type": "date_histogram"
                }
              ],
              "metrics": [
                {
                  "$$hashKey": "object:261",
                  "field": "bytes_recv",
                  "id": "1",
                  "meta": {},
                  "settings": {},
                  "type": "max"
                }
              ],
              "query": "type:interface AND NOT name.keyword:lo AND host.keyword:$host AND name.keyword:$iface",
              "refId": "A",
              "timeField": "@timestamp"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Network IN KB/s",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:356",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:357",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        }
      ],
      "title": "Network",
      "type": "row"
    },
    {
      "collapsed": true,
      "datasource": "${DS_NCPA-METRICS}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 1
      },
      "id": 11,
      "panels": [
        {
          "cacheTimeout": null,
          "datasource": "${DS_NCPA-METRICS}",
          "gridPos": {
            "h": 9,
            "w": 8,
            "x": 0,
            "y": 2
          },
          "id": 2,
          "links": [],
          "maxPerRow": 3,
          "options": {
            "fieldOptions": {
              "calcs": [
                "mean"
              ],
              "defaults": {
                "mappings": [
                  {
                    "$$hashKey": "object:10938",
                    "id": 0,
                    "op": "=",
                    "text": "N/A",
                    "type": 1,
                    "value": "null"
                  }
                ],
                "nullValueMode": "connected",
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "#EAB839",
                      "value": 70
                    },
                    {
                      "color": "red",
                      "value": 80
                    }
                  ]
                },
                "unit": "percent"
              },
              "overrides": [],
              "values": false
            },
            "orientation": "horizontal",
            "showThresholdLabels": false,
            "showThresholdMarkers": true
          },
          "pluginVersion": "6.7.2",
          "repeat": "host",
          "repeatDirection": "h",
          "scopedVars": {
            "host": {
              "$$hashKey": "object:12973",
              "selected": true,
              "text": "vb168",
              "value": "vb168"
            }
          },
          "targets": [
            {
              "alias": "{{name.keyword}}",
              "bucketAggs": [
                {
                  "$$hashKey": "object:242",
                  "fake": true,
                  "field": "name.keyword",
                  "id": "4",
                  "settings": {
                    "min_doc_count": 1,
                    "order": "desc",
                    "orderBy": "_term",
                    "size": "10"
                  },
                  "type": "terms"
                },
                {
                  "$$hashKey": "object:116",
                  "fake": true,
                  "field": "host.keyword",
                  "id": "3",
                  "settings": {
                    "min_doc_count": 1,
                    "order": "desc",
                    "orderBy": "_term",
                    "size": "10"
                  },
                  "type": "terms"
                },
                {
                  "$$hashKey": "object:100",
                  "field": "@timestamp",
                  "id": "2",
                  "settings": {
                    "interval": "1m",
                    "min_doc_count": 0,
                    "trimEdges": 0
                  },
                  "type": "date_histogram"
                }
              ],
              "metrics": [
                {
                  "$$hashKey": "object:98",
                  "field": "used_percent",
                  "id": "1",
                  "meta": {},
                  "settings": {},
                  "type": "avg"
                }
              ],
              "query": "type:disk_logical AND host.keyword: $host",
              "refId": "A",
              "timeField": "@timestamp"
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "$host: Disk used %",
          "type": "gauge"
        },
        {
          "cacheTimeout": null,
          "datasource": "${DS_NCPA-METRICS}",
          "gridPos": {
            "h": 9,
            "w": 8,
            "x": 8,
            "y": 2
          },
          "id": 22,
          "links": [],
          "maxPerRow": 3,
          "options": {
            "fieldOptions": {
              "calcs": [
                "mean"
              ],
              "defaults": {
                "mappings": [
                  {
                    "$$hashKey": "object:10938",
                    "id": 0,
                    "op": "=",
                    "text": "N/A",
                    "type": 1,
                    "value": "null"
                  }
                ],
                "nullValueMode": "connected",
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "#EAB839",
                      "value": 70
                    },
                    {
                      "color": "red",
                      "value": 80
                    }
                  ]
                },
                "unit": "percent"
              },
              "overrides": [],
              "values": false
            },
            "orientation": "horizontal",
            "showThresholdLabels": false,
            "showThresholdMarkers": true
          },
          "pluginVersion": "6.7.2",
          "repeat": null,
          "repeatDirection": "h",
          "repeatIteration": 1587384494872,
          "repeatPanelId": 2,
          "scopedVars": {
            "host": {
              "$$hashKey": "object:12974",
              "selected": true,
              "text": "vb169",
              "value": "vb169"
            }
          },
          "targets": [
            {
              "alias": "{{name.keyword}}",
              "bucketAggs": [
                {
                  "$$hashKey": "object:242",
                  "fake": true,
                  "field": "name.keyword",
                  "id": "4",
                  "settings": {
                    "min_doc_count": 1,
                    "order": "desc",
                    "orderBy": "_term",
                    "size": "10"
                  },
                  "type": "terms"
                },
                {
                  "$$hashKey": "object:116",
                  "fake": true,
                  "field": "host.keyword",
                  "id": "3",
                  "settings": {
                    "min_doc_count": 1,
                    "order": "desc",
                    "orderBy": "_term",
                    "size": "10"
                  },
                  "type": "terms"
                },
                {
                  "$$hashKey": "object:100",
                  "field": "@timestamp",
                  "id": "2",
                  "settings": {
                    "interval": "1m",
                    "min_doc_count": 0,
                    "trimEdges": 0
                  },
                  "type": "date_histogram"
                }
              ],
              "metrics": [
                {
                  "$$hashKey": "object:98",
                  "field": "used_percent",
                  "id": "1",
                  "meta": {},
                  "settings": {},
                  "type": "avg"
                }
              ],
              "query": "type:disk_logical AND host.keyword: $host",
              "refId": "A",
              "timeField": "@timestamp"
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "$host: Disk used %",
          "type": "gauge"
        },
        {
          "cacheTimeout": null,
          "datasource": "${DS_NCPA-METRICS}",
          "gridPos": {
            "h": 9,
            "w": 8,
            "x": 16,
            "y": 2
          },
          "id": 23,
          "links": [],
          "maxPerRow": 3,
          "options": {
            "fieldOptions": {
              "calcs": [
                "mean"
              ],
              "defaults": {
                "mappings": [
                  {
                    "$$hashKey": "object:10938",
                    "id": 0,
                    "op": "=",
                    "text": "N/A",
                    "type": 1,
                    "value": "null"
                  }
                ],
                "nullValueMode": "connected",
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "#EAB839",
                      "value": 70
                    },
                    {
                      "color": "red",
                      "value": 80
                    }
                  ]
                },
                "unit": "percent"
              },
              "overrides": [],
              "values": false
            },
            "orientation": "horizontal",
            "showThresholdLabels": false,
            "showThresholdMarkers": true
          },
          "pluginVersion": "6.7.2",
          "repeat": null,
          "repeatDirection": "h",
          "repeatIteration": 1587384494872,
          "repeatPanelId": 2,
          "scopedVars": {
            "host": {
              "$$hashKey": "object:12975",
              "selected": true,
              "text": "vb170",
              "value": "vb170"
            }
          },
          "targets": [
            {
              "alias": "{{name.keyword}}",
              "bucketAggs": [
                {
                  "$$hashKey": "object:242",
                  "fake": true,
                  "field": "name.keyword",
                  "id": "4",
                  "settings": {
                    "min_doc_count": 1,
                    "order": "desc",
                    "orderBy": "_term",
                    "size": "10"
                  },
                  "type": "terms"
                },
                {
                  "$$hashKey": "object:116",
                  "fake": true,
                  "field": "host.keyword",
                  "id": "3",
                  "settings": {
                    "min_doc_count": 1,
                    "order": "desc",
                    "orderBy": "_term",
                    "size": "10"
                  },
                  "type": "terms"
                },
                {
                  "$$hashKey": "object:100",
                  "field": "@timestamp",
                  "id": "2",
                  "settings": {
                    "interval": "1m",
                    "min_doc_count": 0,
                    "trimEdges": 0
                  },
                  "type": "date_histogram"
                }
              ],
              "metrics": [
                {
                  "$$hashKey": "object:98",
                  "field": "used_percent",
                  "id": "1",
                  "meta": {},
                  "settings": {},
                  "type": "avg"
                }
              ],
              "query": "type:disk_logical AND host.keyword: $host",
              "refId": "A",
              "timeField": "@timestamp"
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "$host: Disk used %",
          "type": "gauge"
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_NCPA-METRICS}",
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 11
          },
          "hiddenSeries": false,
          "id": 18,
          "interval": "1m",
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "",
              "bucketAggs": [
                {
                  "$$hashKey": "object:8920",
                  "fake": true,
                  "field": "name.keyword",
                  "id": "4",
                  "settings": {
                    "min_doc_count": 1,
                    "order": "desc",
                    "orderBy": "_term",
                    "size": "10"
                  },
                  "type": "terms"
                },
                {
                  "$$hashKey": "object:8905",
                  "fake": true,
                  "field": "host.keyword",
                  "id": "3",
                  "settings": {
                    "min_doc_count": 1,
                    "order": "desc",
                    "orderBy": "_term",
                    "size": "0"
                  },
                  "type": "terms"
                },
                {
                  "$$hashKey": "object:8893",
                  "field": "@timestamp",
                  "id": "2",
                  "settings": {
                    "interval": "auto",
                    "min_doc_count": 0,
                    "trimEdges": 0
                  },
                  "type": "date_histogram"
                }
              ],
              "metrics": [
                {
                  "$$hashKey": "object:8891",
                  "field": "read_bytes",
                  "id": "1",
                  "meta": {},
                  "settings": {},
                  "type": "avg"
                }
              ],
              "query": "type: disk_physical AND host.keyword: $host AND name:sd?",
              "refId": "A",
              "timeField": "@timestamp"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Read KB/s",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_NCPA-METRICS}",
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 11
          },
          "hiddenSeries": false,
          "id": 17,
          "interval": "1m",
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "alias": "",
              "bucketAggs": [
                {
                  "$$hashKey": "object:8920",
                  "fake": true,
                  "field": "name.keyword",
                  "id": "4",
                  "settings": {
                    "min_doc_count": 1,
                    "order": "desc",
                    "orderBy": "_term",
                    "size": "10"
                  },
                  "type": "terms"
                },
                {
                  "$$hashKey": "object:8905",
                  "fake": true,
                  "field": "host.keyword",
                  "id": "3",
                  "settings": {
                    "min_doc_count": 1,
                    "order": "desc",
                    "orderBy": "_term",
                    "size": "0"
                  },
                  "type": "terms"
                },
                {
                  "$$hashKey": "object:8893",
                  "field": "@timestamp",
                  "id": "2",
                  "settings": {
                    "interval": "auto",
                    "min_doc_count": 0,
                    "trimEdges": 0
                  },
                  "type": "date_histogram"
                }
              ],
              "metrics": [
                {
                  "$$hashKey": "object:8891",
                  "field": "write_bytes",
                  "id": "1",
                  "meta": {},
                  "settings": {},
                  "type": "avg"
                }
              ],
              "query": "type: disk_physical AND host.keyword: $host AND name:sd?",
              "refId": "A",
              "timeField": "@timestamp"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Write KB/s",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        }
      ],
      "title": "Storage",
      "type": "row"
    },
    {
      "collapsed": false,
      "datasource": "${DS_NCPA-METRICS}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 2
      },
      "id": 13,
      "panels": [],
      "repeat": null,
      "title": "Process",
      "type": "row"
    },
    {
      "datasource": "${DS_NCPA-METRICS}",
      "gridPos": {
        "h": 13,
        "w": 12,
        "x": 0,
        "y": 3
      },
      "id": 20,
      "interval": "1m",
      "maxPerRow": 3,
      "options": {
        "fieldOptions": {
          "calcs": [
            "mean"
          ],
          "defaults": {
            "mappings": [],
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "green",
                  "value": null
                },
                {
                  "color": "yellow",
                  "value": 60
                },
                {
                  "color": "red",
                  "value": 75
                }
              ]
            },
            "unit": "percent"
          },
          "overrides": [],
          "values": false
        },
        "orientation": "auto",
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "6.7.2",
      "repeat": null,
      "repeatDirection": "h",
      "targets": [
        {
          "bucketAggs": [
            {
              "$$hashKey": "object:9475",
              "fake": true,
              "field": "host.keyword",
              "id": "4",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            },
            {
              "$$hashKey": "object:9460",
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "1m",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "$$hashKey": "object:9312",
              "field": "percent",
              "id": "1",
              "inlineScript": null,
              "meta": {},
              "settings": {},
              "type": "avg"
            }
          ],
          "query": "type:cpu AND host.keyword:$host",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "CPU Usage",
      "type": "gauge"
    },
    {
      "datasource": "${DS_NCPA-METRICS}",
      "description": "Available memory (free + cached)",
      "gridPos": {
        "h": 13,
        "w": 12,
        "x": 12,
        "y": 3
      },
      "id": 21,
      "interval": "1m",
      "maxPerRow": 3,
      "options": {
        "fieldOptions": {
          "calcs": [
            "mean"
          ],
          "defaults": {
            "mappings": [],
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "red",
                  "value": null
                },
                {
                  "color": "yellow",
                  "value": 15
                },
                {
                  "color": "green",
                  "value": 30
                }
              ]
            },
            "unit": "percent"
          },
          "overrides": [],
          "values": false
        },
        "orientation": "auto",
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "6.7.2",
      "repeat": null,
      "repeatDirection": "h",
      "targets": [
        {
          "bucketAggs": [
            {
              "$$hashKey": "object:9475",
              "fake": true,
              "field": "host.keyword",
              "id": "4",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "_term",
                "size": "0"
              },
              "type": "terms"
            },
            {
              "$$hashKey": "object:9460",
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "1m",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "$$hashKey": "object:9312",
              "field": "available_percent",
              "id": "1",
              "inlineScript": null,
              "meta": {},
              "settings": {},
              "type": "avg"
            }
          ],
          "query": "type:memory AND name:virtual AND host.keyword:$host",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Memory Available",
      "type": "gauge"
    },
    {
      "columns": [],
      "datasource": "${DS_NCPA-METRICS}",
      "fontSize": "100%",
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 16
      },
      "id": 6,
      "interval": "1m",
      "pageSize": null,
      "showHeader": true,
      "sort": {
        "col": 7,
        "desc": true
      },
      "styles": [
        {
          "$$hashKey": "object:962",
          "alias": "Time",
          "align": "auto",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "date"
        },
        {
          "$$hashKey": "object:963",
          "alias": "",
          "align": "left",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "decimals": 2,
          "pattern": "/\\.keyword/",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "$$hashKey": "object:3014",
          "alias": "",
          "align": "right",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 0,
          "mappingType": 1,
          "pattern": "pid",
          "thresholds": [],
          "type": "number",
          "unit": "none"
        },
        {
          "$$hashKey": "object:4175",
          "alias": "",
          "align": "auto",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "@timestamp",
          "thresholds": [],
          "type": "date",
          "unit": "short"
        },
        {
          "$$hashKey": "object:4188",
          "alias": "",
          "align": "left",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "/(^_|address|_unit$)/",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "bucketAggs": [
            {
              "$$hashKey": "object:3323",
              "fake": true,
              "field": "pid",
              "id": "6",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "1",
                "size": "0"
              },
              "type": "terms"
            },
            {
              "$$hashKey": "object:5819",
              "fake": true,
              "field": "host.keyword",
              "id": "9",
              "settings": {
                "min_doc_count": 1,
                "order": "desc",
                "orderBy": "1",
                "size": "0"
              },
              "type": "terms"
            },
            {
              "$$hashKey": "object:3091",
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "auto",
                "min_doc_count": 0,
                "trimEdges": 0
              },
              "type": "date_histogram"
            }
          ],
          "metrics": [
            {
              "$$hashKey": "object:3089",
              "field": "cpu_percent",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "logs"
            }
          ],
          "query": "type:process AND host.keyword:$host",
          "refId": "B",
          "timeField": "@timestamp"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Processes",
      "transform": "table",
      "type": "table"
    }
  ],
  "refresh": "5m",
  "schemaVersion": 22,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_NCPA-METRICS}",
        "definition": "{\"find\": \"terms\", \"field\": \"host.keyword\"}",
        "hide": 0,
        "includeAll": true,
        "index": -1,
        "label": "Host",
        "multi": true,
        "name": "host",
        "options": [],
        "query": "{\"find\": \"terms\", \"field\": \"host.keyword\"}",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 5,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_NCPA-METRICS}",
        "definition": "{\"find\": \"terms\", \"field\": \"name.keyword\",\"query\":\"type:interface AND NOT name.keyword:lo\"}",
        "hide": 0,
        "includeAll": true,
        "index": -1,
        "label": "Interface",
        "multi": true,
        "name": "iface",
        "options": [],
        "query": "{\"find\": \"terms\", \"field\": \"name.keyword\",\"query\":\"type:interface AND NOT name.keyword:lo\"}",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 5,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-15m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "NCPA Metrics",
  "uid": "vETOkp3Wk",
  "variables": {
    "list": []
  },
  "version": 13,
  "description": "This dashboard shows a few metrics extracted from Nagios Cross-Platform Agent (ncpa) using a python script from https://github.com/juanjo-vlc/ncpa2es which uses Elasticsearch as a timeseries database."
}