@@ -49,7 +49,7 @@
# Version and similar info
$NAME = 'check_openmanage';
-$VERSION = '3.7.9';
+$VERSION = '3.7.10';
$AUTHOR = 'Trond H. Amundsen';
$CONTACT = 't.h.amundsen@usit.uio.no';
@@ -108,6 +108,7 @@
--only Only check a certain component or alert type
--check Fine-tune which components are checked
--no-storage Don't check storage
+ --vdisk-critical Make any alerts on virtual disks critical
For more information and advanced options, see the manual page or URL:
http://folk.uio.no/trondham/software/check_openmanage.html
@@ -167,6 +168,7 @@
'privprotocol' => undef, # SMNP v3
'use_get_table' => 0, # hack for SNMPv3 on Windows with net-snmp
'hide_servicetag' => 0, # hidden servicetag
+ 'vdisk_critical' => 0, # make vdisk alerts critical
);
# Get options
@@ -212,6 +214,7 @@
'privprotocol=s' => \$opt{privprotocol},
'use-get_table' => \$opt{use_get_table},
'hide-servicetag' => \$opt{hide_servicetag},
+ 'vdisk-critical' => \$opt{vdisk_critical},
) or do { print $USAGE; exit $E_UNKNOWN };
# If user requested help
@@ -413,6 +416,42 @@
'rac_fw' => 'N/A', # RAC firmware
);
+# Country and language list for URL generation
+my %country
+ = (
+ # EMEA
+ at => { c => 'at', l => 'de' }, # Austria
+ be => { c => 'be', l => 'nl' }, # Belgium
+ cz => { c => 'cz', l => 'cs' }, # Czech Republic
+ de => { c => 'de', l => 'de' }, # Germany
+ dk => { c => 'dk', l => 'da' }, # Denmark
+ es => { c => 'es', l => 'es' }, # Spain
+ fi => { c => 'fi', l => 'fi' }, # Finland
+ fr => { c => 'fr', l => 'fr' }, # France
+ gr => { c => 'gr', l => 'el' }, # Greece
+ it => { c => 'it', l => 'it' }, # Italy
+ il => { c => 'il', l => 'en' }, # Israel
+ me => { c => 'me', l => 'en' }, # Middle East
+ no => { c => 'no', l => 'no' }, # Norway
+ nl => { c => 'nl', l => 'nl' }, # The Netherlands
+ pl => { c => 'pl', l => 'pl' }, # Poland
+ pt => { c => 'pt', l => 'pt' }, # Portugal
+ ru => { c => 'ru', l => 'ru' }, # Russia
+ se => { c => 'se', l => 'sv' }, # Sweden
+ uk => { c => 'uk', l => 'en' }, # United Kingdom
+ za => { c => 'za', l => 'en' }, # South Africa
+ # America
+ br => { c => 'br', l => 'pt' }, # Brazil
+ ca => { c => 'ca', l => 'en' }, # Canada
+ mx => { c => 'mx', l => 'es' }, # Mexico
+ us => { c => 'us', l => 'en' }, # USA
+ # Asia/Pacific
+ au => { c => 'au', l => 'en' }, # Australia
+ cn => { c => 'cn', l => 'zh' }, # China
+ in => { c => 'in', l => 'en' }, # India
+ jp => { c => 'jp', l => 'ja' }, # Japan
+ );
+
# Adjust which checks to perform
adjust_checks() if defined $opt{check};
@@ -508,6 +547,7 @@
'snmp_timeout' => 'snmp_timeout',
'blacklist' => 'blacklist',
'legacy_perfdata' => 'legacy_performance_data',
+ 'vdisk_critical' => 'vdisk_critical',
);
# Load the perl module
@@ -800,6 +840,7 @@
configfile_set_boolean($sect, 'tcp');
configfile_set_boolean($sect, 'legacy_perfdata');
configfile_set_boolean($sect, 'hide_servicetag');
+ configfile_set_boolean($sect, 'vdisk_critical');
configfile_set_snmp_version($sect);
configfile_set_snmp_community($sect);
configfile_set_snmp_port($sect);
@@ -1420,15 +1461,26 @@
# PowerEdge server
sub documentation_url {
my $model = shift;
+ my $rev = shift;
- # create model short form, e.g. "r710"
- $model =~ s{\A PowerEdge \s (.+?) \z}{lc($1)}exms;
+ # Special case: R210 II
+ if ($model eq 'R210' and $rev eq 'II') {
+ $model = 'r210-2';
+ }
- # special case for blades (e.g. M600, M710), they have common
- # documentation
- $model =~ s{\A m\d+ \z}{m}xms;
+ # create model name used in URLs, e.g. "poweredge-r710"
+ $model = lc($model);
+ $model =~ s{\s}{-}xms;
- return 'http://support.dell.com/support/edocs/systems/pe' . $model . '/';
+ if (exists $country{$opt{htmlinfo}}) {
+ return sprintf 'http://www.dell.com/support/troubleshooting/%s/%s/19/Product/%s#ui-tabs-4',
+ $country{$opt{htmlinfo}}->{c}, $country{$opt{htmlinfo}}->{l}, $model;
+ }
+ else {
+ return sprintf 'http://www.dell.com/support/troubleshooting/us/en/19/Product/%s#ui-tabs-4',
+ $model;
+ }
+ return;
}
# Return the URL for warranty information for a server with a given
@@ -1438,41 +1490,6 @@
my $url_start = 'http://www.dell.com/support/troubleshooting';
my $url_end = 'Index?t=warranty&servicetag';
- my %country
- = (
- # EMEA
- at => { c => 'at', l => 'de' }, # Austria
- be => { c => 'be', l => 'nl' }, # Belgium
- cz => { c => 'cz', l => 'cs' }, # Czech Republic
- de => { c => 'de', l => 'de' }, # Germany
- dk => { c => 'dk', l => 'da' }, # Denmark
- es => { c => 'es', l => 'es' }, # Spain
- fi => { c => 'fi', l => 'fi' }, # Finland
- fr => { c => 'fr', l => 'fr' }, # France
- gr => { c => 'gr', l => 'el' }, # Greece
- it => { c => 'it', l => 'it' }, # Italy
- il => { c => 'il', l => 'en' }, # Israel
- me => { c => 'me', l => 'en' }, # Middle East
- no => { c => 'no', l => 'no' }, # Norway
- nl => { c => 'nl', l => 'nl' }, # The Netherlands
- pl => { c => 'pl', l => 'pl' }, # Poland
- pt => { c => 'pt', l => 'pt' }, # Portugal
- ru => { c => 'ru', l => 'ru' }, # Russia
- se => { c => 'se', l => 'sv' }, # Sweden
- uk => { c => 'uk', l => 'en' }, # United Kingdom
- za => { c => 'za', l => 'en' }, # South Africa
- # America
- br => { c => 'br', l => 'pt' }, # Brazil
- ca => { c => 'ca', l => 'en' }, # Canada
- mx => { c => 'mx', l => 'es' }, # Mexico
- us => { c => 'us', l => 'en' }, # USA
- # Asia/Pacific
- au => { c => 'au', l => 'en' }, # Australia
- cn => { c => 'cn', l => 'zh' }, # China
- in => { c => 'in', l => 'en' }, # India
- jp => { c => 'jp', l => 'ja' }, # Japan
- );
-
if (exists $country{$opt{htmlinfo}}) {
return sprintf '%s/%s/%s/nodhs1/%s=%s',
$url_start, $country{$opt{htmlinfo}}->{c},
@@ -2164,13 +2181,18 @@
if ($state eq 'Regenerating') {
my $msg = sprintf q{Logical Drive '%s' [%s, %s] is %s%s},
$dev, $layout, $size, $state, $progr;
- report('storage', $msg, $E_WARNING, $nexus);
+ my $lvl = $opt{vdisk_critical} ? $E_CRITICAL : $E_WARNING;
+ report('storage', $msg, $lvl, $nexus);
}
# Default
else {
my $msg = sprintf q{Logical Drive '%s' [%s, %s] is %s},
$dev, $layout, $size, $state;
- report('storage', $msg, $status2nagios{$status}, $nexus);
+ my $lvl = $status2nagios{$status};
+ if ($opt{vdisk_critical} && $lvl != $E_OK) {
+ $lvl = $E_CRITICAL;
+ }
+ report('storage', $msg, $lvl, $nexus);
}
}
return;
@@ -5243,6 +5265,7 @@
'esmlog' => "OK - ESM Log content: $count{esm}{Ok} ok, $count{esm}{'Non-Critical'} warning and $count{esm}{Critical} critical",
'esmhealth' => "ESM LOG OK - less than 80% used",
'sdcard' => "SD CARDS OK - $count{sd} SD cards installed",
+ 'servicetag' => sprintf 'ServiceTag OK: %s', $opt{hide_servicetag} ? 'XXXXXXX' : $sysinfo{serial},
);
print $okmsg{$opt{only}};
@@ -5260,12 +5283,12 @@
elsif ($exit_code == $E_OK && !$opt{debug}) {
if (defined $opt{htmlinfo} and !$opt{hide_servicetag}) {
printf q{OK - System: '<a target="_blank" href="%s">%s%s</a>', SN: '<a target="_blank" href="%s">%s</a>'},
- documentation_url($sysinfo{model}), $sysinfo{model}, $sysinfo{rev},
+ documentation_url($sysinfo{model},$sysinfo{rev}), $sysinfo{model}, $sysinfo{rev},
warranty_url($sysinfo{serial}), $sysinfo{serial};
}
elsif (defined $opt{htmlinfo} and $opt{hide_servicetag}) {
printf q{OK - System: '<a target="_blank" href="%s">%s%s</a>', SN: '%s'},
- documentation_url($sysinfo{model}), $sysinfo{model}, $sysinfo{rev},
+ documentation_url($sysinfo{model},$sysinfo{rev}), $sysinfo{model}, $sysinfo{rev},
$sysinfo{serial};
}
else {
|