[Nagiosplug-checkins] nagiosplug/plugins/t check_disk.t,1.17,1.18

Thomas Guyot dermoth at users.sourceforge.net
Mon Jan 29 15:14:07 CET 2007


Update of /cvsroot/nagiosplug/nagiosplug/plugins/t
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26502/plugins/t

Modified Files:
	check_disk.t 
Log Message:
Revert 1643463 (reversed disk thresholds) keeping the thresholds checks.


Index: check_disk.t
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/t/check_disk.t,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- check_disk.t	27 Jan 2007 21:49:21 -0000	1.17
+++ check_disk.t	29 Jan 2007 14:14:05 -0000	1.18
@@ -82,9 +82,9 @@
         "./check_disk -w 20 -c 10 -p $mountpoint_valid"
         );
 $_ = $result->perf_output;
-my ($warn_absth_data, $crit_absth_data) = (m/=.[^;]*;(\d+);(\d+);\d+;\d+/);
-is ($warn_absth_data, 20, "Wrong warning in perf data using absolute thresholds");
-is ($crit_absth_data, 10, "Wrong critical in perf data using absolute thresholds");
+my ($warn_absth_data, $crit_absth_data, $total_absth_data) = (m/=.[^;]*;(\d+);(\d+);\d+;(\d+)/);
+is ($warn_absth_data, $total_absth_data - 20, "Wrong warning in perf data using absolute thresholds");
+is ($crit_absth_data, $total_absth_data - 10, "Wrong critical in perf data using absolute thresholds");
 
 # Then check percent thresholds.
 $result = NPTest->testCmd(
@@ -92,8 +92,8 @@
         );
 $_ = $result->perf_output;
 my ($warn_percth_data, $crit_percth_data, $total_percth_data) = (m/=.[^;]*;(\d+);(\d+);\d+;(\d+)/);
-is ($warn_percth_data, int($total_percth_data/100*20), "Wrong warning in perf data using percent thresholds");
-is ($crit_percth_data, int($total_percth_data/100*10), "Wrong critical in perf data using percent thresholds");
+is ($warn_percth_data, int((1-20/100)*$total_percth_data), "Wrong warning in perf data using percent thresholds");
+is ($crit_percth_data, int((1-10/100)*$total_percth_data), "Wrong critical in perf data using percent thresholds");
 
 
 # Check when order of mount points are reversed, that perf data remains same





More information about the Commits mailing list