Quellcode durchsuchen

Prevent check_swap from returning OK, if no swap activated

(Downstream Fedora patch)

Fix for issue #244
John C. Frickson vor 9 Jahren
Ursprung
Commit
782fd36c7d
2 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 1 0
      NEWS
  2. 1 1
      plugins/check_swap.c

+ 1 - 0
NEWS

@@ -16,6 +16,7 @@ x.x.x xxxx-xx-xx
 	check_users: segmentation fault if both thresholds are not provided
 	check_dns: DNS CRITICAL - expected ‘{hostname}.’ but got 'name = {hostname}.'
 	check_mailq: Nullmailer Regex is not working for Ubuntu 16.04
+	check_swap: Downstream Fedora patch: Prevent check_swap from returning OK, if no swap activated
 
 
 2.2.0 2017-01-19

+ 1 - 1
plugins/check_swap.c

@@ -126,7 +126,7 @@ main (int argc, char **argv)
 			free_swap_mb += dskfree_mb;
 			if (allswaps) {
 				if (dsktotal_mb == 0)
-					percent=100.0;
+					percent=0.0;
 				else
 					percent = 100 * (((double) dskused_mb) / ((double) dsktotal_mb));
 				result = max_state (result, check_swap (percent, dskfree_mb));