From 4a8220a7ebb77d7b6b4580a6d0aa738fa9524fd0 Mon Sep 17 00:00:00 2001 From: Johannes Ziemke Date: Sat, 7 Sep 2024 10:55:31 +0200 Subject: [PATCH] Add AIX dashboard --- docs/node-mixin/dashboards/node.libsonnet | 1 + docs/node-mixin/lib/prom-mixin.libsonnet | 32 ++++++++++++++++++++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/docs/node-mixin/dashboards/node.libsonnet b/docs/node-mixin/dashboards/node.libsonnet index a72f3ee76a..d7b4f4ab7e 100644 --- a/docs/node-mixin/dashboards/node.libsonnet +++ b/docs/node-mixin/dashboards/node.libsonnet @@ -3,5 +3,6 @@ grafanaDashboards+:: { 'nodes.json': nodemixin.new(config=$._config, platform='Linux', uid=std.md5('nodes.json')).dashboard, 'nodes-darwin.json': nodemixin.new(config=$._config, platform='Darwin', uid=std.md5('nodes-darwin.json')).dashboard, + 'nodes-aix.json': nodemixin.new(config=$._config, platform='Darwin', uid=std.md5('nodes-darwin.json')).dashboard, }, } diff --git a/docs/node-mixin/lib/prom-mixin.libsonnet b/docs/node-mixin/lib/prom-mixin.libsonnet index a558f0a418..b998f1b59c 100644 --- a/docs/node-mixin/lib/prom-mixin.libsonnet +++ b/docs/node-mixin/lib/prom-mixin.libsonnet @@ -143,6 +143,18 @@ local table = grafana70.panel.table; )) .addTarget(prometheus.target('node_memory_wired_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config, legendFormat='Wired Memory')) .addTarget(prometheus.target('node_memory_compressed_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config, legendFormat='Compressed')), + else if platform == 'AIX' then + memoryGraphPanelPrototype { stack: false } + .addTarget(prometheus.target('node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config, legendFormat='Physical Memory')) + .addTarget(prometheus.target( + ||| + ( + node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' - + node_memory_free_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} + ) + ||| % config, legendFormat='Memory Used' + )) + // NOTE: avg() is used to circumvent a label change caused by a node_exporter rollout. local memoryGaugePanelPrototype = @@ -496,8 +508,8 @@ local table = grafana70.panel.table; tags=(config.dashboardTags), timezone='utc', refresh='30s', - graphTooltip='shared_crosshair', - uid=std.md5(uid) + uid=std.md5(uid), + graphTooltip='shared_crosshair' ) .addTemplates(templates) .addRows(rows) @@ -508,8 +520,20 @@ local table = grafana70.panel.table; tags=(config.dashboardTags), timezone='utc', refresh='30s', - graphTooltip='shared_crosshair', - uid=std.md5(uid) + uid=std.md5(uid), + graphTooltip='shared_crosshair' + ) + .addTemplates(templates) + .addRows(rows), + else if platform == 'AIX' then + dashboard.new( + '%sAIX' % config.dashboardNamePrefix, + time_from='now-1h', + tags=(config.dashboardTags), + timezone='utc', + refresh='30s', + uid=std.md5(uid), + graphTooltip='shared_crosshair' ) .addTemplates(templates) .addRows(rows),