aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNat Lasseter <nat.lasseter@york.ac.uk>2021-02-11 17:40:10 +0000
committerNat Lasseter <nat.lasseter@york.ac.uk>2021-02-11 17:40:10 +0000
commit36bc010ee33a078a80cff69007075cd01f766418 (patch)
tree9593282f73ac7d0bcd76d5468fd308630c28c252
parent5ddf1c16dc7962790821bd61f0eb280d9929604b (diff)
Added prometheus_data_size raider
-rw-r--r--prometheus_data_size.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/prometheus_data_size.rb b/prometheus_data_size.rb
new file mode 100644
index 0000000..4b361b6
--- /dev/null
+++ b/prometheus_data_size.rb
@@ -0,0 +1,19 @@
+class PrometheusDataSize
+ def initialize(collector, config)
+ @collector = collector
+ @path = "/mnt/lustre/groups/prometheus/data"
+ end
+
+ def raid
+ bytes = `du -sb #{@path}`.split[0].to_i
+
+ @collector.redact!("prometheus_data_size")
+ @collector.report!(
+ "prometheus_data_size",
+ bytes,
+ help: "Size of the prometheus data directory in bytes",
+ type: "gauge",
+ labels: { path: @path }
+ )
+ end
+end