[packages/nagios-plugin-check_snmp_mem] make it alert if swap is not configured

glen glen at pld-linux.org
Mon Sep 15 21:09:34 CEST 2014


commit 47583797a1b75fd29586718ab2e9b99f661ef306
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Sep 15 22:09:16 2014 +0300

    make it alert if swap is not configured

 nagios-plugin-check_snmp_mem.spec |  2 ++
 noswap-critical.patch             | 11 +++++++++++
 2 files changed, 13 insertions(+)
---
diff --git a/nagios-plugin-check_snmp_mem.spec b/nagios-plugin-check_snmp_mem.spec
index 4e1dd99..65452c2 100644
--- a/nagios-plugin-check_snmp_mem.spec
+++ b/nagios-plugin-check_snmp_mem.spec
@@ -11,6 +11,7 @@ Source0:	http://nagios.proy.org/check_snmp_mem.pl
 # Source0-md5:	f4b03cf520e6e4eab9dc6a67c88032d9
 Patch0:		%{name}-path.patch
 Patch1:		net-snmp-version.patch
+Patch2:		noswap-critical.patch
 Source1:	%{plugin}.cfg
 URL:		http://nagios.proy.org/snmp_mem.html
 BuildRequires:	rpm-perlprov >= 4.1-13
@@ -38,6 +39,7 @@ systemach Linux/Unix, Cisco, HP Procurve.
 install -p %{SOURCE0} .
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %{__sed} -i -e 's, at plugindir@,%{plugindir},' %{plugin}.pl
 
diff --git a/noswap-critical.patch b/noswap-critical.patch
new file mode 100644
index 0000000..c3d2eda
--- /dev/null
+++ b/noswap-critical.patch
@@ -0,0 +1,11 @@
+--- ./check_snmp_mem.pl	2012-02-06 20:44:24.000000000 +0200
++++ ./check_snmp_mem.pl	2014-09-15 22:07:59.000000000 +0300
+@@ -493,7 +491,7 @@
+   
+   my $n_status="OK";
+   my $n_output="Ram : " . $realused . "%, Swap : " . $swapused . "% :";
+-  if ((($o_critR!=0)&&($o_critR <= $realused)) || (($o_critS!=0)&&($o_critS <= $swapused))) {
++  if (($$resultat{$nets_swap_total} == 0) || (($o_critR!=0)&&($o_critR <= $realused)) || (($o_critS!=0)&&($o_critS <= $swapused))) {
+     $n_output .= " > " . $o_critR . ", " . $o_critS;
+     $n_status="CRITICAL";
+   } else {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nagios-plugin-check_snmp_mem.git/commitdiff/47583797a1b75fd29586718ab2e9b99f661ef306



More information about the pld-cvs-commit mailing list