diff options
Diffstat (limited to 'web/attachments/81737-nagios-plugins--check-disk-smb--compare_levels_after_kMG_decoding')
-rw-r--r-- | web/attachments/81737-nagios-plugins--check-disk-smb--compare_levels_after_kMG_decoding | 38 |
1 files changed, 38 insertions, 0 deletions
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 @@ | |||
1 | --- ./check_disk_smb.compare_levels_after_kMG_decoding 2004-03-29 13:30:31.000000000 +0100 | ||
2 | +++ ./check_disk_smb 2004-03-29 13:38:37.000000000 +0100 | ||
3 | @@ -92,16 +92,6 @@ | ||
4 | usage("Both warning and critical should be same type- warning: $opt_w critical: $opt_c \n"); | ||
5 | } | ||
6 | |||
7 | -# verify warning is less than critical | ||
8 | -if ( $opt_w =~ /[kMG]/) { | ||
9 | - unless ( $warn > $crit) { | ||
10 | - usage("Disk size: warning ($opt_w) should be greater than critical ($opt_c) \n"); | ||
11 | - } | ||
12 | -}else{ | ||
13 | - unless ( $warn < $crit) { | ||
14 | - usage("Percentage: warning ($opt_w) should be less than critical ($opt_c) \n"); | ||
15 | - } | ||
16 | -} | ||
17 | |||
18 | my $workgroup = $1 if (defined($opt_W) && $opt_W =~ /(.*)/); | ||
19 | |||
20 | @@ -177,6 +167,18 @@ | ||
21 | $crit = $1 * 1048576; | ||
22 | } | ||
23 | |||
24 | + # try to verify warning is less than critical | ||
25 | + # should this require that warn_type and $crit_type are the same ? | ||
26 | + if ( $warn_type eq "K" and $crit_type eq "K" ) { | ||
27 | + unless ( $warn > $crit) { | ||
28 | + usage("Disk size: warning ($opt_w) should be greater than critical ($opt_c) \n"); | ||
29 | + } | ||
30 | + } elsif ( $warn_type eq "P" and $crit_type eq "P" ) { | ||
31 | + unless ( $warn < $crit) { | ||
32 | + usage("Percentage: warning ($opt_w) should be less than critical ($opt_c) \n"); | ||
33 | + } | ||
34 | + } | ||
35 | + | ||
36 | if (int($avail / 1024) > 0) { | ||
37 | $avail = int($avail / 1024); | ||
38 | if (int($avail /1024) > 0) { | ||