Hikvision IP Camera  Dashboard
Hikvision IP Camera Dashboard
This is a Grafana dashboard to display information about your Hikvision IP Cameras. The Hikvision MIBs do not support a ton of useful information, but this dashboard does display the information I was looking to monitor.  

This dashboard works with a telegraf collector which can be found over [here](https://github.com/heathda/hikvision-telegraf-collector).

The graphs are dynamic and change based on the number of cameras you are collecting data on. Additionally you can view a single camera, a few cameras, or all cameras based on the variable selected at the top of the dashboard in the "Camera IP" dropdown.

The dataSource variable you select at the top of the page will represent the hostname/IP address of the device you have your influxdb residing. This dashboard is setup to query the "snmp" measurement (more commonly known as a table in other databases) in the influx database.

If your data is stored in a different measurement (table), you will need to adjust that in the query section of the first camera table/gauges/graphs. Select only the first camera in the "Camera IP" drop down, make your changes to the query for each table/gauges/graphs in that section, and that change will propagate throughout the rest of the dynamically created table/gauges/graphs.

### Statistics Displayed  

Manufacturer  
Device Model  
CPU Percentage  
Memory Percentage  
Static IP  
Video Encoding
````
############################################################################
#                          INPUT PLUGINS                                   #
############################################################################

#HIKVISION IP Camera telegraf snmp collector
#Uses the HIK-DEVICE-MIB


[[inputs.snmp]]
  agents = [ "IP-ADDRESS" ]
  version = 2
  community = "public"
  interval = "60s"
  timeout = "10s"
  retries = 3

  [[inputs.snmp.field]]
    name = "manufacturer"
    oid = "HIK-DEVICE-MIB::manufacturer.0"

  [[inputs.snmp.field]]
    name = "deviceModel"
    oid = "HIK-DEVICE-MIB::deviceType.0"

  [[inputs.snmp.field]]
    name="cpuPercent"
    oid = "HIK-DEVICE-MIB::cpuPercent.0"

  [[inputs.snmp.field]]
    name="memUsed"
    oid = "HIK-DEVICE-MIB::memUsed.0"

  [[inputs.snmp.field]]
    name="staticIp"
    oid = "HIK-DEVICE-MIB::staticIpAddr.0"

  [[inputs.snmp.field]]
    name="vidEncode"
    oid = "HIK-DEVICE-MIB::videoEncode.0"
  
  [[processors.regex]]
    order = 1
    namepass = ["snmp"]
    [[processors.regex.fields]]
      key = "cpuPercent"
      pattern = "^(\\d+).*"
      replacement = "${1}"
    [[processors.regex.fields]]
      key = "memUsed"
      pattern = "^(\\d+).*"
      replacement = "${1}"

  [[processors.converter]]
    order = 2
    [processors.converter.fields]
      integer = ["cpuPercent","memUsed"]
````
{
  "__inputs": [
    {
      "name": "DS_DATASTORE1",
      "label": "datastore1",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    },
    {
      "name": "DS_DATASTORE2",
      "label": "datastore2",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "gauge",
      "name": "Gauge",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.1.5"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 13107,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1601927607234,
  "links": [],
  "panels": [
    {
      "collapsed": false,
      "datasource": "${DS_DATASTORE2}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 6,
      "panels": [],
      "repeat": "Host",
      "title": "$Host ",
      "type": "row"
    },
    {
      "cacheTimeout": null,
      "datasource": "${DS_DATASTORE1}",
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": "left",
            "displayMode": "auto"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 24,
        "x": 0,
        "y": 1
      },
      "id": 30,
      "interval": null,
      "links": [],
      "maxDataPoints": 1,
      "options": {
        "frameIndex": 1,
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "last"
          }
        ]
      },
      "pluginVersion": "7.1.5",
      "repeat": null,
      "targets": [
        {
          "alias": "test",
          "groupBy": [
            {
              "params": [
                "agent_host"
              ],
              "type": "tag"
            }
          ],
          "hide": false,
          "measurement": "snmp",
          "orderByTime": "ASC",
          "policy": "autogen",
          "refId": "A",
          "resultFormat": "table",
          "select": [
            [
              {
                "params": [
                  "manufacturer"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              },
              {
                "params": [
                  "Manufacturer"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "deviceModel"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              },
              {
                "params": [
                  "Model"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "vidEncode"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              },
              {
                "params": [
                  "Video Codec"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": [
            {
              "key": "agent_host",
              "operator": "=~",
              "value": "/^$Host$/"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Camera Details",
      "type": "table"
    },
    {
      "datasource": "${DS_DATASTORE1}",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "displayName": "CPU",
          "mappings": [],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 70
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 3,
        "x": 0,
        "y": 4
      },
      "id": 2,
      "options": {
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "7.1.5",
      "repeat": null,
      "repeatDirection": "v",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "snmp",
          "orderByTime": "ASC",
          "policy": "autogen",
          "query": "SELECT mean(\"cpuPercent\") FROM \"autogen\".\"snmp\" WHERE (\"agent_host\" = '192.168.1.60') AND $timeFilter GROUP BY time($__interval) fill(null)",
          "rawQuery": false,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cpuPercent"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [
            {
              "key": "agent_host",
              "operator": "=~",
              "value": "/^$Host$/"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "$Host",
      "type": "gauge"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_DATASTORE1}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 5,
        "w": 21,
        "x": 3,
        "y": 4
      },
      "hiddenSeries": false,
      "id": 4,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": false,
        "max": true,
        "min": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "percentage": false,
      "pluginVersion": "7.1.5",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "repeatDirection": "v",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "CPU Usage",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "measurement": "snmp",
          "orderByTime": "ASC",
          "policy": "autogen",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "cpuPercent"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [
            {
              "key": "agent_host",
              "operator": "=~",
              "value": "/^$Host$/"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "$Host - CPU Over Time ",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "percent",
          "label": null,
          "logBase": 1,
          "max": "100",
          "min": "0",
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "datasource": "${DS_DATASTORE1}",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "displayName": "Memory",
          "mappings": [],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 70
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 3,
        "x": 0,
        "y": 9
      },
      "id": 7,
      "options": {
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "7.1.5",
      "repeat": null,
      "repeatDirection": "v",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "snmp",
          "orderByTime": "ASC",
          "policy": "autogen",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "memUsed"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [
            {
              "key": "agent_host",
              "operator": "=",
              "value": "192.168.1.60"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "$Host",
      "type": "gauge"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_DATASTORE1}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 5,
        "w": 21,
        "x": 3,
        "y": 9
      },
      "hiddenSeries": false,
      "id": 8,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": false,
        "max": true,
        "min": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "percentage": false,
      "pluginVersion": "7.1.5",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "repeatDirection": "v",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "Memory Usage",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "previous"
              ],
              "type": "fill"
            }
          ],
          "measurement": "snmp",
          "orderByTime": "ASC",
          "policy": "autogen",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "memUsed"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [
            {
              "key": "agent_host",
              "operator": "=~",
              "value": "/^$Host$/"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "$Host - Memory Over Time",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "percent",
          "label": null,
          "logBase": 1,
          "max": "100",
          "min": "0",
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "refresh": "15m",
  "schemaVersion": 26,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "datastore1",
          "value": "datastore1"
        },
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "dataSource",
        "options": [],
        "query": "influxdb",
        "queryValue": "",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$dataSource",
        "definition": "SELECT DISTINCT(staticIp) from snmp",
        "hide": 0,
        "includeAll": true,
        "label": "Camera IP",
        "multi": true,
        "name": "Host",
        "options": [],
        "query": "SELECT DISTINCT(staticIp) from snmp",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-24h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Hikvision IP Camera  Dashboard",
  "uid": "1E6fAeKMk",
  "version": 9,
  "description": "Hikvision IP Camera Dashboard"
}