diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/checkciscotemp.pl | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/contrib/checkciscotemp.pl b/contrib/checkciscotemp.pl index a702a89e..c999e193 100644 --- a/contrib/checkciscotemp.pl +++ b/contrib/checkciscotemp.pl | |||
@@ -30,7 +30,7 @@ | |||
30 | # (in accordance with the plugin coding guidelines) | 30 | # (in accordance with the plugin coding guidelines) |
31 | #################################### | 31 | #################################### |
32 | 32 | ||
33 | use Net::SNMP; | 33 | #use Net::SNMP; |
34 | use Getopt::Long; | 34 | use Getopt::Long; |
35 | &Getopt::Long::config('auto_abbrev'); | 35 | &Getopt::Long::config('auto_abbrev'); |
36 | 36 | ||
@@ -81,16 +81,19 @@ unless (defined($hostname)) { | |||
81 | } | 81 | } |
82 | 82 | ||
83 | if (defined($critical_vals)) { | 83 | if (defined($critical_vals)) { |
84 | die "Cannot Parse Critical Thresholds\n" | 84 | if ($critical_vals =~ m/^([0-9]+)[,:]([0-9]+)$/) { |
85 | unless (split(/:/,$critical_vals)>=2); | 85 | ($inlet_thresh,$outlet_thresh) = ($1, $2); |
86 | ($inlet_thresh,$outlet_thresh) = @_ | 86 | } else { |
87 | die "Cannot Parse Critical Thresholds\n"; | ||
88 | } | ||
87 | } | 89 | } |
88 | die unless(defined($inlet_thresh) && defined($outlet_thresh)); | ||
89 | 90 | ||
90 | if (defined($warning_vals)) { | 91 | if (defined($warning_vals)) { |
91 | die "Cannot Parse Critical Thresholds\n" | 92 | if ($warning_vals =~ m/^([0-9]+)[:,]([0-9]+)$/) { |
92 | unless (split(/:/,$warning_vals)>=2); | 93 | ($inlet_warn,$outlet_warn) = ($1, $2); |
93 | ($inlet_warn,$outlet_warn) = @_; | 94 | } else { |
95 | die "Cannot Parse Warning Thresholds\n"; | ||
96 | } | ||
94 | }else{ | 97 | }else{ |
95 | $inlet_warn=$inlet_thresh; | 98 | $inlet_warn=$inlet_thresh; |
96 | $outlet_warn=$outlet_thresh; | 99 | $outlet_warn=$outlet_thresh; |