From dc260c67ea3638c9a6ae39a2418677b29d0a9e7e Mon Sep 17 00:00:00 2001 From: "Vanush \"Misha\" Paturyan" Date: Fri, 3 Mar 2017 16:48:14 +0000 Subject: [PATCH] Specifying warning and critical thresholds on cmd Allow to specify warning threshold with -w (--warning) and critical threshold with -c (--critical) command line parameters. --- check_lvm_thinpools | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/check_lvm_thinpools b/check_lvm_thinpools index 3166815..a9069e2 100755 --- a/check_lvm_thinpools +++ b/check_lvm_thinpools @@ -77,8 +77,12 @@ sub aggregate_errors { my $no_thinpools_ok = 0; -GetOptions("no-thinpools-ok" => \$no_thinpools_ok) - or die("Error in command line arguments\n"); +Getopt::Long::Configure('bundling'); +GetOptions + ("no-thinpools-ok" => \$no_thinpools_ok, + "w=f" => \$warn, "warning=f" => \$warn, + "c=f" => \$crit, "critical=f" => \$crit) + or die("Error in command line arguments\n"); my @thinpools = get_thinpools();