diff --git a/.editorconfig b/.editorconfig index 9ec542f..ec0419b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,5 +7,5 @@ trim_trailing_whitespace = true indent_style = space indent_size = 4 -[*.yml] +[*.{yml,json}] indent_size = 2 diff --git a/README.md b/README.md index 798b3b9..c2a92da 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Install InfluxDB on an *LPAR* or other server, which is network accessible by th ### Grafana Configuration - Configure Grafana to use InfluxDB as a new datasource - - set *Min time interval* to *30s* or *1m* depending on your HMCi *refresh* setting. + - **NOTE:** set *Min time interval* to *30s* or *1m* depending on your HMCi *refresh* setting. - Import example dashboards from the *doc/* folder into Grafana as a starting point and get creative making your own cool dashboards :) ## Notes @@ -87,10 +87,9 @@ ALTER RETENTION POLICY "autogen" ON "hmci" DURATION 90d Below are screenshots of the provided Grafana dashboards (found in the **doc/** folder), which can be used as a starting point. - - [hmci-resources.png](https://bitbucket.org/mnellemann/hmci/downloads/hmci-resources.png) - - [hmci-energy.png](https://bitbucket.org/mnellemann/hmci/downloads/hmci-energy.png) - - [hmci-vois.png](https://bitbucket.org/mnellemann/hmci/downloads/hmci-vios.png) - - [hmci-lpars](https://bitbucket.org/mnellemann/hmci/downloads/hmci-lpars.png) + - [hmci-systems.png](https://bitbucket.org/mnellemann/hmci/downloads/hmci-systems-dashboard.png) + - [hmci-vois.png](https://bitbucket.org/mnellemann/hmci/downloads/hmci-vios-dashboard.png) + - [hmci-lpars](https://bitbucket.org/mnellemann/hmci/downloads/hmci-lpars-dashboard.png) ## Known problems diff --git a/build.gradle b/build.gradle index f20dde4..e71e29a 100644 --- a/build.gradle +++ b/build.gradle @@ -6,13 +6,14 @@ plugins { // Code coverage of tests id 'jacoco' - id "com.github.johnrengelman.shadow" version "6.1.0" + id "com.github.johnrengelman.shadow" version "7.0.0" id "net.nemerosa.versioning" version "2.14.0" - id "nebula.ospackage" version "8.4.1" + id "nebula.ospackage" version "8.5.6" } repositories { - jcenter() + mavenCentral() + mavenLocal() } dependencies { @@ -27,13 +28,13 @@ dependencies { implementation 'org.slf4j:slf4j-api:1.7.30' implementation 'org.slf4j:slf4j-simple:1.7.30' - testImplementation 'org.spockframework:spock-core:2.0-M4-groovy-3.0' + testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.1' testImplementation "org.slf4j:slf4j-simple:1.7.30" } application { - mainClassName = 'biz.nellemann.hmci.Application' + mainClass.set('biz.nellemann.hmci.Application') } test { diff --git a/doc/IBM Power - HMCi - Logical Partitions-1617197406774.json b/doc/IBM Power - HMCi - Logical Partitions-1623356281973.json similarity index 72% rename from doc/IBM Power - HMCi - Logical Partitions-1617197406774.json rename to doc/IBM Power - HMCi - Logical Partitions-1623356281973.json index 3d1f6b9..1b84bf0 100644 --- a/doc/IBM Power - HMCi - Logical Partitions-1617197406774.json +++ b/doc/IBM Power - HMCi - Logical Partitions-1623356281973.json @@ -1,16 +1,8 @@ { "__inputs": [ { - "name": "DS_HMCI", - "label": "HMCi", - "description": "", - "type": "datasource", - "pluginId": "influxdb", - "pluginName": "InfluxDB" - }, - { - "name": "DS_INFLUXDB", - "label": "InfluxDB", + "name": "DS_INFLUXDB-HMCI", + "label": "InfluxDB-hmci", "description": "", "type": "datasource", "pluginId": "influxdb", @@ -28,12 +20,12 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "7.4.2" + "version": "8.0.0" }, { "type": "panel", "id": "graph", - "name": "Graph", + "name": "Graph (old)", "version": "" }, { @@ -42,6 +34,12 @@ "name": "InfluxDB", "version": "1.0.0" }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, { "type": "panel", "id": "table", @@ -68,12 +66,12 @@ "gnetId": 1510, "graphTooltip": 0, "id": null, - "iteration": 1617197381633, + "iteration": 1623355370775, "links": [], "panels": [ { "collapsed": false, - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-HMCI}", "gridPos": { "h": 1, "w": 24, @@ -87,7 +85,7 @@ "type": "row" }, { - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "", "fieldConfig": { "defaults": { @@ -115,50 +113,65 @@ { "matcher": { "id": "byName", - "options": "lparname" + "options": "Affinity Score" }, "properties": [ + { + "id": "color", + "value": { + "mode": "continuous-RdYlGr" + } + }, + { + "id": "unit", + "value": "percent" + }, + { + "id": "custom.displayMode", + "value": "basic" + }, + { + "id": "color", + "value": { + "mode": "continuous-RdYlGr" + } + }, { "id": "custom.width", - "value": 256 + "value": 372 } ] }, { "matcher": { "id": "byName", - "options": "affinityScore" + "options": "ID" }, "properties": [ { - "id": "color", - "value": { - "mode": "thresholds" - } - }, - { - "id": "unit", - "value": "percent" + "id": "custom.width", + "value": 126 } ] } ] }, "gridPos": { - "h": 8, - "w": 24, + "h": 7, + "w": 12, "x": 0, "y": 1 }, "id": 31, "options": { + "frameIndex": 0, "showHeader": true, "sortBy": [] }, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "targets": [ { - "alias": "Read", + "alias": "", "groupBy": [ { "params": [ @@ -170,7 +183,246 @@ "measurement": "lpar_details", "orderByTime": "ASC", "policy": "default", - "query": "SELECT last(\"id\") AS \"id\", \"type\", \"osType\", \"state\", \"affinityScore\" FROM \"lpar_details\" WHERE (\"lparname\" =~ /^$LPAR$/) AND $timeFilter GROUP BY \"lparname\"", + "query": "SELECT last(\"id\") AS \"ID\", \"osType\" AS \"OS\", \"state\" AS \"State\", \"affinityScore\" AS \"Affinity Score\" FROM \"lpar_details\" WHERE (\"servername\" =~ /^$ServerName$/) AND (\"lparname\" =~ /^$LPAR$/) AND $timeFilter GROUP BY \"lparname\"", + "queryType": "randomWalk", + "rawQuery": false, + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "type" + ], + "type": "field" + } + ], + [ + { + "params": [ + "affinityScore" + ], + "type": "field" + } + ], + [ + { + "params": [ + "state" + ], + "type": "field" + } + ], + [ + { + "params": [ + "osType" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "lparname", + "operator": "=~", + "value": "/^$LPAR$/" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "LPAR Details", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "type": true + }, + "indexByName": {}, + "renameByName": { + "affinityScore": "Affinity Score", + "id": "ID", + "lparname": "Name", + "osType": "OS", + "state": "State", + "type": "Type" + } + } + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "field": "Name" + } + ] + } + } + ], + "type": "table" + }, + { + "datasource": "${DS_INFLUXDB-HMCI}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-RdYlGr" + }, + "custom": { + "align": "center", + "displayMode": "auto", + "filterable": true + }, + "mappings": [], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Name" + }, + "properties": [ + { + "id": "custom.width", + "value": 293 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Utilization" + }, + "properties": [ + { + "id": "unit", + "value": "percent" + }, + { + "id": "custom.displayMode", + "value": "basic" + }, + { + "id": "color", + "value": { + "mode": "continuous-GrYlRd" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Weight" + }, + "properties": [ + { + "id": "custom.width", + "value": 104 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Entitled" + }, + "properties": [ + { + "id": "custom.width", + "value": 111 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "VP" + }, + "properties": [ + { + "id": "custom.width", + "value": 108 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Mode" + }, + "properties": [ + { + "id": "custom.width", + "value": 121 + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 1 + }, + "id": 32, + "options": { + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "8.0.0", + "targets": [ + { + "alias": "Read", + "groupBy": [ + { + "params": [ + "lparname" + ], + "type": "tag" + } + ], + "hide": false, + "measurement": "lpar_details", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT last(\"weight\") AS \"Weight\", last(\"entitledProcUnits\") AS \"Entitled\", last(\"currentVirtualProcessors\") AS \"VP\", (last(\"utilizedProcUnits\") / last(\"maxProcUnits\")) * 100 AS \"Utilization\", last(\"mode\") AS \"Mode\" FROM \"lpar_processor\" WHERE (\"servername\" =~ /^$ServerName$/) AND (\"lparname\" =~ /^$LPAR$/) AND $timeFilter GROUP BY \"lparname\" fill(previous)", "queryType": "randomWalk", "rawQuery": true, "refId": "A", @@ -238,17 +490,48 @@ ], "timeFrom": null, "timeShift": null, - "title": "", + "title": "LPAR Processor", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true + }, + "indexByName": {}, + "renameByName": { + "Entitled": "Entitled", + "Mode": "Mode", + "Time": "Time", + "Utilization": "Utilization", + "VP": "VP", + "Weight": "Weight", + "lparname": "Name" + } + } + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "field": "Name" + } + ] + } + } + ], "type": "table" }, { "collapsed": false, - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-HMCI}", "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 9 + "y": 8 }, "id": 18, "panels": [], @@ -262,17 +545,11 @@ "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "editable": true, "error": false, "fieldConfig": { "defaults": { - "color": {}, - "custom": {}, - "thresholds": { - "mode": "absolute", - "steps": [] - }, "unit": "Bps" }, "overrides": [] @@ -284,7 +561,7 @@ "h": 7, "w": 12, "x": 0, - "y": 10 + "y": 9 }, "hiddenSeries": false, "id": 11, @@ -310,7 +587,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -424,17 +701,11 @@ "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "editable": true, "error": false, "fieldConfig": { "defaults": { - "color": {}, - "custom": {}, - "thresholds": { - "mode": "absolute", - "steps": [] - }, "unit": "Bps" }, "overrides": [] @@ -446,7 +717,7 @@ "h": 7, "w": 12, "x": 12, - "y": 10 + "y": 9 }, "hiddenSeries": false, "id": 19, @@ -472,7 +743,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -586,30 +857,18 @@ "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "", "editable": true, "error": false, - "fieldConfig": { - "defaults": { - "color": {}, - "custom": {}, - "thresholds": { - "mode": "absolute", - "steps": [] - }, - "unit": "Bps" - }, - "overrides": [] - }, "fill": 1, "fillGradient": 1, "grid": {}, "gridPos": { - "h": 6, + "h": 4, "w": 12, "x": 0, - "y": 17 + "y": 16 }, "hiddenSeries": false, "id": 13, @@ -635,7 +894,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -646,7 +905,7 @@ "style": {}, "targets": [ { - "alias": "$tag_lparname writeBytes", + "alias": "$tag_lparname - $col", "dsType": "influxdb", "groupBy": [ { @@ -674,60 +933,25 @@ [ { "params": [ - "writeBytes" + "readBytes" ], "type": "field" }, { "params": [], "type": "mean" + }, + { + "params": [ + "read" + ], + "type": "alias" } - ] - ], - "tags": [ - { - "key": "servername", - "operator": "=~", - "value": "/^$ServerName$/" - }, - { - "condition": "AND", - "key": "lparname", - "operator": "=~", - "value": "/^$LPAR$/" - } - ] - }, - { - "alias": "$tag_lparname readBytes", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "lparname" - ], - "type": "tag" - } - ], - "hide": false, - "measurement": "lpar_storage_virtual", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"value\") FROM \"PartitionVirtualFiberChannelAdapters\" WHERE (\"system\" =~ /^$ManagedSystem$/ AND \"name\" != 'transmittedBytes' AND \"partition\" =~ /^$Partition$/) AND $timeFilter GROUP BY time($interval), \"wwpn\", \"partition\", \"name\" fill(null)", - "rawQuery": false, - "refId": "B", - "resultFormat": "time_series", - "select": [ + ], [ { "params": [ - "readBytes" + "writeBytes" ], "type": "field" }, @@ -740,6 +964,12 @@ "*-1" ], "type": "math" + }, + { + "params": [ + "write" + ], + "type": "alias" } ] ], @@ -780,7 +1010,7 @@ "yaxes": [ { "$$hashKey": "object:3776", - "format": "Bps", + "format": "binBps", "label": null, "logBase": 1, "max": null, @@ -808,30 +1038,18 @@ "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "", "editable": true, "error": false, - "fieldConfig": { - "defaults": { - "color": {}, - "custom": {}, - "thresholds": { - "mode": "absolute", - "steps": [] - }, - "unit": "Bps" - }, - "overrides": [] - }, "fill": 1, "fillGradient": 1, "grid": {}, "gridPos": { - "h": 6, + "h": 4, "w": 12, "x": 12, - "y": 17 + "y": 16 }, "hiddenSeries": false, "id": 12, @@ -857,7 +1075,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -885,66 +1103,13 @@ } ], "hide": false, - "measurement": "lpar_storage_virtual", + "measurement": "lpar_storage_generic", "orderByTime": "ASC", "policy": "default", "query": "SELECT mean(\"writeBytes\") FROM \"lpar_storage_virtual\" WHERE (\"servername\" =~ /^$ServerName$/ AND \"lparname\" =~ /^$LparName$/) AND $timeFilter GROUP BY time($interval), \"lparname\"", "rawQuery": false, "refId": "A", "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "writeBytes" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "servername", - "operator": "=~", - "value": "/^$ServerName$/" - }, - { - "condition": "AND", - "key": "lparname", - "operator": "=~", - "value": "/^$LPAR$/" - } - ] - }, - { - "alias": "$tag_lparname readBytes", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "lparname" - ], - "type": "tag" - } - ], - "hide": false, - "measurement": "lpar_storage_generic", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"value\") FROM \"PartitionVirtualFiberChannelAdapters\" WHERE (\"system\" =~ /^$ManagedSystem$/ AND \"name\" != 'transmittedBytes' AND \"partition\" =~ /^$Partition$/) AND $timeFilter GROUP BY time($interval), \"wwpn\", \"partition\", \"name\" fill(null)", - "rawQuery": false, - "refId": "B", - "resultFormat": "time_series", "select": [ [ { @@ -957,11 +1122,35 @@ "params": [], "type": "mean" }, + { + "params": [ + "read" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "writeBytes" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, { "params": [ "*-1" ], "type": "math" + }, + { + "params": [ + "write" + ], + "type": "alias" } ] ], @@ -1002,7 +1191,7 @@ "yaxes": [ { "$$hashKey": "object:3776", - "format": "Bps", + "format": "binBps", "label": null, "logBase": 1, "max": null, @@ -1026,12 +1215,12 @@ }, { "collapsed": false, - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-HMCI}", "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 23 + "y": 20 }, "id": 15, "panels": [], @@ -1045,41 +1234,42 @@ "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "", "editable": true, "error": false, "fieldConfig": { "defaults": { - "custom": {}, - "links": [] + "links": [], + "unit": "binBps" }, "overrides": [] }, - "fill": 0, - "fillGradient": 3, + "fill": 1, + "fillGradient": 2, "grid": {}, "gridPos": { "h": 6, "w": 12, "x": 0, - "y": 24 + "y": 21 }, "hiddenSeries": false, "id": 8, "legend": { "alignAsTable": false, - "avg": true, + "avg": false, "current": false, "hideEmpty": true, "hideZero": true, - "max": true, - "min": true, - "show": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, "sort": "avg", "sortDesc": true, "total": false, - "values": true + "values": false }, "lines": true, "linewidth": 1, @@ -1089,7 +1279,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -1104,7 +1294,7 @@ "style": {}, "targets": [ { - "alias": "$tag_lparname recv", + "alias": "$tag_lparname", "dsType": "influxdb", "groupBy": [ { @@ -1183,7 +1373,7 @@ "yaxes": [ { "$$hashKey": "object:10101", - "format": "Bps", + "format": "binBps", "label": null, "logBase": 1, "max": null, @@ -1211,41 +1401,40 @@ "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "", "editable": true, "error": false, "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] }, - "fill": 0, - "fillGradient": 3, + "fill": 1, + "fillGradient": 2, "grid": {}, "gridPos": { "h": 6, "w": 12, "x": 12, - "y": 24 + "y": 21 }, "hiddenSeries": false, "id": 16, "legend": { "alignAsTable": false, - "avg": true, + "avg": false, "current": false, "hideEmpty": true, "hideZero": true, - "max": true, - "min": true, - "show": false, + "max": false, + "min": false, + "show": true, "sort": "avg", "sortDesc": true, "total": false, - "values": true + "values": false }, "lines": true, "linewidth": 1, @@ -1255,7 +1444,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -1373,12 +1562,12 @@ }, { "collapsed": false, - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-HMCI}", "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 30 + "y": 27 }, "id": 21, "panels": [], @@ -1392,40 +1581,39 @@ "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "decimals": 2, "editable": true, "error": false, "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] }, - "fill": 1, + "fill": 0, "fillGradient": 0, "grid": {}, "gridPos": { - "h": 6, - "w": 24, + "h": 8, + "w": 14, "x": 0, - "y": 31 + "y": 28 }, "hiddenSeries": false, "id": 2, "legend": { - "alignAsTable": true, - "avg": true, + "alignAsTable": false, + "avg": false, "current": false, - "max": true, - "min": true, + "max": false, + "min": false, "rightSide": false, - "show": false, + "show": true, "sort": "avg", "sortDesc": true, "total": false, - "values": true + "values": false }, "lines": true, "linewidth": 1, @@ -1436,7 +1624,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -1448,26 +1636,13 @@ "targets": [ { "alias": "$tag_lparname", - "dsType": "influxdb", "groupBy": [ { "params": [ - "$interval" + "$__interval" ], "type": "time" }, - { - "params": [ - "lparname" - ], - "type": "tag" - }, - { - "params": [ - "servername" - ], - "type": "tag" - }, { "params": [ "null" @@ -1476,16 +1651,18 @@ } ], "hide": false, - "measurement": "lpar_processor", + "measurement": "/^$ServerName$/", "orderByTime": "ASC", "policy": "default", + "query": "SELECT (last(\"utilizedProcUnits\") / last(\"maxProcUnits\")) * 100 AS \"usage\" FROM \"lpar_processor\" WHERE (\"servername\" =~ /^$ServerName$/ AND \"lparname\" =~ /^$LPAR$/) AND $timeFilter GROUP BY time($interval), \"lparname\", \"servername\" fill(null)", + "rawQuery": true, "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "utilizedProcUnits" + "value" ], "type": "field" }, @@ -1495,32 +1672,21 @@ } ] ], - "tags": [ - { - "key": "servername", - "operator": "=~", - "value": "/^$ServerName$/" - }, - { - "condition": "AND", - "key": "lparname", - "operator": "=~", - "value": "/^$LPAR$/" - } - ] + "tags": [] } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Processor Units - Utilization", + "title": "Processor Units - Utilization Percentage", "tooltip": { "msResolution": false, "shared": true, - "sort": 2, + "sort": 0, "value_type": "individual" }, + "transformations": [], "type": "graph", "xaxis": { "buckets": null, @@ -1532,11 +1698,12 @@ "yaxes": [ { "$$hashKey": "object:4943", - "format": "short", - "label": "cores", + "decimals": null, + "format": "percent", + "label": "", "logBase": 1, - "max": null, - "min": null, + "max": "110", + "min": "0", "show": true }, { @@ -1554,14 +1721,118 @@ "alignLevel": null } }, + { + "datasource": "${DS_INFLUXDB-HMCI}", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 2, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 65 + }, + { + "color": "orange", + "value": 80 + }, + { + "color": "red", + "value": 95 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 10, + "x": 14, + "y": 28 + }, + "id": 34, + "links": [], + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "8.0.0", + "targets": [ + { + "alias": "$tag_lparname", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "/^$ServerName$/", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT (last(\"utilizedProcUnits\") / last(\"maxProcUnits\")) * 100 AS \"usage\" FROM \"lpar_processor\" WHERE (\"servername\" =~ /^$ServerName$/ AND \"lparname\" =~ /^$LPAR$/) AND $timeFilter GROUP BY time($interval), \"lparname\", \"servername\" fill(null)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Processor Units - Utilization Percentage", + "transformations": [], + "type": "gauge" + }, { "collapsed": false, - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-HMCI}", "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 37 + "y": 36 }, "id": 23, "panels": [], @@ -1570,12 +1841,13 @@ "type": "row" }, { - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "", "fieldConfig": { "defaults": { - "custom": {}, "mappings": [], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ @@ -1598,17 +1870,17 @@ "overrides": [] }, "gridPos": { - "h": 12, - "w": 24, + "h": 8, + "w": 12, "x": 0, - "y": 38 + "y": 37 }, "id": 9, "options": { "orientation": "auto", "reduceOptions": { "calcs": [ - "mean" + "lastNotNull" ], "fields": "", "values": false @@ -1617,7 +1889,118 @@ "showThresholdMarkers": true, "text": {} }, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", + "targets": [ + { + "alias": "$tag_lparname", + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "lparname" + ], + "type": "tag" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "lpar_details", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "affinityScore" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "servername", + "operator": "=~", + "value": "/^$ServerName$/" + }, + { + "condition": "AND", + "key": "lparname", + "operator": "=~", + "value": "/^$LPAR$/" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "NUMA Affinity Score", + "type": "gauge" + }, + { + "cacheTimeout": null, + "datasource": "${DS_INFLUXDB-HMCI}", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "decmbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 37 + }, + "id": 33, + "links": [], + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.0.0", "targets": [ { "alias": "$tag_lparname", @@ -1643,7 +2026,7 @@ } ], "hide": false, - "measurement": "lpar_details", + "measurement": "lpar_memory", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -1652,13 +2035,13 @@ [ { "params": [ - "affinityScore" + "logicalMem" ], "type": "field" }, { "params": [], - "type": "mean" + "type": "last" } ] ], @@ -1679,12 +2062,12 @@ ], "timeFrom": null, "timeShift": null, - "title": "NUMA Affinity Score", - "type": "gauge" + "title": "Memory Assigned", + "type": "stat" } ], "refresh": "1m", - "schemaVersion": 27, + "schemaVersion": 30, "style": "dark", "tags": [ "Power" @@ -1695,7 +2078,7 @@ "allFormat": "regex values", "allValue": null, "current": {}, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "definition": "SHOW TAG VALUES FROM \"server_processor\" WITH KEY = \"servername\" WHERE time > now() - 24h", "description": null, "error": null, @@ -1713,7 +2096,6 @@ "skipUrlSync": false, "sort": 0, "tagValuesQuery": null, - "tags": [], "tagsQuery": null, "type": "query", "useTags": false @@ -1722,7 +2104,7 @@ "allFormat": "regex values", "allValue": null, "current": {}, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "definition": "SHOW TAG VALUES FROM \"lpar_processor\" WITH KEY = \"lparname\" WHERE servername =~ /$ServerName/", "description": null, "error": null, @@ -1740,7 +2122,6 @@ "skipUrlSync": false, "sort": 5, "tagValuesQuery": null, - "tags": [], "tagsQuery": null, "type": "query", "useTags": false @@ -1748,7 +2129,7 @@ ] }, "time": { - "from": "now-2d", + "from": "now-6h", "now": false, "to": "now-1m" }, @@ -1779,5 +2160,5 @@ "timezone": "browser", "title": "IBM Power - HMCi - Logical Partitions", "uid": "Xl7oHESGz", - "version": 20 + "version": 29 } \ No newline at end of file diff --git a/doc/IBM Power - HMCi - System Energy-1617197422138.json b/doc/IBM Power - HMCi - System Energy-1623356319253.json similarity index 94% rename from doc/IBM Power - HMCi - System Energy-1617197422138.json rename to doc/IBM Power - HMCi - System Energy-1623356319253.json index 70e370f..9e7cab1 100644 --- a/doc/IBM Power - HMCi - System Energy-1617197422138.json +++ b/doc/IBM Power - HMCi - System Energy-1623356319253.json @@ -1,16 +1,8 @@ { "__inputs": [ { - "name": "DS_HMCI", - "label": "HMCi", - "description": "", - "type": "datasource", - "pluginId": "influxdb", - "pluginName": "InfluxDB" - }, - { - "name": "DS_INFLUXDB", - "label": "InfluxDB", + "name": "DS_INFLUXDB-HMCI", + "label": "InfluxDB-hmci", "description": "", "type": "datasource", "pluginId": "influxdb", @@ -22,12 +14,12 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "7.4.2" + "version": "8.0.0" }, { "type": "panel", "id": "graph", - "name": "Graph", + "name": "Graph (old)", "version": "" }, { @@ -61,7 +53,7 @@ "gnetId": null, "graphTooltip": 0, "id": null, - "iteration": 1617197417499, + "iteration": 1623356314349, "links": [], "panels": [ { @@ -69,11 +61,10 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "", "fieldConfig": { "defaults": { - "custom": {}, "links": [], "unit": "watt" }, @@ -105,7 +96,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 2, "points": false, "renderer": "flot", @@ -208,10 +199,9 @@ } }, { - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "fieldConfig": { "defaults": { - "custom": {}, "mappings": [], "thresholds": { "mode": "absolute", @@ -256,7 +246,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "targets": [ { "alias": "$tag_servername", @@ -315,7 +305,7 @@ }, { "collapsed": false, - "datasource": "${DS_INFLUXDB}", + "datasource": "${DS_INFLUXDB-HMCI}", "gridPos": { "h": 1, "w": 24, @@ -329,14 +319,13 @@ "type": "row" }, { - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "Inlet air temperature.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, - "custom": {}, "links": [], "mappings": [], "thresholds": { @@ -382,7 +371,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "targets": [ { "alias": "$tag_servername - $tag_name", @@ -444,16 +433,11 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "", "fieldConfig": { "defaults": { - "custom": {}, "links": [], - "thresholds": { - "mode": "absolute", - "steps": [] - }, "unit": "celsius" }, "overrides": [] @@ -486,7 +470,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 2, "points": false, "renderer": "flot", @@ -653,7 +637,7 @@ } ], "refresh": "1m", - "schemaVersion": 27, + "schemaVersion": 30, "style": "dark", "tags": [ "POWER" @@ -663,7 +647,7 @@ { "allValue": null, "current": {}, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "definition": "SHOW TAG VALUES FROM \"server_processor\" WITH KEY = \"servername\" WHERE time > now() - 24h", "description": null, "error": null, @@ -679,7 +663,6 @@ "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", - "tags": [], "tagsQuery": "", "type": "query", "useTags": false @@ -706,5 +689,5 @@ "timezone": "", "title": "IBM Power - HMCi - System Energy", "uid": "oHcrgD1Mk", - "version": 20 + "version": 2 } \ No newline at end of file diff --git a/doc/IBM Power - HMCi - System Resources-1617197455766.json b/doc/IBM Power - HMCi - System Resources-1623356293052.json similarity index 72% rename from doc/IBM Power - HMCi - System Resources-1617197455766.json rename to doc/IBM Power - HMCi - System Resources-1623356293052.json index af54441..a109ecc 100644 --- a/doc/IBM Power - HMCi - System Resources-1617197455766.json +++ b/doc/IBM Power - HMCi - System Resources-1623356293052.json @@ -1,8 +1,8 @@ { "__inputs": [ { - "name": "DS_HMCI", - "label": "HMCi", + "name": "DS_INFLUXDB-HMCI", + "label": "InfluxDB-hmci", "description": "", "type": "datasource", "pluginId": "influxdb", @@ -10,28 +10,16 @@ } ], "__requires": [ - { - "type": "panel", - "id": "bargauge", - "name": "Bar gauge", - "version": "" - }, { "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "7.4.2" + "version": "8.0.0" }, { "type": "panel", "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "panel", - "id": "heatmap", - "name": "Heatmap", + "name": "Graph (old)", "version": "" }, { @@ -60,12 +48,12 @@ "gnetId": 1465, "graphTooltip": 0, "id": null, - "iteration": 1617197428882, + "iteration": 1623356287981, "links": [], "panels": [ { "collapsed": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "gridPos": { "h": 1, "w": 24, @@ -75,7 +63,7 @@ "id": 20, "panels": [], "repeat": "ServerName", - "title": "Processors - $ServerName", + "title": "Server - $ServerName", "type": "row" }, { @@ -84,19 +72,14 @@ "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "decimals": 2, "description": "", "editable": true, "error": false, "fieldConfig": { "defaults": { - "custom": {}, - "links": [], - "thresholds": { - "mode": "absolute", - "steps": [] - } + "links": [] }, "overrides": [] }, @@ -104,7 +87,7 @@ "fillGradient": 1, "grid": {}, "gridPos": { - "h": 7, + "h": 9, "w": 12, "x": 0, "y": 1 @@ -113,16 +96,16 @@ "id": 19, "legend": { "alignAsTable": false, - "avg": true, + "avg": false, "current": true, - "max": true, - "min": true, - "show": false, + "max": false, + "min": false, + "show": true, "total": false, "values": true }, "lines": true, - "linewidth": 2, + "linewidth": 1, "links": [], "mode": "", "nullPointMode": "connected", @@ -130,7 +113,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -141,7 +124,7 @@ "style": {}, "targets": [ { - "alias": "$tag_poolname", + "alias": "$tag_poolname - $col - ", "dsType": "influxdb", "groupBy": [ { @@ -186,6 +169,12 @@ { "params": [], "type": "mean" + }, + { + "params": [ + "Utilized Proc. Units" + ], + "type": "alias" } ] ], @@ -248,26 +237,21 @@ "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "decimals": 2, "editable": true, "error": false, "fieldConfig": { "defaults": { - "custom": {}, - "links": [], - "thresholds": { - "mode": "absolute", - "steps": [] - } + "links": [] }, "overrides": [] }, - "fill": 0, - "fillGradient": 0, + "fill": 1, + "fillGradient": 1, "grid": {}, "gridPos": { - "h": 7, + "h": 9, "w": 12, "x": 12, "y": 1 @@ -276,16 +260,16 @@ "id": 2, "legend": { "alignAsTable": false, - "avg": true, - "current": true, - "max": true, + "avg": false, + "current": false, + "max": false, "min": false, - "show": false, + "show": true, "total": false, - "values": true + "values": false }, "lines": true, - "linewidth": 2, + "linewidth": 1, "links": [], "mode": "", "nullPointMode": "connected", @@ -293,7 +277,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -552,147 +536,18 @@ "alignLevel": null } }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateBlues", - "exponent": 0.5, - "mode": "spectrum" - }, - "dataFormat": "timeseries", - "datasource": "${DS_HMCI}", - "description": "", - "fieldConfig": { - "defaults": { - "custom": {}, - "thresholds": { - "mode": "absolute", - "steps": [] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 24, - "x": 0, - "y": 8 - }, - "heatmap": {}, - "hideZeroBuckets": true, - "highlightCards": true, - "id": 34, - "legend": { - "show": true - }, - "links": [], - "pluginVersion": "7.1.3", - "reverseYBuckets": false, - "targets": [ - { - "alias": "", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "server_processor", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "utilizedProcUnits" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "servername", - "operator": "=~", - "value": "/^$ServerName$/" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Processor Utilization", - "tooltip": { - "show": true, - "showHistogram": true - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": null, - "format": "short", - "logBase": 1, - "max": null, - "min": null, - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "collapsed": false, - "datasource": "${DS_HMCI}", - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 32 - }, - "id": 22, - "panels": [], - "repeat": "ServerName", - "title": "Network & Storage I/O - $ServerName ", - "type": "row" - }, { "aliasColors": {}, "bars": false, "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", + "description": "", "editable": true, "error": false, "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -701,28 +556,28 @@ "fillGradient": 1, "grid": {}, "gridPos": { - "h": 8, + "h": 9, "w": 12, "x": 0, - "y": 33 + "y": 10 }, "hiddenSeries": false, "id": 16, "legend": { - "alignAsTable": true, - "avg": true, + "alignAsTable": false, + "avg": false, "current": false, "hideEmpty": true, "hideZero": true, - "max": true, + "max": false, "min": false, "rightSide": false, - "show": false, + "show": true, "total": false, - "values": true + "values": false }, "lines": true, - "linewidth": 2, + "linewidth": 1, "links": [], "mode": "", "nullPointMode": "connected", @@ -730,7 +585,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -802,7 +657,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "$ServerName - Physical Fiber Channel Adapters", + "title": "Physical Fiber Channel Adapters", "tooltip": { "msResolution": false, "shared": true, @@ -848,13 +703,12 @@ "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "", "editable": true, "error": false, "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -863,25 +717,25 @@ "fillGradient": 2, "grid": {}, "gridPos": { - "h": 8, + "h": 9, "w": 12, "x": 12, - "y": 33 + "y": 10 }, "hiddenSeries": false, "id": 11, "legend": { - "alignAsTable": true, - "avg": true, + "alignAsTable": false, + "avg": false, "current": false, "hideEmpty": true, "hideZero": true, - "max": true, - "min": true, + "max": false, + "min": false, "rightSide": false, - "show": false, + "show": true, "total": false, - "values": true + "values": false }, "lines": true, "linewidth": 1, @@ -892,7 +746,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -903,7 +757,7 @@ "style": {}, "targets": [ { - "alias": "VLAN $tag_vlanId recv", + "alias": "VLAN-$tag_vlanId $col", "dsType": "influxdb", "groupBy": [ { @@ -948,53 +802,14 @@ { "params": [], "type": "mean" + }, + { + "params": [ + "recv" + ], + "type": "alias" } - ] - ], - "tags": [ - { - "key": "servername", - "operator": "=~", - "value": "/^$ServerName$/" - } - ] - }, - { - "alias": "VLAN $tag_vlanId sent", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "servername" - ], - "type": "tag" - }, - { - "params": [ - "vlanId" - ], - "type": "tag" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "lpar_net_virtual", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ + ], [ { "params": [ @@ -1008,9 +823,15 @@ }, { "params": [ - "*-1" + " *-1" ], "type": "math" + }, + { + "params": [ + "sent" + ], + "type": "alias" } ] ], @@ -1027,7 +848,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "$ServerName - Network", + "title": "Network - Partitions", "tooltip": { "msResolution": false, "shared": true, @@ -1045,7 +866,7 @@ "yaxes": [ { "$$hashKey": "object:1686", - "format": "Bps", + "format": "binBps", "label": null, "logBase": 1, "max": null, @@ -1067,128 +888,157 @@ "alignLevel": null } }, - { - "collapsed": false, - "datasource": "${DS_HMCI}", - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 82 - }, - "id": 21, - "panels": [], - "repeat": "ServerName", - "title": "Partition Usage - $ServerName", - "type": "row" - }, { "aliasColors": {}, "bars": false, - "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", - "decimals": 2, - "editable": true, - "error": false, + "datasource": "${DS_INFLUXDB-HMCI}", + "description": "", "fieldConfig": { "defaults": { - "custom": {}, - "links": [] + "links": [], + "unit": "celsius" }, "overrides": [] }, - "fill": 2, - "fillGradient": 2, - "grid": {}, + "fill": 1, + "fillGradient": 1, "gridPos": { - "h": 7, + "h": 10, "w": 12, "x": 0, - "y": 83 + "y": 19 }, "hiddenSeries": false, - "id": 12, + "id": 26, "legend": { - "alignAsTable": true, - "avg": true, + "avg": false, "current": true, "hideEmpty": true, "hideZero": true, - "max": true, - "min": true, - "show": false, - "sort": "avg", - "sortDesc": true, + "max": false, + "min": false, + "show": true, "total": false, "values": true }, "lines": true, - "linewidth": 2, - "links": [], - "mode": "", - "nullPointMode": "connected", + "linewidth": 1, + "nullPointMode": "null", "options": { "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", - "pointradius": 5, + "pluginVersion": "8.0.0", + "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, - "stack": true, + "stack": false, "steppedLine": false, - "style": {}, "targets": [ { - "alias": "$tag_lparname", - "dsType": "influxdb", + "alias": "$col", "groupBy": [ { "params": [ - "$interval" + "$__interval" ], "type": "time" }, { "params": [ - "lparname" + "system" ], "type": "tag" }, { "params": [ - "servername" - ], - "type": "tag" - }, - { - "params": [ - "null" + "linear" ], "type": "fill" } ], - "hide": false, - "measurement": "lpar_processor", + "measurement": "server_energy_thermal", "orderByTime": "ASC", "policy": "default", + "query": "SELECT mean(\"cpuTemperature*\") FROM \"server_energy_thermal\" WHERE (\"servername\" =~ /^$ServerName$/) AND $timeFilter GROUP BY time($__interval), \"system\", \"servername\" fill(linear)", + "rawQuery": false, "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "utilizedProcUnits" + "cpuTemperature_1" ], "type": "field" }, { "params": [], "type": "mean" + }, + { + "params": [ + "CPU-1" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "cpuTemperature_2" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "CPU-2" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "cpuTemperature_3" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "CPU-3" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "cpuTemperature_4" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "CPU-4" + ], + "type": "alias" } ] ], @@ -1197,12 +1047,6 @@ "key": "servername", "operator": "=~", "value": "/^$ServerName$/" - }, - { - "condition": "AND", - "key": "lparname", - "operator": "=~", - "value": "/^$LPAR$/" } ] } @@ -1211,9 +1055,8 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "LPAR Processor Utilization", + "title": "CPU Temperature", "tooltip": { - "msResolution": false, "shared": true, "sort": 2, "value_type": "individual" @@ -1228,16 +1071,17 @@ }, "yaxes": [ { - "$$hashKey": "object:4567", - "format": "short", - "label": "cores", + "$$hashKey": "object:5961", + "decimals": 0, + "format": "celsius", + "label": "", "logBase": 1, "max": null, - "min": "0", + "min": null, "show": true }, { - "$$hashKey": "object:4568", + "$$hashKey": "object:5962", "format": "short", "label": null, "logBase": 1, @@ -1252,59 +1096,58 @@ } }, { - "datasource": "${DS_HMCI}", - "description": "", + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_INFLUXDB-HMCI}", "fieldConfig": { "defaults": { - "custom": {}, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "decmbytes" + "unit": "watt" }, "overrides": [] }, + "fill": 1, + "fillGradient": 0, "gridPos": { - "h": 7, + "h": 10, "w": 12, "x": 12, - "y": 83 + "y": 19 }, - "id": 23, - "links": [], + "hiddenSeries": false, + "id": 22, + "legend": { + "avg": false, + "current": true, + "max": false, + "min": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", "options": { - "displayMode": "gradient", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "text": {} + "alertThreshold": true }, - "pluginVersion": "7.4.2", + "percentage": false, + "pluginVersion": "8.0.0", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, "targets": [ { - "alias": "$tag_lparname", - "dsType": "influxdb", + "alias": "$tag_servername", "groupBy": [ { "params": [ - "$interval" + "$__interval" ], "type": "time" }, @@ -1316,19 +1159,12 @@ }, { "params": [ - "lparname" - ], - "type": "tag" - }, - { - "params": [ - "null" + "linear" ], "type": "fill" } ], - "hide": false, - "measurement": "lpar_memory", + "measurement": "server_energy_power", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -1337,7 +1173,7 @@ [ { "params": [ - "logicalMem" + "powerReading" ], "type": "field" }, @@ -1352,24 +1188,54 @@ "key": "servername", "operator": "=~", "value": "/^$ServerName$/" - }, - { - "condition": "AND", - "key": "lparname", - "operator": "=~", - "value": "/^$LPAR$/" } ] } ], + "thresholds": [], "timeFrom": null, + "timeRegions": [], "timeShift": null, - "title": "LPAR Memory Usage", - "type": "bargauge" + "title": "Power Consumption", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "watt", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } } ], "refresh": "1m", - "schemaVersion": 27, + "schemaVersion": 30, "style": "dark", "tags": [ "Power" @@ -1380,7 +1246,7 @@ "allFormat": "regex values", "allValue": null, "current": {}, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "definition": "SHOW TAG VALUES FROM \"server_processor\" WITH KEY = \"servername\" WHERE time > now() - 24h", "description": null, "error": null, @@ -1398,34 +1264,6 @@ "skipUrlSync": false, "sort": 0, "tagValuesQuery": null, - "tags": [], - "tagsQuery": null, - "type": "query", - "useTags": false - }, - { - "allFormat": "regex values", - "allValue": null, - "current": {}, - "datasource": "${DS_HMCI}", - "definition": "SHOW TAG VALUES FROM \"lpar_processor\" WITH KEY = \"lparname\" WHERE servername =~ /$ServerName/", - "description": null, - "error": null, - "hide": 0, - "includeAll": true, - "label": "Partition", - "multi": true, - "multiFormat": "regex values", - "name": "LPAR", - "options": [], - "query": "SHOW TAG VALUES FROM \"lpar_processor\" WITH KEY = \"lparname\" WHERE servername =~ /$ServerName/", - "refresh": 1, - "refresh_on_load": false, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": null, - "tags": [], "tagsQuery": null, "type": "query", "useTags": false @@ -1464,5 +1302,5 @@ "timezone": "browser", "title": "IBM Power - HMCi - System Resources", "uid": "ClJhHPIGz", - "version": 26 + "version": 7 } \ No newline at end of file diff --git a/doc/IBM Power - HMCi - Virtual I_O Servers-1617197498035.json b/doc/IBM Power - HMCi - Virtual I_O Servers-1623369593625.json similarity index 89% rename from doc/IBM Power - HMCi - Virtual I_O Servers-1617197498035.json rename to doc/IBM Power - HMCi - Virtual I_O Servers-1623369593625.json index 1faa315..972c015 100644 --- a/doc/IBM Power - HMCi - Virtual I_O Servers-1617197498035.json +++ b/doc/IBM Power - HMCi - Virtual I_O Servers-1623369593625.json @@ -1,8 +1,8 @@ { "__inputs": [ { - "name": "DS_HMCI", - "label": "HMCi", + "name": "DS_INFLUXDB-HMCI", + "label": "InfluxDB-hmci", "description": "", "type": "datasource", "pluginId": "influxdb", @@ -20,12 +20,12 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "7.4.2" + "version": "8.0.0" }, { "type": "panel", "id": "graph", - "name": "Graph", + "name": "Graph (old)", "version": "" }, { @@ -60,11 +60,11 @@ "gnetId": 1465, "graphTooltip": 0, "id": null, - "iteration": 1617197467456, + "iteration": 1623369402365, "links": [], "panels": [ { - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "", "fieldConfig": { "defaults": { @@ -92,7 +92,7 @@ { "matcher": { "id": "byName", - "options": "lparname" + "options": "Name" }, "properties": [ { @@ -104,18 +104,34 @@ { "matcher": { "id": "byName", - "options": "affinityScore" + "options": "Affinity Score" }, "properties": [ { "id": "color", "value": { - "mode": "thresholds" + "mode": "continuous-RdYlGr" } }, { "id": "unit", "value": "percent" + }, + { + "id": "custom.displayMode", + "value": "basic" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "ID" + }, + "properties": [ + { + "id": "custom.width", + "value": 330 } ] } @@ -132,7 +148,7 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "targets": [ { "alias": "Read", @@ -199,17 +215,51 @@ ], "timeFrom": null, "timeShift": null, - "title": "", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true + }, + "indexByName": { + "Time": 0, + "affinityScore": 4, + "id": 1, + "viosname": 2, + "viosstate": 3 + }, + "renameByName": { + "affinityScore": "Affinity Score", + "id": "ID", + "viosname": "Name", + "viosstate": "State" + } + } + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "field": "Name" + } + ] + } + } + ], "type": "table" }, { - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "", "fieldConfig": { "defaults": { - "custom": {}, "links": [], "mappings": [], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ @@ -238,7 +288,7 @@ "options": { "reduceOptions": { "calcs": [ - "mean" + "lastNotNull" ], "fields": "", "values": false @@ -247,7 +297,7 @@ "showThresholdMarkers": true, "text": {} }, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "targets": [ { "alias": "$tag_viosname", @@ -288,7 +338,7 @@ }, { "params": [], - "type": "mean" + "type": "last" } ] ], @@ -318,19 +368,18 @@ "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "", "editable": true, "error": false, "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] }, - "fill": 2, - "fillGradient": 2, + "fill": 1, + "fillGradient": 0, "grid": {}, "gridPos": { "h": 9, @@ -352,7 +401,7 @@ "values": false }, "lines": true, - "linewidth": 2, + "linewidth": 1, "links": [], "mode": "", "nullPointMode": "connected", @@ -360,7 +409,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -371,7 +420,7 @@ "style": {}, "targets": [ { - "alias": "$tag_viosname", + "alias": "$tag_viosname - $col", "dsType": "influxdb", "groupBy": [ { @@ -410,6 +459,12 @@ { "params": [], "type": "mean" + }, + { + "params": [ + "utilized" + ], + "type": "alias" } ] ], @@ -478,13 +533,12 @@ "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "", "editable": true, "error": false, "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -493,23 +547,23 @@ "fillGradient": 1, "grid": {}, "gridPos": { - "h": 9, - "w": 24, + "h": 18, + "w": 12, "x": 0, "y": 14 }, "hiddenSeries": false, "id": 18, "legend": { - "alignAsTable": true, - "avg": true, + "alignAsTable": false, + "avg": false, "current": false, - "max": true, + "max": false, "min": false, "rightSide": false, - "show": false, + "show": true, "total": false, - "values": true + "values": false }, "lines": true, "linewidth": 1, @@ -520,7 +574,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -725,13 +779,12 @@ "content": "", "dashLength": 10, "dashes": false, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "description": "", "editable": true, "error": false, "fieldConfig": { "defaults": { - "custom": {}, "links": [] }, "overrides": [] @@ -740,23 +793,23 @@ "fillGradient": 1, "grid": {}, "gridPos": { - "h": 9, - "w": 24, - "x": 0, - "y": 23 + "h": 18, + "w": 12, + "x": 12, + "y": 14 }, "hiddenSeries": false, "id": 17, "legend": { - "alignAsTable": true, - "avg": true, + "alignAsTable": false, + "avg": false, "current": false, - "max": true, - "min": true, + "max": false, + "min": false, "rightSide": false, - "show": false, + "show": true, "total": false, - "values": true + "values": false }, "lines": true, "linewidth": 1, @@ -767,7 +820,7 @@ "alertThreshold": true }, "percentage": false, - "pluginVersion": "7.4.2", + "pluginVersion": "8.0.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -995,7 +1048,7 @@ } ], "refresh": "1m", - "schemaVersion": 27, + "schemaVersion": 30, "style": "dark", "tags": [ "Power", @@ -1008,7 +1061,7 @@ "allFormat": "regex values", "allValue": null, "current": {}, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "definition": "SHOW TAG VALUES FROM \"server_processor\" WITH KEY = \"servername\" WHERE time > now() - 24h", "description": null, "error": null, @@ -1026,7 +1079,6 @@ "skipUrlSync": false, "sort": 0, "tagValuesQuery": null, - "tags": [], "tagsQuery": null, "type": "query", "useTags": false @@ -1035,7 +1087,7 @@ "allFormat": "regex values", "allValue": null, "current": {}, - "datasource": "${DS_HMCI}", + "datasource": "${DS_INFLUXDB-HMCI}", "definition": "SHOW TAG VALUES FROM \"vios_details\" WITH KEY = \"viosname\" WHERE servername =~ /$ServerName/ AND time > now() - 24h", "description": null, "error": null, @@ -1053,7 +1105,6 @@ "skipUrlSync": false, "sort": 0, "tagValuesQuery": null, - "tags": [], "tagsQuery": null, "type": "query", "useTags": false @@ -1092,5 +1143,5 @@ "timezone": "browser", "title": "IBM Power - HMCi - Virtual I/O Servers", "uid": "DDNEv5vGz", - "version": 18 + "version": 4 } \ No newline at end of file diff --git a/doc/readme-service.md b/doc/readme-service.md index 15b4722..2a0813d 100644 --- a/doc/readme-service.md +++ b/doc/readme-service.md @@ -5,10 +5,15 @@ To install as a systemd service, copy the **hmci.service** file into */etc/systemd/system/* and enable the service: - systemctl daemon-reload - systemctl enable hmci.service - systemctl restart hmci.service +```shell +cp /opt/hmci/doc/hmci.service /etc/systemd/system/ +systemctl daemon-reload +systemctl enable hmci.service +systemctl restart hmci.service +``` -To read log output from the service, use: +To read log output from the service: - journalctl -f -u hmci.service +```shell +journalctl -f -u hmci.service +``` diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 62d4c05..e708b1c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bb8b2fc..0f80bbf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index fbd7c51..4f906e0 100755 --- a/gradlew +++ b/gradlew @@ -130,7 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath diff --git a/gradlew.bat b/gradlew.bat index 5093609..107acd3 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,21 +64,6 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line @@ -86,7 +71,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/src/main/java/biz/nellemann/hmci/HmcRestClient.java b/src/main/java/biz/nellemann/hmci/HmcRestClient.java index 9a4fa3a..350bcd2 100644 --- a/src/main/java/biz/nellemann/hmci/HmcRestClient.java +++ b/src/main/java/biz/nellemann/hmci/HmcRestClient.java @@ -249,7 +249,7 @@ public class HmcRestClient { // Do not try to parse empty response if(responseBody == null || responseBody.isEmpty() || responseBody.length() <= 1) { responseErrors++; - log.warn("getPcmDataForManagedSystem() - empty response"); + log.warn("getPcmDataForManagedSystem() - empty response, skipping: " + system.name); return null; } @@ -287,7 +287,7 @@ public class HmcRestClient { // Do not try to parse empty response if(responseBody == null || responseBody.isEmpty() || responseBody.length() <= 1) { responseErrors++; - log.warn("getPcmDataForLogicalPartition() - empty response"); + log.warn("getPcmDataForLogicalPartition() - empty response, skipping: " + partition.name); return null; } diff --git a/src/main/java/biz/nellemann/hmci/InfluxClient.java b/src/main/java/biz/nellemann/hmci/InfluxClient.java index ad32b16..2b04681 100644 --- a/src/main/java/biz/nellemann/hmci/InfluxClient.java +++ b/src/main/java/biz/nellemann/hmci/InfluxClient.java @@ -122,13 +122,13 @@ class InfluxClient { void writeManagedSystem(ManagedSystem system) { if(system.metrics == null) { - log.trace("writeManagedSystem() - null metrics, skipping"); + log.trace("writeManagedSystem() - null metrics, skipping: " + system.name); return; } Instant timestamp = system.getTimestamp(); if(timestamp == null) { - log.warn("writeManagedSystem() - no timestamp, skipping"); + log.warn("writeManagedSystem() - no timestamp, skipping: " + system.name); return; } @@ -253,13 +253,13 @@ class InfluxClient { void writeLogicalPartition(LogicalPartition partition) { if(partition.metrics == null) { - log.warn("writeLogicalPartition() - null metrics, skipping"); + log.warn("writeLogicalPartition() - null metrics, skipping: " + partition.name); return; } Instant timestamp = partition.getTimestamp(); if(timestamp == null) { - log.warn("writeLogicalPartition() - no timestamp, skipping"); + log.warn("writeLogicalPartition() - no timestamp, skipping: " + partition.name); return; } @@ -311,21 +311,21 @@ class InfluxClient { */ - void writeSystemEnergy(SystemEnergy system) { + void writeSystemEnergy(SystemEnergy systemEnergy) { - if(system.metrics == null) { - log.trace("writeSystemEnergy() - null metrics, skipping"); + if(systemEnergy.metrics == null) { + log.trace("writeSystemEnergy() - null metrics, skipping: " + systemEnergy.system.name); return; } - Instant timestamp = system.getTimestamp(); + Instant timestamp = systemEnergy.getTimestamp(); if(timestamp == null) { - log.warn("writeSystemEnergy() - no timestamp, skipping"); + log.warn("writeSystemEnergy() - no timestamp, skipping: " + systemEnergy.system.name); return; } - getSystemEnergyPower(system, timestamp).forEach(it -> batchPoints.point(it) ); - getSystemEnergyTemperature(system, timestamp).forEach(it -> batchPoints.point(it) ); + getSystemEnergyPower(systemEnergy, timestamp).forEach(it -> batchPoints.point(it) ); + getSystemEnergyTemperature(systemEnergy, timestamp).forEach(it -> batchPoints.point(it) ); } private static List getSystemEnergyPower(SystemEnergy system, Instant timestamp) { diff --git a/src/test/groovy/biz/nellemann/hmci/LogicalPartitionTest.groovy b/src/test/groovy/biz/nellemann/hmci/LogicalPartitionTest.groovy index 95f9e7a..ec007a8 100644 --- a/src/test/groovy/biz/nellemann/hmci/LogicalPartitionTest.groovy +++ b/src/test/groovy/biz/nellemann/hmci/LogicalPartitionTest.groovy @@ -122,4 +122,21 @@ class LogicalPartitionTest extends Specification { } + void "test getVirtualGenericAdapterMetrics"() { + + setup: + def testFile = new File(getClass().getResource('/pcm-data-logical-partition.json').toURI()) + def testJson = testFile.getText('UTF-8') + ManagedSystem system = new ManagedSystem("e09834d1-c930-3883-bdad-405d8e26e166", "Test Name","Test Type", "Test Model", "Test S/N") + LogicalPartition lpar = new LogicalPartition("2DE05DB6-8AD5-448F-8327-0F488D287E82", "9Flash01", "OS400", system) + + when: + lpar.processMetrics(testJson) + List listOfMeasurements = lpar.getVirtualGenericAdapterMetrics() + + then: + listOfMeasurements.size() == 1 + listOfMeasurements.first().fields['readBytes'] == 0.0 + } + }