display total SWAP info in check output
Message-ID: <533a6733.Iz33+f/xaln5Ikn7%ab(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: f50da6085c45a36987ac94c5c25424684ff68433
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f50da6085c45a3…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Apr 1 09:13:52 2014 +0200
mem, fortigate_memory, solaris_mem: display total SWAP info in check output
---
.werks/743 | 8 ++++++++
ChangeLog | 1 +
checks/mem.include | 4 ++--
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/.werks/743 b/.werks/743
new file mode 100644
index 0000000..10a1192
--- /dev/null
+++ b/.werks/743
@@ -0,0 +1,8 @@
+Title: mem, fortigate_memory, solaris_mem: display total SWAP info in check output
+Level: 1
+Component: checks
+Version: 1.2.5i2
+Date: 1396336419
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index a0cf1b1..d4baa97 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
* 0764 lnx_quota: Added new check to monitor Linux File System Quota...
* 0776 ibm_svc_nodestats.cpu_util: new check for CPU Utilization per Node on IBM SVC
/ V7000 devices
* 0600 nfsexports.solaris: new agent plugin for monitoring nfs exports on solaris
systems...
+ * 0743 mem, fortigate_memory, solaris_mem: display total SWAP info in check output
* 0740 FIX: winperf_if: now able to handle bandwidth > 4GBit...
Multisite:
diff --git a/checks/mem.include b/checks/mem.include
index 3f1cc83..682fe6b 100644
--- a/checks/mem.include
+++ b/checks/mem.include
@@ -58,9 +58,9 @@ def check_memory(params, meminfo):
pgtext = " + %.2f Pagetables" % (pagetables_mb / 1024.0)
else:
pgtext = ""
- infotext = "%.2f GB used (%.2f RAM + %.2f SWAP%s, this is %.1f%% of %.2f
RAM" % \
+ infotext = "%.2f GB used (%.2f RAM + %.2f SWAP%s, this is %.1f%% of %.2f RAM
(%.2f total SWAP)" % \
(totalused_mb / 1024.0, (memused-caches) / 1024.0 / 1024, swapused /
1024.0 / 1024,
- pgtext, totalused_perc, totalmem_mb / 1024.0)
+ pgtext, totalused_perc, totalmem_mb / 1024.0,
meminfo["SwapTotal"] / 1024.0 / 1024)
# Take into account averaging
average_min = params.get("average")