[Nagiosplug-checkins] CVS: nagiosplug/contrib checkciscotemp.pl,1.1.1.1,1.2
Karl DeBisschop
kdebisschop at users.sourceforge.net
Mon Jan 27 23:18:02 CET 2003
Update of /cvsroot/nagiosplug/nagiosplug/contrib
In directory sc8-pr-cvs1:/tmp/cvs-serv30836/contrib
Modified Files:
checkciscotemp.pl
Log Message:
split and validate input more robustly
Index: checkciscotemp.pl
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/contrib/checkciscotemp.pl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** checkciscotemp.pl 28 Feb 2002 06:42:53 -0000 1.1.1.1
--- checkciscotemp.pl 28 Jan 2003 07:17:24 -0000 1.2
***************
*** 31,35 ****
####################################
! use Net::SNMP;
use Getopt::Long;
&Getopt::Long::config('auto_abbrev');
--- 31,35 ----
####################################
! #use Net::SNMP;
use Getopt::Long;
&Getopt::Long::config('auto_abbrev');
***************
*** 82,95 ****
if (defined($critical_vals)) {
! die "Cannot Parse Critical Thresholds\n"
! unless (split(/:/,$critical_vals)>=2);
! ($inlet_thresh,$outlet_thresh) = @_
}
- die unless(defined($inlet_thresh) && defined($outlet_thresh));
if (defined($warning_vals)) {
! die "Cannot Parse Critical Thresholds\n"
! unless (split(/:/,$warning_vals)>=2);
! ($inlet_warn,$outlet_warn) = @_;
}else{
$inlet_warn=$inlet_thresh;
--- 82,98 ----
if (defined($critical_vals)) {
! if ($critical_vals =~ m/^([0-9]+)[,:]([0-9]+)$/) {
! ($inlet_thresh,$outlet_thresh) = ($1, $2);
! } else {
! die "Cannot Parse Critical Thresholds\n";
! }
}
if (defined($warning_vals)) {
! if ($warning_vals =~ m/^([0-9]+)[:,]([0-9]+)$/) {
! ($inlet_warn,$outlet_warn) = ($1, $2);
! } else {
! die "Cannot Parse Warning Thresholds\n";
! }
}else{
$inlet_warn=$inlet_thresh;
More information about the Commits
mailing list