Grafana dashboard: VMS Watchdog Events V1.2
Description: This dashboard shows interactive reports from Mirasys VMS watchdog database.

Version 1.0 2019/12/03

This Grafana dashboard is used as a user interface to creates interactive "Watchdog Events" reports from Mirasys VMS database. This report can be used standalone with web browser or inside Mirasys Spotter using Spotter Web browser plugin.

Version 1.1 2020/02/20
Corrected the right time for listing.

Version 1.2 2021/08/31
Fixed issue with latest Grafana 8


{
  "__inputs": [
    {
      "name": "DS_WDCONTEXT",
      "label": "WdContext",
      "description": "",
      "type": "datasource",
      "pluginId": "mssql",
      "pluginName": "Microsoft SQL Server"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "8.1.2"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph (old)",
      "version": ""
    },
    {
      "type": "panel",
      "id": "michaeldmoore-multistat-panel",
      "name": "Multistat",
      "version": "1.7.2"
    },
    {
      "type": "datasource",
      "id": "mssql",
      "name": "Microsoft SQL Server",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table-old",
      "name": "Table (old)",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "This dashboard shows interactive reports from Mirasys VMS watchdog database.",
  "editable": true,
  "gnetId": 11348,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1630398855682,
  "links": [],
  "panels": [
    {
      "columns": [],
      "datasource": "${DS_WDCONTEXT}",
      "fontSize": "100%",
      "gridPos": {
        "h": 5,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "pageSize": null,
      "showHeader": true,
      "sort": {
        "col": 0,
        "desc": true
      },
      "styles": [
        {
          "alias": "Time",
          "align": "auto",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "time",
          "type": "date"
        },
        {
          "alias": "Channel",
          "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": 0,
          "mappingType": 1,
          "pattern": "Channelnumber",
          "thresholds": [],
          "type": "string",
          "unit": "short",
          "valueMaps": [
            {
              "text": "",
              "value": "0"
            }
          ]
        },
        {
          "alias": "Server",
          "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": "Dvripaddress",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "alias": "",
          "format": "table",
          "rawSql": "SELECT\n UtcTime as \"time\", Eventname as \"Event\", Channelnumber, ActionName as \"Action\", Dvripaddress \nFROM\n  dbo.wdevents\n  \n  AS TabWdevents LEFT JOIN (VALUES \n(0,'SMserver down'),\n(1,'SMserver up'),\n(2,'DVRserver down'),\n(3,'DVRserver up'),\n(4,'Net down'),\n(5,'Net up'),\n(6,'DVRserver OK'),\n(7,'DVR refreshing'),\n(13,'Video ch OK'),\n(14,'Video no signal'),\n(15,'Video ch not started'),\n(16,'Video no capture'),\n(17,'Audio ch OK'),\n(18,'Audio no signal'),\n(19,'Audio ch not started'),\n(20,'Audio no capture'),\n(21,'Text ch OK'),\n(22,'Text no signal'),\n(23,'Text ch not started'),\n(24,'Text no capture'),\n(25,'WD conn down'),\n(26,'WD conn up'),\n(28,'DVRserver other fail'),\n(31,'Insufficient disk space'),\n(43,'HDD OK'),\n(44,'HDD temp warn'),\n(45,'HDD failure'),\n(58,'Metadata DB conn error'),\n(59,'GW down'),\n(60,'GW up'),\n(61,'DVRserver RTE'),\n(64,'License about to expire'),\n(65,'License expired'),\n(66,'Autobackup failed'),\n(67,'VMS maintenance'),\n(68,'VMS failover'),\n(69,'VMS failover fail'))\nAS TempEvents (eid, EventName) ON TabWdevents.EventType = TempEvents.eid \nLEFT JOIN (VALUES \n(0,'No action'),\n(1,'Refresh'),\n(2,'Restart'),\n(3,'Reboot'),\n(4,'Restart channel')) AS TempActions (aid, ActionName) ON TabWdevents.Action = TempActions.aid\n\n  \nWHERE\n  $__timeFilter(TabWdevents.UtcTime) AND \nTabWdevents.Eventtype in ($Events) AND TabWdevents.ChannelNumber in ($Channelnumbers) AND\nTabWdevents.Action in ($Actions)\n\nORDER BY\n  Localtime ASC",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Watchdog Events",
      "transform": "table",
      "type": "table-old"
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_WDCONTEXT}",
      "decimals": 0,
      "fieldConfig": {
        "defaults": {
          "links": []
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 4,
        "w": 24,
        "x": 0,
        "y": 5
      },
      "hiddenSeries": false,
      "id": 4,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "total": true,
        "values": true
      },
      "lines": false,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "8.1.2",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "rawSql": "SELECT\n  \n\tCOUNT(TabWdevents.eventtype) AS 'Value',\n  \n\tEventName AS metric,\n  \n\t$__timeGroup(TabWdevents.localtime, '15m') AS time\n\nFROM  \n\tdbo.wdevents\n\t AS TabWdevents LEFT JOIN (VALUES \n(0,'SMserver down'),\n(1,'SMserver up'),\n(2,'DVRserver down'),\n(3,'DVRserver up'),\n(4,'Net down'),\n(5,'Net up'),\n(6,'DVRserver OK'),\n(7,'DVR refreshing'),\n(13,'Video ch OK'),\n(14,'Video no signal'),\n(15,'Video ch not started'),\n(16,'Video no capture'),\n(17,'Audio ch OK'),\n(18,'Audio no signal'),\n(19,'Audio ch not started'),\n(20,'Audio no capture'),\n(21,'Text ch OK'),\n(22,'Text no signal'),\n(23,'Text ch not started'),\n(24,'Text no capture'),\n(25,'WD conn down'),\n(26,'WD conn up'),\n(28,'DVRserver other fail'),\n(31,'Insufficient disk space'),\n(43,'HDD OK'),\n(44,'HDD temp warn'),\n(45,'HDD failure'),\n(58,'Metadata DB conn error'),\n(59,'GW down'),\n(60,'GW up'),\n(61,'DVRserver RTE'),\n(64,'License about to expire'),\n(65,'License expired'),\n(66,'Autobackup failed'),\n(67,'VMS maintenance'),\n(68,'VMS failover'),\n(69,'VMS failover fail')) AS TempEvents (eid, EventName) ON TabWdevents.EventType = TempEvents.eid \nLEFT JOIN (VALUES \n(0,'No action'),\n(1,'Refresh'),\n(2,'Restart'),\n(3,'Reboot'),\n(4,'Restart channel')) AS TempActions (aid, ActionName) ON TabWdevents.Action = TempActions.aid\n\nWHERE\n  \n\t$__timeFilter(TabWdevents.localtime) AND \nTabWdevents.eventtype in ($Events) AND TabWdevents.ChannelNumber in ($Channelnumbers) AND\nTabWdevents.action in ($Actions)\nGROUP BY $__timeGroup(TabWdevents.localtime, '15m'), EventName\nORDER BY $__timeGroup(TabWdevents.localtime, '15m')",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": 0,
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "decimals": 0,
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "Aggregate": "last",
      "BarPadding": 10,
      "BaseLineColor": "#ff0000",
      "BaseLineValue": 0,
      "BaseLineWidth": 1,
      "CurveType": "Monotone",
      "DateFormat": "YYYY-MM-DD HH:mm:ss",
      "DateTimeColName": "date",
      "DotColor": "white",
      "DotSize": 10,
      "EvenRowColor": "rgba(61, 61, 64, 0.78)",
      "FlashHighLimitBar": false,
      "FlashLowLimitBar": false,
      "GroupColName": "",
      "GroupCols": 0,
      "GroupGap": 5,
      "GroupLabelColor": "#ffffff",
      "GroupLabelFontSize": "200%",
      "GroupNameFilter": "",
      "GroupRenamingRules": [],
      "GroupSortString": "",
      "HighAxisColor": "#ffffff",
      "HighAxisWidth": 1,
      "HighBarColor": "rgb(120, 128, 0)",
      "HighLimitBarColor": "#ff0000",
      "HighLimitBarFlashColor": "#ffa500",
      "HighLimitBarFlashTimeout": 1000,
      "HighLimitLineColor": "#ff0000",
      "HighLimitValue": 0.33,
      "HighLmitLineWidth": 1,
      "HighSideMargin": 0,
      "Horizontal": true,
      "LabelColName": "metric",
      "LabelColor": "#ffffff",
      "LabelFontSize": "70%",
      "LabelMargin": null,
      "LabelNameFilter": "",
      "LabelRenamingRules": [],
      "LableAngle": 0,
      "Legend": false,
      "LineColor": "blue",
      "LineWidth": 5,
      "Links": [],
      "LowAxisColor": "#ffffff",
      "LowAxisWidth": 1,
      "LowBarColor": "teal",
      "LowLimitBarColor": "#ff0000",
      "LowLimitBarFlashColor": "#ffa500",
      "LowLimitBarFlashTimeout": 200,
      "LowLimitLineColor": "#ff0000",
      "LowLimitValue": null,
      "LowLmitLineWidth": 1,
      "LowSideMargin": 0,
      "MaxLineColor": "rgb(74, 232, 12)",
      "MaxLineValue": null,
      "MaxLineWidth": 1,
      "MinLineColor": "#ff0000",
      "MinLineValue": null,
      "MinLineWidth": 1,
      "MultiBarPadding": 10,
      "OddRowColor": "rgba(33, 33, 34, 0.92)",
      "OutOfRangeLabelColor": "#ffffff",
      "OutlineColor": "rgba(245, 255, 0, 0.1)",
      "RecolorColName": null,
      "RecolorHighLimitBar": false,
      "RecolorLowLimitBar": false,
      "RecolorRules": [],
      "ScaleFactor": 1,
      "ShowBars": true,
      "ShowBaseLine": false,
      "ShowDate": false,
      "ShowGroupLabels": false,
      "ShowHighLimitLine": false,
      "ShowLabels": true,
      "ShowLeftAxis": true,
      "ShowLines": false,
      "ShowLowLimitLine": false,
      "ShowMaxLine": false,
      "ShowMinLine": false,
      "ShowRightAxis": true,
      "ShowTooltips": true,
      "ShowValues": true,
      "SortColName": "value",
      "SortDirection": "descending",
      "TZOffsetHours": 0,
      "ToolTipFontSize": "100%",
      "ToolTipType": "",
      "TooltipDateFormat": "YYYY-MM-DD HH:mm:ss",
      "VGroupGap": 5,
      "ValueColName": "",
      "ValueColor": "#ffffff",
      "ValueDecimals": 0,
      "ValueFontSize": "70%",
      "ValuePosition": "top",
      "Values": [
        {
          "HighBarColor": "#96d98d",
          "LowBarColor": "teal",
          "Name": "value",
          "Selected": true
        }
      ],
      "datasource": "${DS_WDCONTEXT}",
      "gridPos": {
        "h": 5,
        "w": 24,
        "x": 0,
        "y": 9
      },
      "id": 6,
      "targets": [
        {
          "alias": "",
          "format": "table",
          "rawSql": "SELECT\n  \n\tCOUNT(TabWdevents.eventtype) AS 'Value',\n\tEventName AS metric\nFROM  \n\tdbo.wdevents\n\tAS TabWdevents LEFT JOIN (VALUES \n(0,'SMserver down'),\n(1,'SMserver up'),\n(2,'DVRserver down'),\n(3,'DVRserver up'),\n(4,'Net down'),\n(5,'Net up'),\n(6,'DVRserver OK'),\n(7,'DVR refreshing'),\n(13,'Video ch OK'),\n(14,'Video no signal'),\n(15,'Video ch not started'),\n(16,'Video no capture'),\n(17,'Audio ch OK'),\n(18,'Audio no signal'),\n(19,'Audio ch not started'),\n(20,'Audio no capture'),\n(21,'Text ch OK'),\n(22,'Text no signal'),\n(23,'Text ch not started'),\n(24,'Text no capture'),\n(25,'WD conn down'),\n(26,'WD conn up'),\n(28,'DVRserver other fail'),\n(31,'Insufficient disk space'),\n(43,'HDD OK'),\n(44,'HDD temp warn'),\n(45,'HDD failure'),\n(58,'Metadata DB conn error'),\n(59,'GW down'),\n(60,'GW up'),\n(61,'DVRserver RTE'),\n(64,'License about to expire'),\n(65,'License expired'),\n(66,'Autobackup failed'),\n(67,'VMS maintenance'),\n(68,'VMS failover'),\n(69,'VMS failover fail')) AS TempEvents (eid, EventName) ON TabWdevents.EventType = TempEvents.eid \nLEFT JOIN (VALUES \n(0,'No action'),\n(1,'Refresh'),\n(2,'Restart'),\n(3,'Reboot'),\n(4,'Restart channel')) AS TempActions (aid, ActionName) ON TabWdevents.Action = TempActions.aid\n\nWHERE\n  \n\t$__timeFilter(TabWdevents.localtime) AND \nTabWdevents.eventtype in ($Events) AND TabWdevents.ChannelNumber in ($Channelnumbers) AND\nTabWdevents.action in ($Actions)\nGROUP BY EventName",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": " ",
      "type": "michaeldmoore-multistat-panel"
    }
  ],
  "refresh": false,
  "schemaVersion": 30,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_WDCONTEXT}",
        "definition": "SELECT          distinct wdcontext.dbo.wdevents.channelnumber  FROM \twdcontext.dbo.wdevents",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": true,
        "label": "Channel numbers",
        "multi": true,
        "name": "Channelnumbers",
        "options": [],
        "query": "SELECT          distinct wdcontext.dbo.wdevents.channelnumber  FROM \twdcontext.dbo.wdevents",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_WDCONTEXT}",
        "definition": "SELECT * FROM (VALUES  (0,'SMserver down'), (1,'SMserver up'), (2,'DVRserver down'), (3,'DVRserver up'), (4,'Net down'), (5,'Net up'), (6,'DVRserver OK'), (7,'DVR refreshing'), (13,'Video ch OK'), (14,'Video no signal'), (15,'Video ch not started'), (16,'Video no capture'), (17,'Audio ch OK'), (18,'Audio no signal'), (19,'Audio ch not started'), (20,'Audio no capture'), (21,'Text ch OK'), (22,'Text no signal'), (23,'Text ch not started'), (24,'Text no capture'), (25,'WD conn down'), (26,'WD conn up'), (28,'DVRserver other fail'), (31,'Insufficient disk space'), (43,'HDD OK'), (44,'HDD temp warn'), (45,'HDD failure'), (58,'Metadata DB conn error'), (59,'GW down'), (60,'GW up'), (61,'DVRserver RTE'), (64,'License about to expire'), (65,'License expired'), (66,'Autobackup failed'), (67,'VMS maintenance'), (68,'VMS failover'), (69,'VMS failover fail')) AS TempEvents (__value, __text)",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "Events",
        "options": [],
        "query": "SELECT * FROM (VALUES  (0,'SMserver down'), (1,'SMserver up'), (2,'DVRserver down'), (3,'DVRserver up'), (4,'Net down'), (5,'Net up'), (6,'DVRserver OK'), (7,'DVR refreshing'), (13,'Video ch OK'), (14,'Video no signal'), (15,'Video ch not started'), (16,'Video no capture'), (17,'Audio ch OK'), (18,'Audio no signal'), (19,'Audio ch not started'), (20,'Audio no capture'), (21,'Text ch OK'), (22,'Text no signal'), (23,'Text ch not started'), (24,'Text no capture'), (25,'WD conn down'), (26,'WD conn up'), (28,'DVRserver other fail'), (31,'Insufficient disk space'), (43,'HDD OK'), (44,'HDD temp warn'), (45,'HDD failure'), (58,'Metadata DB conn error'), (59,'GW down'), (60,'GW up'), (61,'DVRserver RTE'), (64,'License about to expire'), (65,'License expired'), (66,'Autobackup failed'), (67,'VMS maintenance'), (68,'VMS failover'), (69,'VMS failover fail')) AS TempEvents (__value, __text)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_WDCONTEXT}",
        "definition": "SELECT * FROM  (VALUES  (0,'No action'), (1,'Refresh'), (2,'Restart'), (3,'Reboot'), (4,'Restart channel')) AS TempActions  (__value, __text)",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "Actions",
        "options": [],
        "query": "SELECT * FROM  (VALUES  (0,'No action'), (1,'Refresh'), (2,'Restart'), (3,'Reboot'), (4,'Restart channel')) AS TempActions  (__value, __text)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-1y",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "VMS Watchdog Events V1.2",
  "uid": "d8pstAVnz",
  "version": 3
}