From c25c9d8dd1dfc31d9c7f328eff30aacfcbe9cce9 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 25 May 2020 10:25:58 +0200 Subject: [PATCH] src/bin/proxmox-backup-proxy.rs: gather swap usage stats --- src/bin/proxmox-backup-proxy.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs index 475ea4ed..748958a7 100644 --- a/src/bin/proxmox-backup-proxy.rs +++ b/src/bin/proxmox-backup-proxy.rs @@ -625,6 +625,12 @@ async fn generate_host_stats() { if let Err(err) = rrd::update_value("host/memused", meminfo.memused as f64, rrd::DST::Gauge) { eprintln!("rrd::update_value 'host/memused' failed - {}", err); } + if let Err(err) = rrd::update_value("host/swaptotal", meminfo.swaptotal as f64, rrd::DST::Gauge) { + eprintln!("rrd::update_value 'host/swaptotal' failed - {}", err); + } + if let Err(err) = rrd::update_value("host/swapused", meminfo.swapused as f64, rrd::DST::Gauge) { + eprintln!("rrd::update_value 'host/swapused' failed - {}", err); + } } Err(err) => { eprintln!("read_meminfo failed - {}", err);