Author: glen                         Date: Fri Oct 16 13:34:57 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- if serial device can't be opened make that warning

---- Files affected:
packages/nagios-plugin-check_raid:
   check_raid (1.57 -> 1.58) 

---- Diffs:

================================================================
Index: packages/nagios-plugin-check_raid/check_raid
diff -u packages/nagios-plugin-check_raid/check_raid:1.57 
packages/nagios-plugin-check_raid/check_raid:1.58
--- packages/nagios-plugin-check_raid/check_raid:1.57   Fri Oct 16 14:13:38 2009
+++ packages/nagios-plugin-check_raid/check_raid        Fri Oct 16 15:34:51 2009
@@ -801,7 +801,12 @@
        my @status;
 
        my $modem = new SerialLine($device);
-       my $fh = $modem->open() or return;
+       my $fh = $modem->open();
+       unless ($fh) {
+               $status = $ERRORS{WARNING} unless $status;
+               $message .= "hp_msa: Can't open $device";
+               return;
+       }
 
        # check first controller
        print $fh "show this_controller\r";
@@ -1066,8 +1071,7 @@
        my ($lockfile) = $self->{device} =~ m#/dev/(.+)#;
        $lockfile = "$self->{lockdir}/LCK..$lockfile";
        if (-e $lockfile) {
-               carp "$lockfile already exists\n";
-               return 0
+               return 0;
        }
        open(my $fh, '>', $lockfile) || croak "Can't create lock: $lockfile\n";
        close($fh);
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/nagios-plugin-check_raid/check_raid?r1=1.57&r2=1.58&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to