Grafana dashboard: Director
Description: Dashboard for the Storagecraft ShadowXafe Director. Storage Notifications are introduced. Recovery Points filtered introduced.


{
  "__inputs": [
    {
      "name": "DS_POSTGRESQL",
      "label": "PostgreSQL",
      "description": "",
      "type": "datasource",
      "pluginId": "postgres",
      "pluginName": "PostgreSQL"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "gauge",
      "name": "Gauge",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "8.2.2"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph (old)",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "postgres",
      "name": "PostgreSQL",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "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": "Dashboard for the Storagecraft ShadowXafe Director. Storage Notifications are introduced. Recovery Points filtered introduced.",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 11595,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "aliasColors": {
        "Failed Backups": "dark-red",
        "Failed Replications": "dark-yellow",
        "Running Jobs": "dark-blue",
        "Succedded Replications": "dark-purple",
        "Succeeded Backups": "dark-green"
      },
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_POSTGRESQL}",
      "decimals": 0,
      "fieldConfig": {
        "defaults": {
          "links": []
        },
        "overrides": []
      },
      "fill": 5,
      "fillGradient": 10,
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 8,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "max": true,
        "min": false,
        "rightSide": true,
        "show": true,
        "sort": "current",
        "sortDesc": false,
        "total": true,
        "values": true
      },
      "lines": true,
      "linewidth": 2,
      "nullPointMode": "null as zero",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "8.2.2",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "datasource": "${DS_POSTGRESQL}",
          "format": "time_series",
          "group": [
            {
              "params": [
                "$__interval",
                "none"
              ],
              "type": "time"
            }
          ],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroupAlias(last_update,$__interval),\n  count(state) AS \"Succeeded Backups\"\nFROM grafana\nWHERE\n  state = 'SUCCEEDED' and job_type = 'BACKUP'\nGROUP BY 1\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "state"
                ],
                "type": "column"
              },
              {
                "params": [
                  "count"
                ],
                "type": "aggregate"
              },
              {
                "params": [
                  "state"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "job_type"
                ],
                "type": "column"
              },
              {
                "params": [
                  "avg"
                ],
                "type": "aggregate"
              },
              {
                "params": [
                  "job_type"
                ],
                "type": "alias"
              }
            ]
          ],
          "table": "grafana",
          "timeColumn": "last_update",
          "timeColumnType": "timestamptz",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            },
            {
              "datatype": "jobstate",
              "name": "",
              "params": [
                "state",
                "=",
                "'SUCCEEDED'"
              ],
              "type": "expression"
            }
          ]
        },
        {
          "datasource": "${DS_POSTGRESQL}",
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroupAlias(last_update,$__interval),\n  count(state) AS \"Failed Backups\"\nFROM grafana\nWHERE\n  state = 'FAILED' and job_type = 'BACKUP'\nGROUP BY 1\nORDER BY 1",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "progress_percentage"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "job",
          "timeColumn": "last_update",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": "${DS_POSTGRESQL}",
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroupAlias(last_update,$__interval),\n  count(state) AS \"Failed Replications\"\nFROM grafana\nWHERE\n  state = 'FAILED' and job_type = 'REPLICATION'\nGROUP BY 1\nORDER BY 1",
          "refId": "C",
          "select": [
            [
              {
                "params": [
                  "progress_percentage"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "job",
          "timeColumn": "last_update",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": "${DS_POSTGRESQL}",
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroupAlias(last_update,$__interval),\n  count(state) AS \"Succedded Replications\"\nFROM grafana\nWHERE\n  state = 'SUCCEEDED' and job_type = 'REPLICATION'\nGROUP BY 1\nORDER BY 1",
          "refId": "D",
          "select": [
            [
              {
                "params": [
                  "progress_percentage"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "job",
          "timeColumn": "last_update",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroupAlias(last_update,$__interval),\n  count(state) AS \"Running Jobs\"\nFROM grafana\nWHERE\n  state = 'RUNNING'\nGROUP BY 1\nORDER BY 1",
          "refId": "E",
          "select": [
            [
              {
                "params": [
                  "progress_percentage"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "job",
          "timeColumn": "last_update",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Job Status Report",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:5152",
          "format": "short",
          "label": "Job Count",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:5153",
          "format": "short",
          "label": "Time Period",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "datasource": "${DS_POSTGRESQL}",
      "fieldConfig": {
        "defaults": {
          "displayName": "$__cell_0",
          "mappings": [],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "percentage",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 50
              },
              {
                "color": "dark-red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 6,
        "x": 12,
        "y": 0
      },
      "id": 14,
      "options": {
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": true
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true,
        "text": {}
      },
      "pluginVersion": "8.2.2",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select name, 100 - (free*100/size) as percent from storage_node where size <> 0;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Space Usage",
      "type": "gauge"
    },
    {
      "alert": {
        "alertRuleTags": {},
        "conditions": [
          {
            "evaluator": {
              "params": [
                70
              ],
              "type": "gt"
            },
            "operator": {
              "type": "and"
            },
            "query": {
              "params": [
                "A",
                "10m",
                "now"
              ]
            },
            "reducer": {
              "params": [],
              "type": "last"
            },
            "type": "query"
          }
        ],
        "executionErrorState": "alerting",
        "for": "1s",
        "frequency": "5m",
        "handler": 1,
        "name": "Storage Usage alert",
        "noDataState": "no_data",
        "notifications": [
          {
            "uid": "QID8cIyWk"
          }
        ]
      },
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_POSTGRESQL}",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 6,
        "w": 6,
        "x": 18,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 18,
      "legend": {
        "avg": false,
        "current": true,
        "max": false,
        "min": false,
        "show": false,
        "total": false,
        "values": true
      },
      "lines": false,
      "linewidth": 10,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "8.2.2",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "format": "time_series",
          "group": [
            {
              "params": [
                "$__interval",
                "none"
              ],
              "type": "time"
            },
            {
              "params": [
                "metric"
              ],
              "type": "column"
            }
          ],
          "metricColumn": "metric",
          "rawQuery": true,
          "rawSql": "select NOW() AS \"time\", name as metric, 100 - (free*100/size) as value from storage_node where size <> 0;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              },
              {
                "params": [
                  "avg"
                ],
                "type": "aggregate"
              },
              {
                "params": [
                  "value"
                ],
                "type": "alias"
              }
            ]
          ],
          "table": "storage_node_percent",
          "timeColumn": "NOW()",
          "timeColumnType": "timestamptz",
          "where": []
        }
      ],
      "thresholds": [
        {
          "colorMode": "critical",
          "fill": true,
          "line": true,
          "op": "gt",
          "value": 70,
          "visible": true
        }
      ],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Storage Usage",
      "tooltip": {
        "shared": false,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "series",
        "name": null,
        "show": true,
        "values": [
          "current"
        ]
      },
      "yaxes": [
        {
          "$$hashKey": "object:163",
          "decimals": null,
          "format": "percent",
          "label": "Usage",
          "logBase": 1,
          "max": "100",
          "min": "0",
          "show": true
        },
        {
          "$$hashKey": "object:164",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "datasource": "${DS_POSTGRESQL}",
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": "center",
            "displayMode": "auto",
            "filterable": true
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "state"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Status"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "type"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Storage Type"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "name"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Machine Name"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "start_time"
            },
            "properties": [
              {
                "id": "unit",
                "value": "dateTimeAsIso"
              },
              {
                "id": "custom.width",
                "value": 199
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "error_details"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 1067
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "job_type"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 157
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Status"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 210
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Machine Name"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 225
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "error_code"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 132
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 15,
        "w": 24,
        "x": 0,
        "y": 7
      },
      "id": 20,
      "options": {
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "8.2.2",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT job.state, job.job_type, machine.name, job.start_time, job.error_code, job.error_details from job JOIN machine ON machine.uuid = job.machine_uuid JOIN policy ON policy.uuid = machine._policy_uuid JOIN storage_node ON storage_node.uuid = policy.storage_node_uuid Where job_type = 'BACKUP' or job_type = 'REPLICATION' ORDER  BY start_time DESC;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Job Details",
      "transparent": true,
      "type": "table"
    },
    {
      "alert": {
        "alertRuleTags": {},
        "conditions": [
          {
            "evaluator": {
              "params": [
                0
              ],
              "type": "gt"
            },
            "operator": {
              "type": "and"
            },
            "query": {
              "params": [
                "A",
                "5m",
                "now"
              ]
            },
            "reducer": {
              "params": [],
              "type": "count"
            },
            "type": "query"
          },
          {
            "evaluator": {
              "params": [
                0
              ],
              "type": "gt"
            },
            "operator": {
              "type": "or"
            },
            "query": {
              "params": [
                "B",
                "5m",
                "now"
              ]
            },
            "reducer": {
              "params": [],
              "type": "count"
            },
            "type": "query"
          }
        ],
        "executionErrorState": "alerting",
        "for": "5m",
        "frequency": "1m",
        "handler": 1,
        "name": "Failures By Name alert",
        "noDataState": "ok",
        "notifications": []
      },
      "aliasColors": {
        "Alaia_Win10": "dark-red",
        "Failed Backup-Notify": "dark-red",
        "Failed Backups": "dark-red",
        "Failed Replications": "dark-orange",
        "Running Jobs": "dark-blue",
        "SUCCEDED Backups-Notify": "dark-green",
        "SUCCEDED Replications-Notify": "dark-green",
        "Succedded Replications": "dark-green"
      },
      "bars": false,
      "cacheTimeout": null,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_POSTGRESQL}",
      "decimals": 0,
      "description": "",
      "fieldConfig": {
        "defaults": {
          "links": []
        },
        "overrides": []
      },
      "fill": 5,
      "fillGradient": 0,
      "gridPos": {
        "h": 6,
        "w": 12,
        "x": 0,
        "y": 22
      },
      "hiddenSeries": false,
      "id": 10,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": false,
        "rightSide": true,
        "show": true,
        "sort": "current",
        "sortDesc": false,
        "total": true,
        "values": true
      },
      "lines": true,
      "linewidth": 6,
      "links": [],
      "nullPointMode": "null as zero",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "8.2.2",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "datasource": "${DS_POSTGRESQL}",
          "format": "time_series",
          "group": [
            {
              "params": [
                "$__interval",
                "none"
              ],
              "type": "time"
            }
          ],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroupAlias(last_update,$__interval),\n  name,\n  count(state) AS \"Failed Replications-Notify\"\nFROM grafana\nWHERE\n  state = 'FAILED' and job_type = 'REPLICATION' and last_update >= (NOW() - INTERVAL '1 hour' )\nGROUP BY 1, name\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "state"
                ],
                "type": "column"
              },
              {
                "params": [
                  "count"
                ],
                "type": "aggregate"
              },
              {
                "params": [
                  "state"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "job_type"
                ],
                "type": "column"
              },
              {
                "params": [
                  "avg"
                ],
                "type": "aggregate"
              },
              {
                "params": [
                  "job_type"
                ],
                "type": "alias"
              }
            ]
          ],
          "table": "grafana",
          "timeColumn": "last_update",
          "timeColumnType": "timestamptz",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            },
            {
              "datatype": "jobstate",
              "name": "",
              "params": [
                "state",
                "=",
                "'SUCCEEDED'"
              ],
              "type": "expression"
            }
          ]
        },
        {
          "datasource": "${DS_POSTGRESQL}",
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroupAlias(last_update,$__interval),\n  name,\n  count(state) AS \"Failed Backup-Notify\"\nFROM grafana\nWHERE\n  state = 'FAILED' and job_type = 'BACKUP' and last_update >= (NOW() - INTERVAL '1 hour' )\nGROUP BY 1 ,name\nORDER BY 1",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "progress_percentage"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "job",
          "timeColumn": "last_update",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [
        {
          "colorMode": "critical",
          "fill": true,
          "line": true,
          "op": "gt",
          "value": 0,
          "visible": true
        }
      ],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Failures By Name-Notify",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": "Job Count",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": "Time Period",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "datasource": "${DS_POSTGRESQL}",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": null,
            "displayMode": "auto",
            "filterable": true
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 12,
        "x": 12,
        "y": 22
      },
      "id": 12,
      "options": {
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "GB Used"
          }
        ]
      },
      "pluginVersion": "8.2.2",
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select storage_node.name as \"Storage\", machine.name as \"Machine Name\", Round(sum(image.size)/(1024*1024*1024)::numeric,2) as \"GB Used\"\r\nfrom image\r\njoin recovery_point ON recovery_point.uuid = image.recovery_point_uuid\r\njoin machine ON machine.uuid = recovery_point.machine_uuid\r\njoin storage_node_recovery_point ON storage_node_recovery_point.recovery_point_uuid = recovery_point.uuid\r\njoin storage_node ON storage_node.uuid = storage_node_recovery_point.storage_node_uuid\r\nwhere storage_node.type <> 'STC_CLOUD'\r\ngroup by machine.name,storage_node.name\r\norder by storage_node.name,\"GB Used\" desc;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Size per Machine(Beta)",
      "type": "table"
    },
    {
      "alert": {
        "alertRuleTags": {},
        "conditions": [
          {
            "evaluator": {
              "params": [
                0
              ],
              "type": "gt"
            },
            "operator": {
              "type": "and"
            },
            "query": {
              "params": [
                "A",
                "5m",
                "now"
              ]
            },
            "reducer": {
              "params": [],
              "type": "count"
            },
            "type": "query"
          },
          {
            "evaluator": {
              "params": [
                0
              ],
              "type": "gt"
            },
            "operator": {
              "type": "or"
            },
            "query": {
              "params": [
                "B",
                "5m",
                "now"
              ]
            },
            "reducer": {
              "params": [],
              "type": "count"
            },
            "type": "query"
          }
        ],
        "executionErrorState": "alerting",
        "for": "5m",
        "frequency": "30m",
        "handler": 1,
        "name": "Job Status Report-Notify alert",
        "noDataState": "ok",
        "notifications": []
      },
      "aliasColors": {
        "Failed Backup-Notify": "dark-red",
        "Failed Backups": "dark-red",
        "Failed Replications": "dark-orange",
        "Running Jobs": "dark-blue",
        "SUCCEDED Backups-Notify": "dark-green",
        "SUCCEDED Replications-Notify": "dark-green",
        "Succedded Replications": "dark-green"
      },
      "bars": false,
      "cacheTimeout": null,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_POSTGRESQL}",
      "decimals": 0,
      "fieldConfig": {
        "defaults": {
          "links": []
        },
        "overrides": []
      },
      "fill": 5,
      "fillGradient": 0,
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 0,
        "y": 28
      },
      "hiddenSeries": false,
      "id": 9,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": false,
        "rightSide": true,
        "show": true,
        "sort": "current",
        "sortDesc": false,
        "total": true,
        "values": true
      },
      "lines": true,
      "linewidth": 6,
      "links": [],
      "nullPointMode": "null as zero",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "8.2.2",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "datasource": "${DS_POSTGRESQL}",
          "format": "time_series",
          "group": [
            {
              "params": [
                "$__interval",
                "none"
              ],
              "type": "time"
            }
          ],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroupAlias(last_update,$__interval),\n  count(state) AS \"Failed Replications-Notify\"\nFROM grafana\nWHERE\n  state = 'FAILED' and job_type = 'REPLICATION' and last_update >= (NOW() - INTERVAL '1 hour' )\nGROUP BY 1\nORDER BY 1",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "state"
                ],
                "type": "column"
              },
              {
                "params": [
                  "count"
                ],
                "type": "aggregate"
              },
              {
                "params": [
                  "state"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "job_type"
                ],
                "type": "column"
              },
              {
                "params": [
                  "avg"
                ],
                "type": "aggregate"
              },
              {
                "params": [
                  "job_type"
                ],
                "type": "alias"
              }
            ]
          ],
          "table": "grafana",
          "timeColumn": "last_update",
          "timeColumnType": "timestamptz",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            },
            {
              "datatype": "jobstate",
              "name": "",
              "params": [
                "state",
                "=",
                "'SUCCEEDED'"
              ],
              "type": "expression"
            }
          ]
        },
        {
          "datasource": "${DS_POSTGRESQL}",
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroupAlias(last_update,$__interval),\n  count(state) AS \"Failed Backup-Notify\"\nFROM grafana\nWHERE\n  state = 'FAILED' and job_type = 'BACKUP' and last_update >= (NOW() - INTERVAL '1 hour' )\nGROUP BY 1\nORDER BY 1",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "progress_percentage"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "job",
          "timeColumn": "last_update",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroupAlias(last_update,$__interval),\n  count(state) AS \"SUCCEDED Replications-Notify\"\nFROM grafana\nWHERE\n  state = 'SUCCEEDED' and job_type = 'REPLICATION' and last_update >= (NOW() - INTERVAL '1 hour' )\nGROUP BY 1\nORDER BY 1",
          "refId": "C",
          "select": [
            [
              {
                "params": [
                  "progress_percentage"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "job",
          "timeColumn": "last_update",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroupAlias(last_update,$__interval),\n  count(state) AS \"SUCCEDED Backups-Notify\"\nFROM grafana\nWHERE\n  state = 'SUCCEEDED' and job_type = 'BACKUP' and last_update >= (NOW() - INTERVAL '1 hour' )\nGROUP BY 1\nORDER BY 1",
          "refId": "D",
          "select": [
            [
              {
                "params": [
                  "progress_percentage"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "job",
          "timeColumn": "last_update",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  $__timeGroupAlias(last_update,$__interval),\n  count(state) AS \"Running Jobs\"\nFROM grafana\nWHERE\n  state = 'RUNNING'\nGROUP BY 1\nORDER BY 1",
          "refId": "E",
          "select": [
            [
              {
                "params": [
                  "progress_percentage"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "job",
          "timeColumn": "last_update",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "thresholds": [
        {
          "colorMode": "critical",
          "fill": true,
          "line": true,
          "op": "gt",
          "value": 0,
          "visible": true
        }
      ],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Job Status Report-Notify",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": "Job Count",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": "Time Period",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "columns": [],
      "datasource": "${DS_POSTGRESQL}",
      "fontSize": "100%",
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 12,
        "y": 28
      },
      "id": 4,
      "interval": "15m",
      "maxDataPoints": 908,
      "pageSize": null,
      "pluginVersion": "6.5.2",
      "showHeader": true,
      "sort": {
        "col": 0,
        "desc": true
      },
      "styles": [
        {
          "$$hashKey": "object:309",
          "alias": "Time",
          "align": "auto",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "date"
        },
        {
          "$$hashKey": "object:310",
          "alias": "",
          "align": "auto",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "decimals": 2,
          "pattern": "/.*/",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "format": "table",
          "group": [],
          "metricColumn": "\"Job Type\"",
          "rawQuery": true,
          "rawSql": "select job.job_type as \"Job Type\",job.state as \"Status\",count(*)as \"Total\" from job join machine on machine.uuid=machine_uuid WHERE last_update BETWEEN NOW()::DATE-EXTRACT(DOW FROM NOW())::INTEGER-7 AND NOW()::DATE-EXTRACT(DOW from NOW())::INTEGER Group by job.state,job.job_type;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "\"Total\""
                ],
                "type": "column"
              },
              {
                "params": [
                  "count"
                ],
                "type": "aggregate"
              },
              {
                "params": [
                  "\"Total\""
                ],
                "type": "alias"
              }
            ]
          ],
          "table": "grafana_jtat",
          "timeColumn": "\"Total\"",
          "timeColumnType": "int8",
          "where": []
        }
      ],
      "timeFrom": "1h",
      "timeShift": "1h",
      "title": "Job Totals and Types",
      "transform": "table",
      "transparent": true,
      "type": "table-old"
    },
    {
      "datasource": "${DS_POSTGRESQL}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": null,
            "displayMode": "auto",
            "filterable": true
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "state_number"
            },
            "properties": [
              {
                "id": "unit",
                "value": "short"
              },
              {
                "id": "custom.displayMode",
                "value": "color-background"
              },
              {
                "id": "custom.align",
                "value": null
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "rgb(5, 29, 66)",
                      "value": null
                    },
                    {
                      "color": "rgb(201, 0, 25)",
                      "value": 1
                    },
                    {
                      "color": "rgba(6, 102, 1, 0.97)",
                      "value": 2
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "error_details"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Error"
              },
              {
                "id": "unit",
                "value": "short"
              },
              {
                "id": "decimals",
                "value": 2
              },
              {
                "id": "custom.align",
                "value": null
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 35
      },
      "id": 2,
      "options": {
        "showHeader": true
      },
      "pluginVersion": "8.2.2",
      "targets": [
        {
          "datasource": "${DS_POSTGRESQL}",
          "format": "table",
          "group": [],
          "metricColumn": "name",
          "rawQuery": true,
          "rawSql": "SELECT\n   name AS metric,\n  state,\n  job_type,\n  last_update,\n  state_number,\n  error_details\nFROM grafana\nWHERE\n  $__timeFilter(start_time) and job_type != 'RETENTION'\nORDER BY last_update desc",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "state"
                ],
                "type": "column"
              }
            ],
            [
              {
                "params": [
                  "job_type"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "grafana",
          "timeColumn": "start_time",
          "timeColumnType": "timestamptz",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Job Aggrigation",
      "transformations": [
        {
          "id": "merge",
          "options": {
            "reducers": []
          }
        }
      ],
      "transparent": true,
      "type": "table"
    },
    {
      "datasource": "${DS_POSTGRESQL}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "displayMode": "auto",
            "filterable": true
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 35
      },
      "id": 22,
      "options": {
        "showHeader": true
      },
      "pluginVersion": "8.2.2",
      "targets": [
        {
          "alias": "",
          "bucketAggs": [
            {
              "field": "@timestamp",
              "id": "2",
              "settings": {
                "interval": "auto"
              },
              "type": "date_histogram"
            }
          ],
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "metrics": [
            {
              "id": "1",
              "type": "count"
            }
          ],
          "query": "",
          "rawQuery": true,
          "rawSql": "select storage_node.name as \"Storage\", machine.name as \"Machine Name\",recovery_point.time as \"Time\", Round(sum(image.size)/(1024*1024*1024)::numeric,2) as \"GB Used\"\r\nfrom image\r\njoin recovery_point ON recovery_point.uuid = image.recovery_point_uuid\r\njoin machine ON machine.uuid = recovery_point.machine_uuid\r\njoin storage_node_recovery_point ON storage_node_recovery_point.recovery_point_uuid = recovery_point.uuid\r\njoin storage_node ON storage_node.uuid = storage_node_recovery_point.storage_node_uuid\r\nwhere storage_node.type <> 'STC_CLOUD'\r\ngroup by machine.name,storage_node.name,Time\r\norder by storage_node.name,\"GB Used\" desc;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "timeField": "@timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Recovery Points",
      "type": "table"
    }
  ],
  "refresh": false,
  "schemaVersion": 31,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-30d",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "browser",
  "title": "Director",
  "uid": "nfjUnFPWttt",
  "version": 13
}