add vd cache checking

This commit is contained in:
Simon Schneider
2018-06-18 16:41:33 +02:00
parent 049508504b
commit f0a8beb145

View File

@ -43,6 +43,7 @@ our $CV_TEMP_WARNING = 70;
our $CV_TEMP_CRITICAL = 85;
our ($IGNERR_M, $IGNERR_O, $IGNERR_P, $IGNERR_S, $IGNERR_B) = (0, 0, 0, 0, 0);
our $NOENCLOSURES = 0;
our $NOWRITEBACKOK = 0;
our $CONTROLLER = 0;
use constant {
@ -135,6 +136,9 @@ sub displayUsage {
Specifies if enclosures are present or not. 0 means enclosures are
present (default), 1 states no enclosures are used (no 'eall' in
storcli commands).\n";
print " [ --nowritebackok <0/1> ]
Specifies if a WriteThrough Cache configuration is ok or not. 0 means WriteThrough is
considered Critical (default), 1 states WriteThrough is ok.\n";
print " [ --nosudo ]
Turn off using sudo.\n";
print " [ --nocleanlogs ]
@ -437,6 +441,15 @@ sub getLDStatus{
$statusLevel_a[3]->{$LD->{'ld'}.'_State'} = $LD->{'State'};
}
}
if(!$NOWRITEBACKOK){
if(exists($LD->{'Cache'})){
if(index($LD->{'Cache'}, 'WB') == -1){
$status = 'Critical';
push @{$statusLevel_a[2]}, $LD->{'ld'}.'_Cache';
$statusLevel_a[3]->{$LD->{'ld'}.'_Cache'} = $LD->{'Cache'};
}
}
}
if(exists($LD->{'Consist'})){
if($LD->{'Consist'} ne 'Yes' && $LD->{'TYPE'} ne 'Cac1'){
$status = 'Warning' unless $status eq 'Critical';
@ -1248,6 +1261,7 @@ MAIN: {
'p|path=s' => \$storcli,
'b|BBU=i' => \$bbu,
'noenclosures=i' => \$NOENCLOSURES,
'nowritebackok=i' => \$NOWRITEBACKOK,
'nosudo' => \$noSudo,
'nocleanlogs' => \$noCleanlogs
))){