Grafana dashboard: Spectrum Protect (TSM) - nodes
Description: Spectrum Protect metrics

IBM Spectrum Protect data is collected via shell scripts running dsmadmc "SELECT" commands from a central server and then imported to InfluxDB.

Dropdown list of nodes is available as a dashboard variable.

Dropdown list of servers is available as a dashboard variable.

Scripts available as below.  You will need to tweak these to your own environment.
The sp_functions.sh script along with the admin_password file will define aliases that the main scripts use (just how I decided to do it, you can always put the dsmadmc command itself directly in the main scripts).

All the scripts do is read in a list of SP server names, and issue (via an alias) the dsmadmc command to run select statements.
The output from the select statements is redirected to a file which is in a format that InfluxDB can ingest.

You will need to alter directories, names etc so as to fit with your own environment.

https://drive.google.com/file/d/1xfjEdRJSjNLmb3fgH3sMJCUuu1cY_qmL/view?usp=sharing

https://drive.google.com/file/d/126ikHyfbkJf5wW7GKvPvAg6P_atcOtmP/view?usp=sharing

https://drive.google.com/file/d/1Is3bjxWEp-ltpMKXonC3IwJB2MPGrpbf/view?usp=sharing

https://drive.google.com/file/d/1drL30KgONpDIHeqvUROx65S8nqIc51SU/view?usp=sharing

https://drive.google.com/file/d/1S2Bd-keP3bsuumJy1osk7TxLuX3saUz5/view?usp=sharing




{
  "__inputs": [
    {
      "name": "DS_INFLUXDBSPECTRUMPROTECT",
      "label": "InfluxDBspectrumprotect",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.4.3"
    },
    {
      "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": 11137,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1573210850899,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_INFLUXDBSPECTRUMPROTECT}",
      "fill": 1,
      "fillGradient": 10,
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 4,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "connected",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "primary pool",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "auditocc",
          "orderByTime": "ASC",
          "policy": "fiftytwo_weeks",
          "query": "SELECT sum(\"total_prim_mb\") as \"primary pool\" FROM \"fiftytwo_weeks\".\"auditocc\" WHERE (\"node_name\" =~ /^$node$/) AND $timeFilter GROUP BY time($__interval) fill(null)",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "total_mb"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "sum"
              }
            ]
          ],
          "tags": [
            {
              "key": "node_name",
              "operator": "=~",
              "value": "/^$node$/"
            }
          ]
        },
        {
          "alias": "primary pool + copy pool",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT sum(\"total_mb\") as \"primary pool + copy pool\" FROM \"fiftytwo_weeks\".\"auditocc\" WHERE (\"node_name\" =~ /^$node$/) AND $timeFilter GROUP BY time($__interval) fill(null)",
          "rawQuery": true,
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "$node node data held",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "decmbytes",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "columns": [],
      "datasource": "${DS_INFLUXDBSPECTRUMPROTECT}",
      "fontSize": "80%",
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 8
      },
      "id": 6,
      "options": {},
      "pageSize": null,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 0,
        "desc": true
      },
      "styles": [
        {
          "alias": "time_of_data_collection",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "date"
        },
        {
          "alias": "",
          "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": "string",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "groupBy": [],
          "measurement": "nodes",
          "orderByTime": "ASC",
          "policy": "fiftytwo_weeks",
          "query": "SELECT \"node_name\", \"server_name\", \"platform_name\" , \"domain_name\", \"option_set\", \"lastacc_time\", \"client_version\", \"client_release\", \"client_level\", \"client_sublevel\", \"client_os_level\",  \"tcp_name\", \"tcp_address\" FROM \"fiftytwo_weeks\".\"nodes\" WHERE (\"node_name\" =~ /^$node$/) AND time >now() - 4w",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "table",
          "select": [
            [
              {
                "params": [
                  "node_name"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "server_name"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "platform_name"
                ],
                "type": "field"
              },
              {
                "params": [
                  "platform_name"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "domain_name"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "client_version"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "client_release"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "client_level"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "client_sublevel"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "client_os_level"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "lastacc_time"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "option_set"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "tcp_name"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "tcp_address"
                ],
                "type": "field"
              }
            ]
          ],
          "tags": [
            {
              "key": "node_name",
              "operator": "=~",
              "value": "/^$node$/"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "$node node information - previous four weeks",
      "transform": "table",
      "type": "table"
    },
    {
      "cacheTimeout": null,
      "columns": [],
      "datasource": "${DS_INFLUXDBSPECTRUMPROTECT}",
      "fontSize": "80%",
      "gridPos": {
        "h": 11,
        "w": 24,
        "x": 0,
        "y": 16
      },
      "id": 2,
      "interval": "",
      "links": [],
      "options": {},
      "pageSize": null,
      "pluginVersion": "6.3.5",
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 0,
        "desc": true
      },
      "styles": [
        {
          "alias": "scheduled_start_UTC",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "date"
        },
        {
          "alias": "",
          "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": "string",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "groupBy": [],
          "measurement": "events",
          "orderByTime": "ASC",
          "policy": "fiftytwo_weeks",
          "query": "SELECT \"server_name\" , \"node_name\" , \"domain_name\" , \"schedule_name\" , \"status\", \"scheduled_start\" , \"actual_start\" , \"completed\" , \"reason\" , \"result\" FROM \"four_weeks\".\"events\" WHERE (\"node_name\" =~ /^$node$/) AND time >now() - 4w",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "table",
          "select": [
            [
              {
                "params": [
                  "server_name"
                ],
                "type": "field"
              },
              {
                "params": [
                  "server"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "node_name"
                ],
                "type": "field"
              },
              {
                "params": [
                  "node"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "domain_name"
                ],
                "type": "field"
              },
              {
                "params": [
                  "domain"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "schedule_name"
                ],
                "type": "field"
              },
              {
                "params": [
                  "schedule"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "status"
                ],
                "type": "field"
              },
              {
                "params": [
                  "status"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "scheduled_start"
                ],
                "type": "field"
              },
              {
                "params": [
                  "scheduled_start"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "actual_start"
                ],
                "type": "field"
              },
              {
                "params": [
                  "actual_start"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "completed"
                ],
                "type": "field"
              },
              {
                "params": [
                  "completed"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "reason"
                ],
                "type": "field"
              },
              {
                "params": [
                  "reason"
                ],
                "type": "alias"
              }
            ],
            [
              {
                "params": [
                  "result"
                ],
                "type": "field"
              },
              {
                "params": [
                  "result"
                ],
                "type": "alias"
              }
            ]
          ],
          "tags": [
            {
              "key": "node_name",
              "operator": "=~",
              "value": "/^$node$/"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "$node node scheduled events - previous four weeks",
      "transform": "table",
      "type": "table"
    }
  ],
  "refresh": false,
  "schemaVersion": 20,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_INFLUXDBSPECTRUMPROTECT}",
        "definition": "SHOW TAG VALUES FROM nodes WITH KEY=node_name",
        "hide": 0,
        "includeAll": false,
        "label": "node",
        "multi": false,
        "name": "node",
        "options": [],
        "query": "SHOW TAG VALUES FROM nodes WITH KEY=node_name",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-7d",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      ""
    ]
  },
  "timezone": "utc",
  "title": "Spectrum Protect (TSM) - nodes",
  "uid": "37IFhv2Zz",
  "version": 2,
  "description": "Spectrum Protect metrics"
}