summaryrefslogtreecommitdiffstats
path: root/plugins/t
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2021-10-28 14:13:28 (GMT)
committerGitHub <noreply@github.com>2021-10-28 14:13:28 (GMT)
commit7415eb2f065911b138e167e35d0f67cddb5718ef (patch)
tree27c82696cf49a00a379f030bb09adc3f1e37102e /plugins/t
parente79ada81a696e3c826b383e3ff7cbc8f91bf46a4 (diff)
parent884327ee21b25be3ce1b5627bb40339e14545256 (diff)
downloadmonitoring-plugins-7415eb2f065911b138e167e35d0f67cddb5718ef.tar.gz
Merge pull request #1714 from RincewindsHat/fix_perfdata_for_big_values_for_check_disk
Fix perfdata for big values for check disk. First merge \o/
Diffstat (limited to 'plugins/t')
-rw-r--r--plugins/t/check_disk.t7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/t/check_disk.t b/plugins/t/check_disk.t
index fdd8769..ec527e7 100644
--- a/plugins/t/check_disk.t
+++ b/plugins/t/check_disk.t
@@ -88,8 +88,9 @@ $result = NPTest->testCmd(
88 ); 88 );
89$_ = $result->perf_output; 89$_ = $result->perf_output;
90my ($warn_absth_data, $crit_absth_data, $total_absth_data) = (m/=.[^;]*;(\d+);(\d+);\d+;(\d+)/); 90my ($warn_absth_data, $crit_absth_data, $total_absth_data) = (m/=.[^;]*;(\d+);(\d+);\d+;(\d+)/);
91is ($warn_absth_data, $total_absth_data - 20, "Wrong warning in perf data using absolute thresholds"); 91# default unit is MiB, but perfdata is always bytes
92is ($crit_absth_data, $total_absth_data - 10, "Wrong critical in perf data using absolute thresholds"); 92is ($warn_absth_data, $total_absth_data - (20 * (2 ** 20)), "Wrong warning in perf data using absolute thresholds");
93is ($crit_absth_data, $total_absth_data - (10 * (2 ** 20)), "Wrong critical in perf data using absolute thresholds");
93 94
94# Then check percent thresholds. 95# Then check percent thresholds.
95$result = NPTest->testCmd( 96$result = NPTest->testCmd(
@@ -119,7 +120,7 @@ like ( $result->only_output, qr/$more_free/, "Have disk name in text");
119$result = NPTest->testCmd( "./check_disk -w 1 -c 1 -p $more_free -p $less_free" ); 120$result = NPTest->testCmd( "./check_disk -w 1 -c 1 -p $more_free -p $less_free" );
120cmp_ok( $result->return_code, '==', 0, "At least 1 MB available on $more_free and $less_free"); 121cmp_ok( $result->return_code, '==', 0, "At least 1 MB available on $more_free and $less_free");
121$_ = $result->output; 122$_ = $result->output;
122my ($free_mb_on_mp1, $free_mb_on_mp2) = (m/(\d+) MB .* (\d+) MB /g); 123my ($free_mb_on_mp1, $free_mb_on_mp2) = (m/(\d+)MiB .* (\d+)MiB /g);
123my $free_mb_on_all = $free_mb_on_mp1 + $free_mb_on_mp2; 124my $free_mb_on_all = $free_mb_on_mp1 + $free_mb_on_mp2;
124 125
125 126