From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- ...eck-disk-smb--compare_levels_after_kMG_decoding | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 web/attachments/81737-nagios-plugins--check-disk-smb--compare_levels_after_kMG_decoding (limited to 'web/attachments/81737-nagios-plugins--check-disk-smb--compare_levels_after_kMG_decoding') diff --git a/web/attachments/81737-nagios-plugins--check-disk-smb--compare_levels_after_kMG_decoding b/web/attachments/81737-nagios-plugins--check-disk-smb--compare_levels_after_kMG_decoding new file mode 100644 index 0000000..1611f41 --- /dev/null +++ b/web/attachments/81737-nagios-plugins--check-disk-smb--compare_levels_after_kMG_decoding @@ -0,0 +1,38 @@ +--- ./check_disk_smb.compare_levels_after_kMG_decoding 2004-03-29 13:30:31.000000000 +0100 ++++ ./check_disk_smb 2004-03-29 13:38:37.000000000 +0100 +@@ -92,16 +92,6 @@ + usage("Both warning and critical should be same type- warning: $opt_w critical: $opt_c \n"); + } + +-# verify warning is less than critical +-if ( $opt_w =~ /[kMG]/) { +- unless ( $warn > $crit) { +- usage("Disk size: warning ($opt_w) should be greater than critical ($opt_c) \n"); +- } +-}else{ +- unless ( $warn < $crit) { +- usage("Percentage: warning ($opt_w) should be less than critical ($opt_c) \n"); +- } +-} + + my $workgroup = $1 if (defined($opt_W) && $opt_W =~ /(.*)/); + +@@ -177,6 +167,18 @@ + $crit = $1 * 1048576; + } + ++ # try to verify warning is less than critical ++ # should this require that warn_type and $crit_type are the same ? ++ if ( $warn_type eq "K" and $crit_type eq "K" ) { ++ unless ( $warn > $crit) { ++ usage("Disk size: warning ($opt_w) should be greater than critical ($opt_c) \n"); ++ } ++ } elsif ( $warn_type eq "P" and $crit_type eq "P" ) { ++ unless ( $warn < $crit) { ++ usage("Percentage: warning ($opt_w) should be less than critical ($opt_c) \n"); ++ } ++ } ++ + if (int($avail / 1024) > 0) { + $avail = int($avail / 1024); + if (int($avail /1024) > 0) { -- cgit v1.2.3-74-g34f1