Changes of Revision 21
[-] | Changed | check_openmanage.spec |
x 1
2 Summary: A Nagios plugin to check hardware health on Dell servers 3 Name: check_openmanage 4 -Version: 3.6.3 5 +Version: 3.6.5 6 Release: 1%{?dist} 7 License: GPL 8 Group: Applications/System 9 BuildRoot: %{_tmppath}/%{name}-%{version}-root 10 URL: http://folk.uio.no/trondham/software/check_openmanage.html 11 -Source0: http://folk.uio.no/trondham/software/%{name}-%{version}.tar.gz 12 +Source0: http://folk.uio.no/trondham/software/%{name}-%{version}.tar.bz2 13 Requires: perl 14 15 %description 16
17 %attr(0755, root, root) %{_mandir}/man8/%{name}.8* 18 19 %changelog 20 +* Wed Feb 09 2011 Carsten Schoene <cs@linux-administrator.com> - 3.6.5-1 21 +- update to version 3.6.5 22 + - Fix counting of components when blacklisting is used. Components should be counted even if blacklisted 23 + - Added some unsupported vdisk types to the list. The OMSA MIB identifies these, but lists them as unsupported 24 + - Added option '-B' or '--show-blacklist' to show any blacklistings in the OK output 25 + - Fixed a bug for checking voltage probes, if the reading is missing via SNMP 26 + - Fixed a regression bug for a power monitoring corner case 27 + 28 * Mon Dec 13 2010 Carsten Schoene <cs@linux-administrator.com> - 3.6.3-1 29 - update to version 3.6.3 30 - A few compatibility fixes for OMSA 6.4.0 were added 31 |
||
[+] | Deleted | check_openmanage-3.6.0.tar.gz/check_openmanage.spec ^ |
@@ -1,159 +0,0 @@ -Summary: Nagios plugin to monitor hardware health on Dell servers -Name: check_openmanage -Version: 3.6.0 -Release: 1%{?dist} -License: GPL -Packager: Trond Hasle Amundsen <t.h.amundsen@usit.uio.no> -Group: Applications/System -BuildRoot: %{_tmppath}/%{name}-%{version}-root -URL: http://folk.uio.no/trondham/software/%{name}.html -Source0: http://folk.uio.no/trondham/software/files/%{name}-%{version}.tar.gz -BuildRequires: perl - -Requires: perl >= 5.6.0 -Requires: perl(POSIX) -Requires: perl(Getopt::Long) - -%description -check_openmanage is a plugin for Nagios which checks the hardware -health of Dell servers running OpenManage Server Administrator -(OMSA). The plugin can be used remotely with SNMP or locally with -NRPE, check_by_ssh or similar, whichever suits your needs and -particular taste. The plugin checks the health of the storage -subsystem, power supplies, memory modules, temperature probes etc., -and gives an alert if any of the components are faulty or operate -outside normal parameters. - -%prep -%setup -q - -%build -pod2man -s 8 -r "%{name} %{version}" -c "Nagios plugin" %{name}.pod %{name}.8 -gzip %{name}.8 - -%install -mkdir -p %{buildroot}/%{_libdir}/nagios/plugins -mkdir -p %{buildroot}/%{_mandir}/man8 -install -p -m 0755 %{name} %{buildroot}/%{_libdir}/nagios/plugins -install -m 0644 %{name}.8.gz %{buildroot}/%{_mandir}/man8 - -%clean -rm -rf %{buildroot} - -%files -%defattr(-, root, root, -) -%doc README COPYING CHANGES -%{_libdir}/nagios/plugins/%{name} -%attr(0755, root, root) %{_mandir}/man8/%{name}.8.gz - - -%changelog -* Mon Aug 30 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.6.0-1 -- Version 3.6.0 - -* Wed Jul 14 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.10-1 -- Version 3.5.10 - -* Tue Jun 29 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.9-1 -- Version 3.5.9 - -* Thu Jun 17 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.8-1 -- Version 3.5.8 - -* Wed Mar 19 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.7-1 -- Version 3.5.7 - -* Tue Feb 23 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.6-1 -- Version 3.5.6 - -* Fri Jan 22 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.5-1 -- Version 3.5.5 - -* Wed Jan 13 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.4-1 -- Version 3.5.4 - -* Thu Dec 17 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.3-1 -- Version 3.5.3 - -* Tue Nov 17 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.2-1 -- Version 3.5.2 - -* Thu Oct 22 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.1-1 -- Version 3.5.1 - -* Tue Oct 13 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.0-1 -- Version 3.5.0 -- New location for the manual page (section 3 -> 8) - -* Fri Aug 7 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.9-1 -- Version 3.4.9 - -* Fri Jul 31 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.8-1 -- Version 3.4.8 - -* Fri Jul 24 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.7-1 -- Version 3.4.7 - -* Tue Jul 7 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.6-1 -- Version 3.4.6 - -* Mon Jun 22 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.5-1 -- Version 3.4.5 - -* Mon Jun 22 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.4-1 -- Version 3.4.4 - -* Thu Jun 11 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.3-1 -- Version 3.4.3 - -* Wed Jun 3 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.2-1 -- Version 3.4.2 - -* Mon May 27 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.1-1 -- Version 3.4.1 - -* Mon May 25 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.0-1 -- Version 3.4.0 - -* Tue May 5 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.3.2-1 -- Version 3.3.2 - -* Tue Apr 28 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.3.1-1 -- Version 3.3.1 - -* Tue Apr 7 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.3.0-1 -- Version 3.3.0 - -* Sun Mar 29 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.7-1 -- Version 3.2.7 - -* Thu Mar 5 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.6-1 -- Version 3.2.6 - -* Tue Feb 24 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.5-1 -- Version 3.2.5 -- take 64bit (other libdir) into consideration - -* Tue Feb 17 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.4-1 -- Version 3.2.4 - -* Mon Feb 9 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.3-1 -- Version 3.2.3 - -* Tue Feb 3 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.2-1 -- Version 3.2.2 - -* Tue Feb 3 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.1-1 -- Version 3.2.1 - -* Tue Jan 27 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.0-1 -- Version 3.2.0 - -* Sat Dec 20 2008 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.0.2-1 -- Version 3.0.2 - -* Thu Dec 4 2008 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.0.0-1 -- Version 3.0.0 - -* Wed Nov 19 2008 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 2.1.0-0 -- first RPM release | ||
Deleted | check_openmanage-3.6.1.tar.gz ^ | |
Deleted | check_openmanage-3.6.2.tar.gz ^ | |
Deleted | check_openmanage-3.6.3.tar.gz ^ | |
[+] | Changed | check_openmanage-3.6.5.tar.bz2/CHANGES ^ |
@@ -1,3 +1,67 @@ +3.6.5 2011-02-09 +------------------ + +* Fix counting of components when blacklisting is used. Components + should be counted even if blacklisted +* Added some unsupported vdisk types to the list. The OMSA MIB + identifies these, but lists them as unsupported. +* Added option '-B' or '--show-blacklist' to show any blacklistings in + the OK output +* Fixed a bug for checking voltage probes, if the reading is missing + via SNMP. +* Fixed a regression bug for a power monitoring corner case. + +3.6.4 2011-01-04 +------------------ + +* Added more robustness wrt. values from OMSA obtained via SNMP, to + avoid internal errors where non-important values are missing. + +3.6.3 2010-12-13 +------------------ + +* A few compatibility fixes for OMSA 6.4.0 were added. + +3.6.2 2010-11-25 +------------------ + +* Added support for IPv6 when checking via SNMP. IPv6 can be turned on + with the option '-6' or '--ipv6'. The default is IPv4 if the option + is not present. +* Added support for TCP when checking vis SNMP. The option '--tcp' can + be used to turn on TCP. The default transport protocol is UDP if the + option is not present. +* The mode of operation (local or SNMP) is shown in the debug + output. If SNMP is used, the debug output will also show the SNMP + protocol version, IP version and transport protocol (UDP or TCP). +* Amperage probe status via SNMP is of type "probe status", not + regular status. This has been fixed. +* Massive overall robustness improvements to handle OMSA bugs where + some information from OMSA is missing. +* Memory module enumeration via SNMP changed somewhat to reflect + enumeration provided by omreport. This ensures that the plugin's + output is identical in SNMP or local mode wrt. dimms IDs. +* Fan enumeration via SNMP changed somewhat to reflect enumeration + provided by omreport. This ensures that the plugin's output is + identical in SNMP or local mode wrt. fan IDs. + +3.6.1 2010-11-02 +------------------ + +* Included new check for SD cards. Newer servers such as the R710 can + have SD cards installed, these should be monitored. The SD card + check is on by default. A new blacklisting keyword 'sd' has been + added. The SD card check can be turned off with '--check sdcard=0'. +* Handle special cases where power monitoring capability is disabled + due to non-redundant and/or non-instrumented power supplies. +* For physical disks probed via SNMP, check that values for vendor, + product ID and capacity is available before attempting to display + those values. +* If a physical disk is in sufficiently bad condition, the vendor + field reported by OMSA may be empty. The plugin now handles this + situation without throwing an internal error. + + 3.6.0 2010-08-30 ------------------ | ||
[+] | Changed | check_openmanage-3.6.5.tar.bz2/README ^ |
@@ -1,23 +1,24 @@ +================================ README file for check_openmanage ================================ Files included in the tarball and zip archive: - check_openmanage - The plugin - check_openmanage.exe - Win32 standalone executable - check_openmanage.8 - Man page - check_openmanage.pod - Man page source - check_openmanage.php - PNP4Nagios template - check_openmanage.spec - RPM spec file - COPYING - License information - INSTALL - Install HOWTO - install.bat - Windows install script - install.sh - Linux/UNIX install script - README - This file + check_openmanage - The plugin + check_openmanage.exe - Win32 standalone executable + check_openmanage.8 - Man page + check_openmanage.pod - Man page source + check_openmanage.php - PNP4Nagios template + nagios-plugins-check-openmanage.spec - RPM spec file + COPYING - License information + INSTALL - Install HOWTO + install.bat - Windows install script + install.sh - Linux/UNIX install script + README - This file About this program ------------------- +================== check_openmanage is a plugin for Nagios which checks the hardware health of Dell PowerEdge and some PowerVault servers. It uses the Dell @@ -57,6 +58,7 @@ * Voltage probes * Power usage * Chassis intrusion +* Removable flash media (SD cards) Other: @@ -80,4 +82,3 @@ More information avilable online: http://folk.uio.no/trondham/software/check_openmanage.html - | ||
[+] | Changed | check_openmanage-3.6.5.tar.bz2/check_openmanage ^ |
@@ -5,9 +5,9 @@ # Monitor Dell server hardware status using Dell OpenManage Server # Administrator, either locally via NRPE, or remotely via SNMP. # -# $Id: check_openmanage 18205 2010-08-30 11:25:09Z trondham $ +# $Id: check_openmanage 19355 2011-02-09 13:50:00Z trondham $ # -# Copyright (C) 2010 Trond H. Amundsen +# Copyright (C) 2008-2011 Trond H. Amundsen # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -51,7 +51,7 @@ # Version and similar info $NAME = 'check_openmanage'; -$VERSION = '3.6.0'; +$VERSION = '3.6.5'; $AUTHOR = 'Trond H. Amundsen'; $CONTACT = 't.h.amundsen@usit.uio.no'; @@ -74,37 +74,40 @@ GENERAL OPTIONS: - -p, --perfdata Output performance data [no] - -t, --timeout Plugin timeout in seconds [30] - -c, --critical Customise temperature critical limits - -w, --warning Customise temperature warning limits - -d, --debug Debug output, reports everything - -h, --help Display this help text - -V, --version Display version info + -p, --perfdata Output performance data [default=no] + -t, --timeout Plugin timeout in seconds [default=30] + -c, --critical Custom temperature critical limits + -w, --warning Custom temperature warning limits + -d, --debug Debug output, reports everything + -h, --help Display this help text + -V, --version Display version info SNMP OPTIONS: - -H, --hostname Hostname or IP (required for SNMP) - -C, --community SNMP community string [public] - -P, --protocol SNMP protocol version [2] - --port SNMP port number [161] + -H, --hostname Hostname or IP (required for SNMP) + -C, --community SNMP community string [default=public] + -P, --protocol SNMP protocol version [default=2] + --port SNMP port number [default=161] + -6, --ipv6 Use IPv6 instead of IPv4 [default=no] + --tcp Use TCP instead of UDP [default=no] OUTPUT OPTIONS: - -i, --info Prefix any alerts with the service tag - -e, --extinfo Append system info to alerts - -s, --state Prefix alerts with alert state - -S, --short-state Prefix alerts with alert state (abbreviated) - -o, --okinfo Verbosity when check result is OK - -I, --htmlinfo HTML output with clickable links + -i, --info Prefix any alerts with the service tag + -e, --extinfo Append system info to alerts + -s, --state Prefix alerts with alert state + -S, --short-state Prefix alerts with alert state abbreviated + -o, --ok-info Verbosity when check result is OK + -B, --show-blacklist Show blacklistings in OK output + -I, --htmlinfo HTML output with clickable links CHECK CONTROL AND BLACKLISTING: - -a, --all Check everything, even log content - -b, --blacklist Blacklist missing and/or failed components - --only Only check a certain component or alert type - --check Fine-tune which components are checked - --no-storage Don't check storage (short for '--check storage=0') + -a, --all Check everything, even log content + -b, --blacklist Blacklist missing and/or failed components + --only Only check a certain component or alert type + --check Fine-tune which components are checked + --no-storage Don't check storage For more information and advanced options, see the manual page or URL: http://folk.uio.no/trondham/software/check_openmanage.html @@ -113,7 +116,7 @@ # Version and license text $LICENSE = <<"END_LICENSE"; $NAME $VERSION -Copyright (C) 2010 $AUTHOR +Copyright (C) 2008-2011 $AUTHOR License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. @@ -137,6 +140,7 @@ 'state' => 0, # display alert type 'short-state' => 0, # display alert type (short) 'okinfo' => 0, # default "ok" output level + 'show_blacklist' => 0, # show blacklisted components 'linebreak' => undef, # specify linebreak 'version' => 0, # plugin version info 'all' => 0, # check everything @@ -147,6 +151,8 @@ 'hostname' => undef, # hostname or IP 'community' => 'public', # SMNP v1 or v2c 'protocol' => 2, # default SNMP protocol 2c + 'ipv6' => 0, # default is IPv4 + 'tcp' => 0, # default is UDP 'username' => undef, # SMNP v3 'authpassword' => undef, # SMNP v3 'authkey' => undef, # SMNP v3 @@ -174,6 +180,7 @@ 's|state' => \$opt{state}, 'S|short-state' => \$opt{shortstate}, 'o|ok-info=i' => \$opt{okinfo}, + 'B|show-blacklist' => \$opt{show_blacklist}, 'linebreak=s' => \$opt{linebreak}, 'a|all' => \$opt{all}, 'only=s' => \$opt{only}, @@ -183,6 +190,8 @@ 'H|hostname=s' => \$opt{hostname}, 'C|community=s' => \$opt{community}, 'P|protocol=i' => \$opt{protocol}, + '6|ipv6' => \$opt{ipv6}, + 'tcp' => \$opt{tcp}, 'U|username=s' => \$opt{username}, 'authpassword=s' => \$opt{authpassword}, 'authkey=s' => \$opt{authkey}, @@ -223,19 +232,20 @@ $omreport = undef; # Check flags, override available with the --check option -%check = ( 'storage' => 1, # check storage subsystem - 'memory' => 1, # check memory (dimms) - 'fans' => 1, # check fan status - 'power' => 1, # check power supplies - 'temp' => 1, # check temperature - 'cpu' => 1, # check processors - 'voltage' => 1, # check voltage - 'batteries' => 1, # check battery probes - 'amperage' => 1, # check power consumption - 'intrusion' => 1, # check intrusion detection - 'alertlog' => 0, # check the alert log - 'esmlog' => 0, # check the ESM log (hardware log) - 'esmhealth' => 1, # check the ESM log overall health +%check = ( 'storage' => 1, # check storage subsystem + 'memory' => 1, # check memory (dimms) + 'fans' => 1, # check fan status + 'power' => 1, # check power supplies + 'temp' => 1, # check temperature + 'cpu' => 1, # check processors + 'voltage' => 1, # check voltage + 'batteries' => 1, # check battery probes + 'amperage' => 1, # check power consumption + 'intrusion' => 1, # check intrusion detection + 'sdcard' => 1, # check removable flash media (SD cards) + 'alertlog' => 0, # check the alert log + 'esmlog' => 0, # check the ESM log (hardware log) + 'esmhealth' => 1, # check the ESM log overall health ); # Default line break @@ -261,9 +271,9 @@ } # List of controllers and enclosures -@controllers = (); # controllers -@enclosures = (); # enclosures -%snmp_enclosure = (); # enclosures +@controllers = (); # controllers +@enclosures = (); # enclosures +%snmp_enclosure = (); # enclosures # Messages @report_storage = (); # messages with associated nagios level (storage) @@ -273,36 +283,37 @@ # Counters for everything %count = ( - 'pdisk' => 0, # number of physical disks - 'vdisk' => 0, # number of logical drives (virtual disks) - 'temp' => 0, # number of temperature probes - 'volt' => 0, # number of voltage probes - 'amp' => 0, # number of amperage probes - 'intr' => 0, # number of intrusion probes - 'dimm' => 0, # number of memory modules - 'mem' => 0, # total memory - 'fan' => 0, # number of fan probes - 'cpu' => 0, # number of CPUs - 'bat' => 0, # number of batteries - 'power' => 0, # number of power supplies - 'esm' => { - 'Critical' => 0, # critical entries in ESM log - 'Non-Critical' => 0, # warning entries in ESM log - 'Ok' => 0, # ok entries in ESM log - }, - 'alert' => { - 'Critical' => 0, # critical entries in alert log - 'Non-Critical' => 0, # warning entries in alert log - 'Ok' => 0, # ok entries in alert log - }, + 'pdisk' => 0, # number of physical disks + 'vdisk' => 0, # number of logical drives (virtual disks) + 'temp' => 0, # number of temperature probes + 'volt' => 0, # number of voltage probes + 'amp' => 0, # number of amperage probes + 'intr' => 0, # number of intrusion probes + 'dimm' => 0, # number of memory modules + 'mem' => 0, # total memory + 'fan' => 0, # number of fan probes + 'cpu' => 0, # number of CPUs + 'bat' => 0, # number of batteries + 'power' => 0, # number of power supplies + 'sd' => 0, # number of SD cards + 'esm' => { + 'Critical' => 0, # critical entries in ESM log + 'Non-Critical' => 0, # warning entries in ESM log + 'Ok' => 0, # ok entries in ESM log + }, + 'alert' => { + 'Critical' => 0, # critical entries in alert log + 'Non-Critical' => 0, # warning entries in alert log + 'Ok' => 0, # ok entries in alert log + }, ); # Performance data @perfdata = (); # Global health status -$global = 1; # default is to check global status -$globalstatus = $E_OK; # default global health status is "OK" +$global = 1; # default is to check global status +$globalstatus = $E_OK; # default global health status is "OK" # Nagios error levels reversed %reverse_exitcode @@ -486,6 +497,11 @@ '-version' => $opt{protocol}, ); + # Setting the domain (IP version and transport protocol) + my $transport = $opt{tcp} ? 'tcp' : 'udp'; + my $ipversion = $opt{ipv6} ? 'ipv6' : 'ipv4'; + $param{'-domain'} = "$transport/$ipversion"; + # Parameters for SNMP v3 if ($opt{protocol} == 3) { @@ -830,10 +846,13 @@ = qr{ Intrusion\sinformation\sis\snot\sfound\sfor\sthis\ssystem # No intrusion probe | No\sinstrumented\spower\ssupplies\sfound\son\sthis\ssystem # No instrumented PS (blades/low-end) -# | No\scontrollers\sfound # No RAID controller | No\sbattery\sprobes\sfound\son\sthis\ssystem # No battery probes | Invalid\scommand:\spwrmonitoring # Old hardware + | Hardware\sor\sfeature\snot\spresent\. # SD cards + | Invalid\scommand:\sremovableflashmedia # SD cards with old OMSA + | Error\sCorrection; # Memory stuff. Not really an error (new in OMSA 6.4) # | Current\sprobes\snot\sfound # OMSA + RHEL5.4 bug +# | No\scontrollers\sfound # No RAID controller }xms; # Errors that are OK on blade servers @@ -868,7 +887,7 @@ next if !m/(.*?;){2}/xms; # ignore lines with less than 3 fields my @vals = split /;/xms; - if ($vals[0] =~ m/\A (Index|ID|Severity|Processor|Current\sSpeed) \z/xms) { + if ($vals[0] =~ m/\A (Index|ID|Severity|Processor|Current\sSpeed|Connector\sName) \z/xms) { @keys = @vals; } else { @@ -882,7 +901,6 @@ return \@output; } - # # Checks if a component is blacklisted. Returns 1 if the component is # blacklisted, 0 otherwise. Takes two arguments: @@ -1077,9 +1095,32 @@ sub get_hashval { my $key = shift || return undef; my $hash = shift; - return exists $hash->{$key} ? $hash->{$key} : "Undefined value $key"; + return defined $hash->{$key} ? $hash->{$key} : "Undefined value $key"; +} + +# Find component status from hash +sub get_snmp_status { + my $key = shift || return 'Unknown'; + return exists $snmp_status{$key} ? $snmp_status{$key} : 'Unknown'; +} + +# Find component status from hash +sub get_snmp_probestatus { + my $key = shift || return 'Unknown'; + return exists $snmp_probestatus{$key} ? $snmp_probestatus{$key} : 'Unknown'; } +# Check that a hash entry is defined and not an empty string. Return a +# chosen string (parameter) if these conditions are not met +sub get_nonempty_string { + my $key = shift; # key to check + my $hash = shift; # hash where the key belongs + my $alt = shift; # alternate return value + if (defined $hash->{$key} and $hash->{$key} ne q{}) { + return $hash->{$key}; + } + return $alt; +} #--------------------------------------------------------------------- @@ -1102,7 +1143,7 @@ printf "SNMP ERROR [global]: %s\n", $snmp_error; exit $E_UNKNOWN; } - $health = $status2nagios{$snmp_status{$result->{$systemStateGlobalSystemStatus}}}; + $health = $status2nagios{get_snmp_status($result->{$systemStateGlobalSystemStatus})}; } else { # @@ -1127,9 +1168,6 @@ # STORAGE: Check controllers #----------------------------------------- sub check_controllers { - return if blacklisted('ctrl', 'all'); - - my $id = undef; my $nexus = undef; my $name = undef; my $state = undef; @@ -1188,29 +1226,22 @@ CTRL: foreach my $out (@output) { if ($snmp) { - $name = $out->{controllerName}; - $state = get_hashval($out->{controllerState}, \%ctrl_state); - $status = $snmp_status{$out->{controllerComponentStatus}}; - $minfw = exists $out->{controllerMinFWVersion} - ? $out->{controllerMinFWVersion} : undef; - $mindr = exists $out->{controllerMinDriverVersion} - ? $out->{controllerMinDriverVersion} : undef; - $firmware = exists $out->{controllerFWVersion} - ? $out->{controllerFWVersion} : 'N/A'; - $driver = exists $out->{controllerDriverVersion} - ? $out->{controllerDriverVersion} : 'N/A'; - $minstdr = exists $out->{'controllerMinRequiredStorportVer'} - ? $out->{controllerMinRequiredStorportVer} : undef; - $stdr = exists $out->{controllerStorportDriverVersion} - ? $out->{controllerStorportDriverVersion} : undef; - $nexus = convert_nexus($out->{controllerNexusID}); - $id = $nexus; - } - else { - $id = $out->{ID}; - $name = $out->{Name}; - $state = $out->{State}; - $status = $out->{Status}; + $name = $out->{controllerName} || 'Unknown controller'; + $state = get_hashval($out->{controllerState}, \%ctrl_state) || 'Unknown state'; + $status = get_snmp_status($out->{controllerComponentStatus}); + $minfw = $out->{controllerMinFWVersion} || undef; + $mindr = $out->{controllerMinDriverVersion} || undef; + $firmware = $out->{controllerFWVersion} || 'N/A'; + $driver = $out->{controllerDriverVersion} || 'N/A'; + $minstdr = $out->{'controllerMinRequiredStorportVer'} || undef; + $stdr = $out->{controllerStorportDriverVersion} || undef; + $nexus = convert_nexus(($out->{controllerNexusID} || 9999)); + } + else { + $nexus = get_nonempty_string('ID', $out, '9999'); + $name = get_nonempty_string('Name', $out, 'Unknown controller'); + $state = get_nonempty_string('State', $out, 'Unknown state'); + $status = get_nonempty_string('Status', $out, 'Unknown'); $minfw = $out->{'Minimum Required Firmware Version'} ne 'Not Applicable' ? $out->{'Minimum Required Firmware Version'} : undef; $mindr = $out->{'Minimum Required Driver Version'} ne 'Not Applicable' @@ -1225,18 +1256,17 @@ $stdr = (exists $out->{'Storport Driver Version'} and $out->{'Storport Driver Version'} ne 'Not Applicable') ? $out->{'Storport Driver Version'} : undef; - $nexus = $id; } $name =~ s{\s+\z}{}xms; # remove trailing whitespace - push @controllers, $id; + push @controllers, $nexus; # Collecting some storage info - $sysinfo{'controller'}{$id}{'id'} = $nexus; - $sysinfo{'controller'}{$id}{'name'} = $name; - $sysinfo{'controller'}{$id}{'driver'} = $driver; - $sysinfo{'controller'}{$id}{'firmware'} = $firmware; - $sysinfo{'controller'}{$id}{'storport'} = $stdr; + $sysinfo{'controller'}{$nexus}{'id'} = $nexus; + $sysinfo{'controller'}{$nexus}{'name'} = $name; + $sysinfo{'controller'}{$nexus}{'driver'} = $driver; + $sysinfo{'controller'}{$nexus}{'firmware'} = $firmware; + $sysinfo{'controller'}{$nexus}{'storport'} = $stdr; # Store controller info for future use (SNMP) if ($snmp) { @@ -1246,37 +1276,37 @@ next CTRL if blacklisted('ctrl', $nexus); # Special case: old firmware - if (!blacklisted('ctrl_fw', $id) && defined $minfw) { + if (!blacklisted('ctrl_fw', $nexus) && defined $minfw) { chomp $firmware; my $msg = sprintf q{Controller %d [%s]: Firmware '%s' is out of date}, - $id, $name, $firmware; + $nexus, $name, $firmware; report('storage', $msg, $E_WARNING, $nexus); } # Special case: old driver - if (!blacklisted('ctrl_driver', $id) && defined $mindr) { + if (!blacklisted('ctrl_driver', $nexus) && defined $mindr) { chomp $driver; my $msg = sprintf q{Controller %d [%s]: Driver '%s' is out of date}, - $id, $name, $driver; + $nexus, $name, $driver; report('storage', $msg, $E_WARNING, $nexus); } # Special case: old storport driver - if (!blacklisted('ctrl_stdr', $id) && defined $minstdr) { + if (!blacklisted('ctrl_stdr', $nexus) && defined $minstdr) { chomp $stdr; my $msg = sprintf q{Controller %d [%s]: Storport driver '%s' is out of date}, - $id, $name, $stdr; + $nexus, $name, $stdr; report('storage', $msg, $E_WARNING, $nexus); } # Ok if ($status eq 'Ok' or ($status eq 'Non-Critical' and (defined $minfw or defined $mindr or defined $minstdr))) { my $msg = sprintf 'Controller %d [%s] is %s', - $id, $name, $state; + $nexus, $name, $state; report('storage', $msg, $E_OK, $nexus); } # Default else { my $msg = sprintf 'Controller %d [%s] needs attention: %s', - $id, $name, $state; + $nexus, $name, $state; report('storage', $msg, $status2nagios{$status}, $nexus); } } @@ -1289,9 +1319,7 @@ #----------------------------------------- sub check_physical_disks { return if $#controllers == -1; - return if blacklisted('pdisk', 'all'); - my $id = undef; my $nexus = undef; my $name = undef; my $state = undef; @@ -1310,7 +1338,6 @@ if ($snmp) { my %pdisk_oid = ( - '1.3.6.1.4.1.674.10893.1.20.130.4.1.1' => 'arrayDiskNumber', '1.3.6.1.4.1.674.10893.1.20.130.4.1.2' => 'arrayDiskName', '1.3.6.1.4.1.674.10893.1.20.130.4.1.3' => 'arrayDiskVendor', '1.3.6.1.4.1.674.10893.1.20.130.4.1.4' => 'arrayDiskState', @@ -1422,28 +1449,20 @@ PDISK: foreach my $out (@output) { if ($snmp) { - $name = $out->{arrayDiskName}; - if (exists $out->{arrayDiskEnclosureID}) { - $id = join q{:}, ($out->{arrayDiskChannel}, $out->{arrayDiskEnclosureID}, - $out->{arrayDiskTargetID}); - } - else { - $id = join q{:}, ($out->{arrayDiskChannel}, $out->{arrayDiskTargetID}); - } - $state = get_hashval($out->{arrayDiskState}, \%pdisk_state); - $status = $snmp_status{$out->{arrayDiskComponentStatus}}; - $fpred = exists $out->{arrayDiskSmartAlertIndication} + $name = $out->{arrayDiskName} || 'Unknown disk'; + $state = get_hashval($out->{arrayDiskState}, \%pdisk_state) || 'Unknown state'; + $status = get_snmp_status($out->{arrayDiskComponentStatus}); + $fpred = defined $out->{arrayDiskSmartAlertIndication} && $out->{arrayDiskSmartAlertIndication} == 2 ? 1 : 0; $progr = q{}; - $nexus = convert_nexus($out->{arrayDiskNexusID}); - $vendor = $out->{arrayDiskVendor}; - $product = $out->{arrayDiskProductID}; - $spare = get_hashval($out->{arrayDiskSpareState}, \%spare_state); - $bus = exists $out->{arrayDiskBusType} - ? get_hashval($out->{arrayDiskBusType}, \%bus_type) : undef; - $media = exists $out->{arrayDiskMediaType} - ? get_hashval($out->{arrayDiskMediaType}, \%media_type) : undef; - $capacity = $out->{arrayDiskLengthInMB} * 1024**2; + $nexus = convert_nexus(($out->{arrayDiskNexusID} || 9999)); + $vendor = $out->{arrayDiskVendor} || 'Unknown vendor'; + $product = $out->{arrayDiskProductID} || 'Unknown product ID'; + $spare = get_hashval($out->{arrayDiskSpareState}, \%spare_state) || q{}; + $bus = get_hashval($out->{arrayDiskBusType}, \%bus_type); + $media = get_hashval($out->{arrayDiskMediaType}, \%media_type); + $capacity = exists $out->{arrayDiskLengthInMB} + ? $out->{arrayDiskLengthInMB} * 1024**2 : -1; # try to find the controller where the disk belongs if (exists $out->{arrayDiskEnclosureConnectionControllerNumber}) { @@ -1461,42 +1480,53 @@ } } else { - $id = $out->{'ID'}; - $name = $out->{'Name'}; - $state = $out->{'State'}; - $status = $out->{'Status'}; - $fpred = lc($out->{'Failure Predicted'}) eq 'yes' ? 1 : 0; - $progr = ' [' . $out->{'Progress'} . ']'; - $ctrl = $out->{'ctrl'}; - $nexus = join q{:}, $out->{ctrl}, $id; - $vendor = $out->{'Vendor ID'}; - $product = $out->{'Product ID'}; - $media = $out->{'Media'}; - $spare = $out->{'Hot Spare'}; - $bus = $out->{'Bus Protocol'}; - $capacity = $out->{'Capacity'}; + $name = get_nonempty_string('Name', $out, 'Unknown disk'); + $state = get_nonempty_string('State', $out, 'Unknown state'); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $fpred = lc(get_nonempty_string('Failure Predicted', $out, q{})) eq 'yes' ? 1 : 0; + $progr = ' [' . get_nonempty_string('Progress', $out, q{}) . ']'; + $nexus = join q{:}, $out->{ctrl}, $out->{'ID'}; + $vendor = get_nonempty_string('Vendor ID', $out, 'Unknown Vendor'); + $product = get_nonempty_string('Product ID', $out, 'Unknown Product ID'); + $media = get_nonempty_string('Media', $out, undef); + $bus = get_nonempty_string('Bus Protocol', $out, undef); + $spare = get_nonempty_string('Hot Spare', $out, q{}); + $ctrl = $out->{ctrl}; + $capacity = get_nonempty_string('Capacity', $out, q{}); $capacity =~ s{\A .*? \((\d+) \s bytes\) \z}{$1}xms; + if ($capacity eq 'Unavailable') { + $capacity = -1; + } } - next PDISK if blacklisted('pdisk', $nexus); $count{pdisk}++; + next PDISK if blacklisted('pdisk', $nexus); $vendor =~ s{\s+\z}{}xms; # remove trailing whitespace $product =~ s{\s+\z}{}xms; # remove trailing whitespace + # If the disk is bad, the vendor field may be empty + if ($vendor eq q{}) { $vendor = 'Unknown Vendor'; } + # Hot spare stuff if ($spare eq 'Global') { $spare = 'Global HS'; } elsif ($spare eq 'Dedicated') { $spare = 'Dedicated HS'; } elsif ($spare !~ m{\A Global|Dedicated}xms) { $spare = undef; } # Calculate human readable capacity - $capacity = ceil($capacity / 1000**3) >= 1000 - ? sprintf '%.1fTB', ($capacity / 1000**4) - : sprintf '%.0fGB', ($capacity / 1000**3); - $capacity = '450GB' if $capacity eq '449GB'; # quick fix for 450GB disks - $capacity = '300GB' if $capacity eq '299GB'; # quick fix for 300GB disks - $capacity = '146GB' if $capacity eq '147GB'; # quick fix for 146GB disks - $capacity = '100GB' if $capacity eq '99GB'; # quick fix for 100GB disks + if ($capacity == -1) { + # capacity is unknown + $capacity = 'Unknown Size'; + } + else { + $capacity = ceil($capacity / 1000**3) >= 1000 + ? sprintf '%.1fTB', ($capacity / 1000**4) + : sprintf '%.0fGB', ($capacity / 1000**3); + $capacity = '450GB' if $capacity eq '449GB'; # quick fix for 450GB disks + $capacity = '300GB' if $capacity eq '299GB'; # quick fix for 300GB disks + $capacity = '146GB' if $capacity eq '147GB'; # quick fix for 146GB disks + $capacity = '100GB' if $capacity eq '99GB'; # quick fix for 100GB disks + } # Capitalize only the first letter of the vendor name $vendor = (substr $vendor, 0, 1) . lc (substr $vendor, 1, length $vendor); @@ -1547,9 +1577,7 @@ #----------------------------------------- sub check_virtual_disks { return if $#controllers == -1; - return if blacklisted('vdisk', 'all'); - my $id = undef; my $name = undef; my $nexus = undef; my $dev = undef; @@ -1568,7 +1596,6 @@ '1.3.6.1.4.1.674.10893.1.20.140.1.1.4' => 'virtualDiskState', '1.3.6.1.4.1.674.10893.1.20.140.1.1.6' => 'virtualDiskLengthInMB', '1.3.6.1.4.1.674.10893.1.20.140.1.1.13' => 'virtualDiskLayout', - '1.3.6.1.4.1.674.10893.1.20.140.1.1.17' => 'virtualDiskTargetID', '1.3.6.1.4.1.674.10893.1.20.140.1.1.20' => 'virtualDiskComponentStatus', '1.3.6.1.4.1.674.10893.1.20.140.1.1.21' => 'virtualDiskNexusID', ); @@ -1618,42 +1645,54 @@ 1 => 'Concatenated', 2 => 'RAID-0', 3 => 'RAID-1', + 4 => 'UNSUPPORTED:raid-2', + 5 => 'UNSUPPORTED:raid-3', + 6 => 'UNSUPPORTED:raid-4', 7 => 'RAID-5', 8 => 'RAID-6', + 9 => 'UNSUPPORTED:raid-7', 10 => 'RAID-10', + 11 => 'UNSUPPORTED:raid-30', 12 => 'RAID-50', + 13 => 'UNSUPPORTED:addSpares', + 14 => 'UNSUPPORTED:deleteLogical', + 15 => 'UNSUPPORTED:transformLogical', + 18 => 'UNSUPPORTED:raid-0-plus-1', 19 => 'Concatenated RAID-1', + 20 => 'UNSUPPORTED:concatRaid-5', + 21 => 'UNSUPPORTED:noRaid', + 22 => 'UNSUPPORTED:volume', + 23 => 'UNSUPPORTED:raidMorph', 24 => 'RAID-60', + 25 => 'CacheCade', ); # Check virtual disks on each of the controllers VDISK: foreach my $out (@output) { if ($snmp) { - $id = $out->{virtualDiskTargetID}; - $dev = $out->{virtualDiskDeviceName}; - $state = get_hashval($out->{virtualDiskState}, \%vdisk_state); - $layout = get_hashval($out->{virtualDiskLayout}, \%vdisk_layout); - $status = $snmp_status{$out->{virtualDiskComponentStatus}}; - $size = sprintf '%.2f GB', $out->{virtualDiskLengthInMB} / 1024; - $progr = q{}; # can't get this from SNMP(?) - $nexus = convert_nexus($out->{virtualDiskNexusID}); - } - else { - $id = $out->{ID}; - $dev = $out->{'Device Name'}; - $state = $out->{State}; - $status = $out->{Status}; - $layout = $out->{Layout}; - $size = $out->{Size}; - $progr = ' [' . $out->{Progress} . ']'; + $dev = $out->{virtualDiskDeviceName} || 'Unknown device'; + $state = get_hashval($out->{virtualDiskState}, \%vdisk_state) || 'Unknown state'; + $layout = get_hashval($out->{virtualDiskLayout}, \%vdisk_layout) || 'Unknown layout'; + $status = get_snmp_status($out->{virtualDiskComponentStatus}); + $size = sprintf '%.2f GB', ($out->{virtualDiskLengthInMB} || 0) / 1024; + $progr = q{}; # not available via SNMP + $nexus = convert_nexus(($out->{virtualDiskNexusID} || 9999)); + } + else { + $dev = get_nonempty_string('Device Name', $out, 'Unknown device'); + $state = get_nonempty_string('State', $out, 'Unknown state'); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $layout = get_nonempty_string('Layout', $out, 'Unknown layout'); + $size = get_nonempty_string('Size', $out, 'Unavailable'); $size =~ s{\A (.*GB).* \z}{$1}xms; - $nexus = join q{:}, $out->{ctrl}, $id; + $progr = ' [' . get_nonempty_string('Progress', $out, q{}) . ']'; $ctrl = $out->{ctrl}; + $nexus = join q{:}, $ctrl, get_nonempty_string('ID', $out, '9999'); } - next VDISK if blacklisted('vdisk', $nexus); $count{vdisk}++; + next VDISK if blacklisted('vdisk', $nexus); # The device name is undefined sometimes $dev = q{} if !defined $dev; @@ -1686,7 +1725,6 @@ #----------------------------------------- sub check_cache_battery { return if $#controllers == -1; - return if blacklisted('bat', 'all'); my $id = undef; my $nexus = undef; @@ -1772,21 +1810,21 @@ BATTERY: foreach my $out (@output) { if ($snmp) { - $status = $snmp_status{$out->{batteryComponentStatus}}; - $state = get_hashval($out->{batteryState}, \%bat_state); - $learn = get_hashval($out->{batteryLearnState}, \%bat_learn_state); - $pred = get_hashval($out->{batteryPredictedCapacity}, \%bat_pred_cap); - $ctrl = $out->{batteryConnectionControllerNumber} - 1; - $nexus = convert_nexus($out->{batteryNexusID}); + $status = get_snmp_status($out->{batteryComponentStatus}); + $state = get_hashval($out->{batteryState}, \%bat_state) || 'Unknown state'; + $learn = get_hashval($out->{batteryLearnState}, \%bat_learn_state) || 'Unknown learn state'; + $pred = get_hashval($out->{batteryPredictedCapacity}, \%bat_pred_cap) || 'Unknown predicted capacity status'; + $ctrl = ($out->{batteryConnectionControllerNumber} || 10000) - 1; + $nexus = convert_nexus(($out->{batteryNexusID} || 9999)); $id = $nexus; $id =~ s{\A \d+:(\d+) \z}{$1}xms; } else { - $id = $out->{'ID'}; - $state = $out->{'State'}; - $status = $out->{'Status'}; - $learn = $out->{'Learn State'}; - $pred = $out->{'Predicted Capacity Status'}; + $id = get_nonempty_string('ID', $out, 9999); + $state = get_nonempty_string('State', $out, 'Unknown state'); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $learn = get_nonempty_string('Learn State', $out, 'Unknown learn state'); + $pred = get_nonempty_string('Predicted Capacity Status', $out, 'Unknown predicted capacity status'); $ctrl = $out->{'ctrl'}; $nexus = join q{:}, $out->{ctrl}, $id; } @@ -1836,16 +1874,10 @@ report('storage', $msg, $E_WARNING, $nexus); } # Default - elsif ($status ne 'Ok') { - my $msg = sprintf 'Cache Battery %d in controller %d needs attention: %s (%s)', - $id, $ctrl, $state, $status; - report('storage', $msg, $status2nagios{$status}, $nexus); - } - # Ok else { my $msg = sprintf 'Cache Battery %d in controller %d is %s', $id, $ctrl, $state; - report('storage', $msg, $E_OK, $nexus); + report('storage', $msg, $status2nagios{$status}, $nexus); } } return; @@ -1857,9 +1889,7 @@ #----------------------------------------- sub check_connectors { return if $#controllers == -1; - return if blacklisted('conn', 'all'); - my $id = undef; my $nexus = undef; my $name = undef; my $state = undef; @@ -1871,7 +1901,6 @@ if ($snmp) { my %conn_oid = ( - '1.3.6.1.4.1.674.10893.1.20.130.2.1.1' => 'channelNumber', '1.3.6.1.4.1.674.10893.1.20.130.2.1.2' => 'channelName', '1.3.6.1.4.1.674.10893.1.20.130.2.1.3' => 'channelState', '1.3.6.1.4.1.674.10893.1.20.130.2.1.8' => 'channelComponentStatus', @@ -1927,25 +1956,21 @@ CHANNEL: foreach my $out (@output) { if ($snmp) { - $id = $out->{channelNumber} - 1; - $name = $out->{channelName}; - $status = $snmp_status{$out->{channelComponentStatus}}; - $state = get_hashval($out->{channelState}, \%conn_state); - $type = get_hashval($out->{channelBusType}, \%conn_bustype); - $nexus = convert_nexus($out->{channelNexusID}); + $name = $out->{channelName} || 'Unknown channel'; + $status = get_snmp_status($out->{channelComponentStatus}); + $state = get_hashval($out->{channelState}, \%conn_state) || 'Unknown state'; + $type = get_hashval($out->{channelBusType}, \%conn_bustype) || 'Unknown type'; + $nexus = convert_nexus(($out->{channelNexusID} || 9999)); $ctrl = $nexus; $ctrl =~ s{(\d+):\d+}{$1}xms; - # workaround for ancient OMSA versions - if (! defined $type) { $type = 'n/a'; } } else { - $id = $out->{'ID'}; - $name = $out->{'Name'}; - $state = $out->{'State'}; - $status = $out->{'Status'}; - $type = $out->{'Connector Type'}; + $name = get_nonempty_string('Name', $out, 'Unknown channel'); + $state = get_nonempty_string('State', $out, 'Unknown state'); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $type = get_nonempty_string('Connector Type', $out, 'Unknown type'); $ctrl = $out->{ctrl}; - $nexus = join q{:}, $out->{ctrl}, $id; + $nexus = join q{:}, $out->{ctrl}, $out->{'ID'}; } next CHANNEL if blacklisted('conn', $nexus); @@ -1962,8 +1987,6 @@ # STORAGE: Check enclosures #----------------------------------------- sub check_enclosures { - return if blacklisted('encl', 'all'); - my $id = undef; my $nexus = undef; my $name = undef; @@ -2022,30 +2045,29 @@ ENCLOSURE: foreach my $out (@output) { if ($snmp) { - $id = $out->{enclosureNumber} - 1; - $name = $out->{enclosureName}; - $state = get_hashval($out->{enclosureState}, \%encl_state); - $status = $snmp_status{$out->{enclosureComponentStatus}}; - $firmware = exists $out->{enclosureFirmwareVersion} - ? $out->{enclosureFirmwareVersion} : 'N/A'; - $nexus = convert_nexus($out->{enclosureNexusID}); + $id = ($out->{enclosureNumber} || 10000) - 1; + $name = $out->{enclosureName} || 'Unknown enclosure'; + $state = get_hashval($out->{enclosureState}, \%encl_state) || 'Unknown state'; + $status = get_snmp_status($out->{enclosureComponentStatus}); + $firmware = $out->{enclosureFirmwareVersion} || 'N/A'; + $nexus = convert_nexus(($out->{enclosureNexusID} || 9999)); $ctrl = $nexus; $ctrl =~ s{\A (\d+):.* \z}{$1}xms; # for the next two, a value of 9999 means feature not available - $occupied_slots = exists $out->{enclosureOccupiedSlotCount} + $occupied_slots = defined $out->{enclosureOccupiedSlotCount} && $out->{enclosureOccupiedSlotCount} != 9999 ? $out->{enclosureOccupiedSlotCount} : undef; - $total_slots = exists $out->{enclosureTotalSlots} + $total_slots = defined $out->{enclosureTotalSlots} && $out->{enclosureTotalSlots} != 9999 ? $out->{enclosureTotalSlots} : undef; } else { - $id = $out->{ID}; - $name = $out->{Name}; - $state = $out->{State}; - $status = $out->{Status}; - $firmware = $out->{'Firmware Version'} ne 'Not Applicable' - ? $out->{'Firmware Version'} : 'N/A'; + $id = get_nonempty_string('ID', $out, 9999); + $name = get_nonempty_string('Name', $out, 'Unknown enclosure'); + $state = get_nonempty_string('State', $out, 'Unknown state'); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $firmware = get_nonempty_string('Firmware Version', $out, 'N/A'); + $firmware =~ s{Not\sApplicable}{N/A}xms; $nexus = join q{:}, $out->{ctrl}, $id; $ctrl = $out->{ctrl}; } @@ -2092,9 +2114,7 @@ #----------------------------------------- sub check_enclosure_fans { return if $#controllers == -1; - return if blacklisted('encl_fan', 'all'); - my $id = undef; my $nexus = undef; my $name = undef; my $state = undef; @@ -2107,7 +2127,6 @@ if ($snmp) { my %fan_oid = ( - '1.3.6.1.4.1.674.10893.1.20.130.7.1.1' => 'fanNumber', '1.3.6.1.4.1.674.10893.1.20.130.7.1.2' => 'fanName', '1.3.6.1.4.1.674.10893.1.20.130.7.1.4' => 'fanState', '1.3.6.1.4.1.674.10893.1.20.130.7.1.11' => 'fanProbeCurrValue', @@ -2161,24 +2180,22 @@ FAN: foreach my $out (@output) { if ($snmp) { - $id = $out->{fanNumber} - 1; - $name = $out->{fanName}; - $state = get_hashval($out->{fanState}, \%fan_state); - $status = $snmp_status{$out->{fanComponentStatus}}; - $speed = $out->{fanProbeCurrValue}; - $encl_name = $out->{fanConnectionEnclosureName}; + $name = $out->{fanName} || 'Unknown fan'; + $state = get_hashval($out->{fanState}, \%fan_state) || 'Unknown state'; + $status = get_snmp_status($out->{fanComponentStatus}); + $speed = $out->{fanProbeCurrValue} || 'N/A'; + $encl_name = $out->{fanConnectionEnclosureName} || 'Unknown enclosure'; $encl_id = $snmp_enclosure{$out->{fanConnectionEnclosureNumber}}{nexus}; - $nexus = convert_nexus($out->{fanNexusID}); + $nexus = convert_nexus(($out->{fanNexusID} || 9999)); } else { - $id = $out->{'ID'}; - $name = $out->{'Name'}; - $state = $out->{'State'}; - $status = $out->{'Status'}; - $speed = $out->{'Speed'}; + $name = get_nonempty_string('Name', $out, 'Unknown fan'); + $state = get_nonempty_string('State', $out, 'Unknown state'); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $speed = get_nonempty_string('Speed', $out, 'N/A'); $encl_id = join q{:}, $out->{ctrl}, $out->{'encl_id'}; $encl_name = $out->{encl_name}; - $nexus = join q{:}, $out->{ctrl}, $out->{'encl_id'}, $id; + $nexus = join q{:}, $out->{ctrl}, $out->{'encl_id'}, get_nonempty_string('ID', $out, '9999'); } next FAN if blacklisted('encl_fan', $nexus); @@ -2205,9 +2222,7 @@ #----------------------------------------- sub check_enclosure_pwr { return if $#controllers == -1; - return if blacklisted('encl_ps', 'all'); - my $id = undef; my $nexus = undef; my $name = undef; my $state = undef; @@ -2219,7 +2234,6 @@ if ($snmp) { my %ps_oid = ( - '1.3.6.1.4.1.674.10893.1.20.130.9.1.1' => 'powerSupplyNumber', '1.3.6.1.4.1.674.10893.1.20.130.9.1.2' => 'powerSupplyName', '1.3.6.1.4.1.674.10893.1.20.130.9.1.4' => 'powerSupplyState', '1.3.6.1.4.1.674.10893.1.20.130.9.1.9' => 'powerSupplyComponentStatus', @@ -2272,22 +2286,20 @@ PS: foreach my $out (@output) { if ($snmp) { - $id = $out->{powerSupplyNumber}; - $name = $out->{powerSupplyName}; - $state = get_hashval($out->{powerSupplyState}, \%ps_state); - $status = $snmp_status{$out->{powerSupplyComponentStatus}}; + $name = $out->{powerSupplyName} || 'Unknown PSU'; + $state = get_hashval($out->{powerSupplyState}, \%ps_state) || 'Unknown state'; + $status = get_snmp_status($out->{powerSupplyComponentStatus}); $encl_id = $snmp_enclosure{$out->{powerSupplyConnectionEnclosureNumber}}{nexus}; - $encl_name = $out->{powerSupplyConnectionEnclosureName}; - $nexus = convert_nexus($out->{powerSupplyNexusID}); + $encl_name = $out->{powerSupplyConnectionEnclosureName} || 'Unknown enclosure'; + $nexus = convert_nexus(($out->{powerSupplyNexusID} || 9999)); } else { - $id = $out->{'ID'}; - $name = $out->{'Name'}; - $state = $out->{'State'}; - $status = $out->{'Status'}; + $name = get_nonempty_string('Name', $out, 'Unknown PSU'); + $state = get_nonempty_string('State', $out, 'Unknown state'); + $status = get_nonempty_string('Status', $out, 'Unknown'); $encl_id = join q{:}, $out->{ctrl}, $out->{'encl_id'}; $encl_name = $out->{encl_name}; - $nexus = join q{:}, $out->{ctrl}, $out->{'encl_id'}, $id; + $nexus = join q{:}, $out->{ctrl}, $out->{'encl_id'}, get_nonempty_string('ID', $out, '9999'); } next PS if blacklisted('encl_ps', $nexus); @@ -2314,9 +2326,7 @@ #----------------------------------------- sub check_enclosure_temp { return if $#controllers == -1; - return if blacklisted('encl_temp', 'all'); - my $id = undef; my $nexus = undef; my $name = undef; my $state = undef; @@ -2334,7 +2344,6 @@ if ($snmp) { my %temp_oid = ( - '1.3.6.1.4.1.674.10893.1.20.130.11.1.1' => 'temperatureProbeNumber', '1.3.6.1.4.1.674.10893.1.20.130.11.1.2' => 'temperatureProbeName', '1.3.6.1.4.1.674.10893.1.20.130.11.1.4' => 'temperatureProbeState', '1.3.6.1.4.1.674.10893.1.20.130.11.1.6' => 'temperatureProbeUnit', @@ -2393,39 +2402,32 @@ TEMP: foreach my $out (@output) { if ($snmp) { - $id = $out->{temperatureProbeNumber} - 1; - $name = $out->{temperatureProbeName}; - $state = get_hashval($out->{temperatureProbeState}, \%temp_state); - $status = $snmp_status{$out->{temperatureProbeComponentStatus}}; - $unit = $out->{temperatureProbeUnit}; - $reading = exists $out->{temperatureProbeCurValue} - ? $out->{temperatureProbeCurValue} : '[N/A]'; - $max_warn = exists $out->{temperatureProbeMaxWarning} - ? $out->{temperatureProbeMaxWarning} : '[N/A]'; - $max_crit = exists $out->{temperatureProbeMaxCritical} - ? $out->{temperatureProbeMaxCritical} : '[N/A]'; - $min_warn = exists $out->{temperatureProbeMinWarning} - ? $out->{temperatureProbeMinWarning} : '[N/A]'; - $min_crit = exists $out->{temperatureProbeMinCritical} - ? $out->{temperatureProbeMinCritical} : '[N/A]'; + $name = $out->{temperatureProbeName} || 'Unknown temp probe'; + $state = get_hashval($out->{temperatureProbeState}, \%temp_state) || 'Unknown state'; + $status = get_snmp_probestatus($out->{temperatureProbeComponentStatus}); + $unit = $out->{temperatureProbeUnit} || 'Unknown unit'; + $reading = $out->{temperatureProbeCurValue} || '[N/A]'; + $max_warn = $out->{temperatureProbeMaxWarning} || '[N/A]'; + $max_crit = $out->{temperatureProbeMaxCritical} || '[N/A]'; + $min_warn = $out->{temperatureProbeMinWarning} || '[N/A]'; + $min_crit = $out->{temperatureProbeMinCritical} || '[N/A]'; $encl_id = $snmp_enclosure{$out->{temperatureConnectionEnclosureNumber}}{nexus}; - $encl_name = $out->{temperatureConnectionEnclosureName}; - $nexus = convert_nexus($out->{temperatureProbeNexusID}); + $encl_name = $out->{temperatureConnectionEnclosureName} || 'Unknown enclosure'; + $nexus = convert_nexus(($out->{temperatureProbeNexusID} || 9999)); } else { - $id = $out->{'ID'}; - $name = $out->{'Name'}; - $state = $out->{'State'}; - $status = $out->{'Status'}; + $name = get_nonempty_string('Name', $out, 'Unknown temp probe'); + $state = get_nonempty_string('State', $out, 'Unknown state'); + $status = get_nonempty_string('Status', $out, 'Unknown'); $unit = 'FIXME'; - $reading = $out->{'Reading'}; - $max_warn = $out->{'Maximum Warning Threshold'}; - $max_crit = $out->{'Maximum Failure Threshold'}; - $min_warn = $out->{'Minimum Warning Threshold'}; - $min_crit = $out->{'Minimum Failure Threshold'}; + $reading = get_nonempty_string('Reading', $out, '[N/A]'); + $max_warn = get_nonempty_string('Maximum Warning Threshold', $out, '[N/A]'); + $max_crit = get_nonempty_string('Maximum Failure Threshold', $out, '[N/A]'); + $min_warn = get_nonempty_string('Minimum Warning Threshold', $out, '[N/A]'); + $min_crit = get_nonempty_string('Minimum Failure Threshold', $out, '[N/A]'); $encl_id = join q{:}, $out->{ctrl}, $out->{'encl_id'}; $encl_name = $out->{encl_name}; - $nexus = join q{:}, $out->{ctrl}, $out->{'encl_id'}, $id; + $nexus = join q{:}, $out->{ctrl}, $out->{'encl_id'}, get_nonempty_string('ID', $out, '9999'); } next TEMP if blacklisted('encl_temp', $nexus); @@ -2532,9 +2534,7 @@ #----------------------------------------- sub check_enclosure_emms { return if $#controllers == -1; - return if blacklisted('encl_emm', 'all'); - my $id = undef; my $nexus = undef; my $name = undef; my $state = undef; @@ -2546,7 +2546,6 @@ if ($snmp) { my %emms_oid = ( - '1.3.6.1.4.1.674.10893.1.20.130.13.1.1' => 'enclosureManagementModuleNumber', '1.3.6.1.4.1.674.10893.1.20.130.13.1.2' => 'enclosureManagementModuleName', '1.3.6.1.4.1.674.10893.1.20.130.13.1.4' => 'enclosureManagementModuleState', '1.3.6.1.4.1.674.10893.1.20.130.13.1.11' => 'enclosureManagementModuleComponentStatus', @@ -2600,22 +2599,20 @@ EMM: foreach my $out (@output) { if ($snmp) { - $id = $out->{enclosureManagementModuleNumber} - 1; - $name = $out->{enclosureManagementModuleName}; - $state = get_hashval($out->{enclosureManagementModuleState}, \%emms_state); - $status = $snmp_status{$out->{enclosureManagementModuleComponentStatus}}; + $name = $out->{enclosureManagementModuleName} || 'Unknown EMM'; + $state = get_hashval($out->{enclosureManagementModuleState}, \%emms_state) || 'Unknown state'; + $status = get_snmp_status($out->{enclosureManagementModuleComponentStatus}); $encl_id = $snmp_enclosure{$out->{enclosureManagementModuleConnectionEnclosureNumber}}{nexus}; - $encl_name = $out->{enclosureManagementModuleConnectionEnclosureName}; - $nexus = convert_nexus($out->{enclosureManagementModuleNexusID}); + $encl_name = $out->{enclosureManagementModuleConnectionEnclosureName} || 'Unknown enclosure'; + $nexus = convert_nexus(($out->{enclosureManagementModuleNexusID} || 9999)); } else { - $id = $out->{'ID'}; - $name = $out->{'Name'}; - $state = $out->{'State'}; - $status = $out->{'Status'}; + $name = get_nonempty_string('Name', $out, 'Unknown EMM'); + $state = get_nonempty_string('State', $out, 'Unknown state'); + $status = get_nonempty_string('Status', $out, 'Unknown'); $encl_id = join q{:}, $out->{ctrl}, $out->{'encl_id'}; $encl_name = $out->{encl_name}; - $nexus = join q{:}, $out->{ctrl}, $out->{'encl_id'}, $id; + $nexus = join q{:}, $out->{ctrl}, $out->{'encl_id'}, get_nonempty_string('ID', $out, '9999'); } next EMM if blacklisted('encl_emm', $nexus); @@ -2647,8 +2644,6 @@ # CHASSIS: Check memory modules #----------------------------------------- sub check_memory { - return if blacklisted('dimm', 'all'); - my $index = undef; my $status = undef; my $location = undef; @@ -2702,22 +2697,26 @@ foreach my $out (@output) { @failures = (); # Initialize if ($snmp) { - $index = $out->{memoryDeviceIndex}; - $status = $snmp_status{$out->{memoryDeviceStatus}}; - $location = $out->{memoryDeviceLocationName}; - $size = sprintf '%d MB', $out->{memoryDeviceSize}/1024; - $modes = $out->{memoryDeviceFailureModes}; + $index = ($out->{memoryDeviceIndex} || 10000) - 1; + $status = get_snmp_status($out->{memoryDeviceStatus}); + $location = $out->{memoryDeviceLocationName} || 'Unknown location'; + $size = sprintf '%d MB', ($out->{memoryDeviceSize} || 0)/1024; + $modes = $out->{memoryDeviceFailureModes} || -9999; if ($modes > 0) { foreach my $mask (sort keys %failure_mode) { if (($modes & $mask) != 0) { push @failures, $failure_mode{$mask}; } } } + elsif ($modes == -9999) { + push @failures, q{ERROR: Failure modes not available via SNMP}; + } } else { - $index = $out->{'Type'} eq '[Not Occupied]' ? undef : $out->{'Index'}; - $status = $out->{'Status'}; - $location = $out->{'Connector Name'}; - $size = $out->{'Size'}; + my $type = get_nonempty_string('Type', $out, q{}); + $index = $type eq '[Not Occupied]' ? undef : get_nonempty_string('Index', $out, 9999); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $location = get_nonempty_string('Connector Name', $out, 'Unknown location'); + $size = get_nonempty_string('Size', $out, 0); if (defined $size) { $size =~ s{\s\s}{ }gxms; } @@ -2738,11 +2737,11 @@ $msize =~ s{\A (\d+) \s MB}{$1}xms; $count{mem} += $msize; - next DIMM if blacklisted('dimm', $index); - # Ignore empty memory slots next DIMM if !defined $index; + $count{dimm}++; + next DIMM if blacklisted('dimm', $index); if ($status ne 'Ok') { my $msg = undef; @@ -2772,8 +2771,6 @@ # CHASSIS: Check fans #----------------------------------------- sub check_fans { - return if blacklisted('fan', 'all'); - my $index = undef; my $status = undef; my $reading = undef; @@ -2819,31 +2816,29 @@ FAN: foreach my $out (@output) { if ($snmp) { - $index = $out->{coolingDeviceIndex}; - $status = $snmp_probestatus{$out->{coolingDeviceStatus}}; - $reading = $out->{coolingDeviceReading}; - $location = $out->{coolingDeviceLocationName}; - $max_crit = exists $out->{coolingDeviceUpperCriticalThreshold} - ? $out->{coolingDeviceUpperCriticalThreshold} : 0; - $max_warn = exists $out->{coolingDeviceUpperNonCriticalThreshold} - ? $out->{coolingDeviceUpperNonCriticalThreshold} : 0; - } - else { - $index = $out->{'Index'}; - $status = $out->{'Status'}; - $reading = $out->{'Reading'}; - $location = $out->{'Probe Name'}; - $max_crit = $out->{'Maximum Failure Threshold'} ne '[N/A]' - ? $out->{'Maximum Failure Threshold'} : 0; - $max_warn = $out->{'Maximum Warning Threshold'} ne '[N/A]' - ? $out->{'Maximum Warning Threshold'} : 0; + $index = ($out->{coolingDeviceIndex} || 10000) - 1; + $status = get_snmp_probestatus($out->{coolingDeviceStatus}); + $reading = $out->{coolingDeviceReading} || 0; + $location = $out->{coolingDeviceLocationName} || 'Unknown location'; + $max_crit = $out->{coolingDeviceUpperCriticalThreshold} || 0; + $max_warn = $out->{coolingDeviceUpperNonCriticalThreshold} || 0; + } + else { + $index = get_nonempty_string('Index', $out, 9999); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $reading = get_nonempty_string('Reading', $out, 0); + $location = get_nonempty_string('Probe Name', $out, 'Unknown location'); + $max_crit = get_nonempty_string('Maximum Failure Threshold', $out, 0); + $max_warn = get_nonempty_string('Maximum Warning Threshold', $out, 0); + if ($max_crit eq '[N/A]') { $max_crit = 0; } + if ($max_warn eq '[N/A]') { $max_warn = 0; } $reading =~ s{\A (\d+).* \z}{$1}xms; $max_warn =~ s{\A (\d+).* \z}{$1}xms; $max_crit =~ s{\A (\d+).* \z}{$1}xms; } - next FAN if blacklisted('fan', $index); $count{fan}++; + next FAN if blacklisted('fan', $index); if ($status ne 'Ok') { my $msg = sprintf 'Chassis fan %d [%s] needs attention: %s', @@ -2879,8 +2874,6 @@ # CHASSIS: Check power supplies #----------------------------------------- sub check_powersupplies { - return if blacklisted('ps', 'all'); - my $index = undef; my $status = undef; my $type = undef; @@ -2954,15 +2947,15 @@ if ($snmp) { @states = (); # contains states for the PS - $index = $out->{powerSupplyIndex} - 1; - $status = $snmp_status{$out->{powerSupplyStatus}}; - $type = get_hashval($out->{powerSupplyType}, \%ps_type); - $err_type = defined $out->{powerSupplyConfigurationErrorType} - ? $ps_config_error_type{$out->{powerSupplyConfigurationErrorType}} : undef; + $index = ($out->{powerSupplyIndex} || 10000) - 1; + $status = get_snmp_status($out->{powerSupplyStatus}); + $type = get_hashval($out->{powerSupplyType}, \%ps_type) || 'Unknown type'; + $err_type = get_hashval($out->{powerSupplyConfigurationErrorType}, \%ps_config_error_type); # get the combined state from the StatusReading OID + my $raw_state = $out->{powerSupplySensorState} || 0; foreach my $mask (sort keys %ps_state) { - if (($out->{powerSupplySensorState} & $mask) != 0) { + if (($raw_state & $mask) != 0) { push @states, $ps_state{$mask}; } } @@ -2976,14 +2969,14 @@ $state = join q{, }, @states; } else { - $index = $out->{'Index'}; - $status = $out->{'Status'}; - $type = $out->{'Type'}; - $state = $out->{'Online Status'}; + $index = get_nonempty_string('Index', $out, 9999); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $type = get_nonempty_string('Type', $out, 'Unknown type'); + $state = get_nonempty_string('Online Status', $out, 'Unknown state'); } - next PS if blacklisted('ps', $index); $count{power}++; + next PS if blacklisted('ps', $index); if ($status ne 'Ok') { my $msg = sprintf 'Power Supply %d [%s] needs attention: %s', @@ -3004,8 +2997,6 @@ # CHASSIS: Check temperatures #----------------------------------------- sub check_temperatures { - return if blacklisted('temp', 'all'); - my $index = undef; my $status = undef; my $reading = undef; @@ -3066,42 +3057,52 @@ TEMP: foreach my $out (@output) { if ($snmp) { - $index = $out->{temperatureProbeIndex} - 1; - $status = $snmp_probestatus{$out->{temperatureProbeStatus}}; - $location = $out->{temperatureProbeLocationName}; - $reading = exists $out->{temperatureProbeReading} - ? $out->{temperatureProbeReading} / 10 : '[N/A]'; - $max_crit = exists $out->{temperatureProbeUpperCriticalThreshold} - ? $out->{temperatureProbeUpperCriticalThreshold} / 10 : '[N/A]'; - $max_warn = exists $out->{temperatureProbeUpperNonCriticalThreshold} - ? $out->{temperatureProbeUpperNonCriticalThreshold} / 10 : '[N/A]'; - $min_crit = exists $out->{temperatureProbeLowerCriticalThreshold} - ? $out->{temperatureProbeLowerCriticalThreshold} / 10 : '[N/A]'; - $min_warn = exists $out->{temperatureProbeLowerNonCriticalThreshold} - ? $out->{temperatureProbeLowerNonCriticalThreshold} / 10 : '[N/A]'; + $index = ($out->{temperatureProbeIndex} || 10000) - 1; + $status = get_snmp_probestatus($out->{temperatureProbeStatus}); + $location = $out->{temperatureProbeLocationName} || 'Unknown location'; $type = get_hashval($out->{temperatureProbeType}, \%probe_type); - $discrete = exists $out->{temperatureProbeDiscreteReading} - ? $out->{temperatureProbeDiscreteReading} : '[N/A]'; + $reading = $out->{temperatureProbeReading} || '[N/A]'; + $max_crit = $out->{temperatureProbeUpperCriticalThreshold} || '[N/A]'; + $max_warn = $out->{temperatureProbeUpperNonCriticalThreshold} || '[N/A]'; + $min_crit = $out->{temperatureProbeLowerCriticalThreshold} || '[N/A]'; + $min_warn = $out->{temperatureProbeLowerNonCriticalThreshold} || '[N/A]'; + $discrete = $out->{temperatureProbeDiscreteReading} || '[N/A]'; + + # If numeric values, i.e. not discrete + $reading /= 10 if $reading =~ m{\A \d+ \z}xms; + $max_crit /= 10 if $max_crit =~ m{\A \d+ \z}xms; + $max_warn /= 10 if $max_warn =~ m{\A \d+ \z}xms; + $min_crit /= 10 if $min_crit =~ m{\A \d+ \z}xms; + $min_warn /= 10 if $min_warn =~ m{\A \d+ \z}xms; + # workaround for bad temp probes if ($type eq 'AmbientESM' and $reading !~ m{\A \d+(\.\d+)? \z}xms) { $type = 'Discrete'; } } else { - $index = $out->{'Index'}; - $status = $out->{'Status'}; - $reading = $out->{'Reading'}; $reading =~ s{\.0\s+C}{}xms; - $location = $out->{'Probe Name'}; - $max_crit = $out->{'Maximum Failure Threshold'}; $max_crit =~ s{\.0\s+C}{}xms; - $max_warn = $out->{'Maximum Warning Threshold'}; $max_warn =~ s{\.0\s+C}{}xms; - $min_crit = $out->{'Minimum Failure Threshold'}; $min_crit =~ s{\.0\s+C}{}xms; - $min_warn = $out->{'Minimum Warning Threshold'}; $min_warn =~ s{\.0\s+C}{}xms; + $index = get_nonempty_string('Index', $out, 9999); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $location = get_nonempty_string('Probe Name', $out, 'Unknown location'); + $reading = get_nonempty_string('Reading', $out, '[N/A]'); + $max_crit = get_nonempty_string('Maximum Failure Threshold', $out, '[N/A]'); + $max_warn = get_nonempty_string('Maximum Warning Threshold', $out, '[N/A]'); + $min_crit = get_nonempty_string('Minimum Failure Threshold', $out, '[N/A]'); + $min_warn = get_nonempty_string('Minimum Warning Threshold', $out, '[N/A]'); + + # Cleaning the temp readings + $reading =~ s{\.0\s+C}{}xms; + $max_crit =~ s{\.0\s+C}{}xms; + $max_warn =~ s{\.0\s+C}{}xms; + $min_crit =~ s{\.0\s+C}{}xms; + $min_warn =~ s{\.0\s+C}{}xms; + $type = $reading =~ m{\A\d+\z}xms ? 'AmbientESM' : 'Discrete'; $discrete = $reading; } - next TEMP if blacklisted('temp', $index); $count{temp}++; + next TEMP if blacklisted('temp', $index); if ($type eq 'Discrete') { my $msg = sprintf 'Temperature probe %d [%s] is %s', @@ -3198,8 +3199,6 @@ # CHASSIS: Check processors #----------------------------------------- sub check_processors { - return if blacklisted('cpu', 'all'); - my $index = undef; my $status = undef; my $state = undef; @@ -3410,12 +3409,12 @@ foreach my $out (@output) { if ($snmp) { $index = exists $out->{processorDeviceStatusIndex} - ? $out->{processorDeviceStatusIndex} - 1 - : $out->{processorDeviceIndex} - 1; + ? ($out->{processorDeviceStatusIndex} || 10000) - 1 + : ($out->{processorDeviceIndex} || 10000) - 1; $status = exists $out->{processorDeviceStatusStatus} - ? $snmp_status{$out->{processorDeviceStatusStatus}} - : $snmp_status{$out->{processorDeviceStatus}}; - if (exists $out->{processorDeviceStatusReading}) { + ? get_snmp_status($out->{processorDeviceStatusStatus}) + : get_snmp_status($out->{processorDeviceStatus}); + if (defined $out->{processorDeviceStatusReading}) { my @states = (); # contains states for the CPU # get the combined state from the StatusReading OID @@ -3429,39 +3428,38 @@ $state = join q{, }, @states; } else { - $state = get_hashval($out->{processorDeviceStatusState}, \%cpu_state); + $state = get_hashval($out->{processorDeviceStatusState}, \%cpu_state) || 'Unknown state'; } - $man = $out->{processorDeviceManufacturerName}; - $family = (exists $out->{processorDeviceFamily} - and exists $cpu_family{$out->{processorDeviceFamily}}) + $man = $out->{processorDeviceManufacturerName} || undef; + $family = (defined $out->{processorDeviceFamily} + and defined $cpu_family{$out->{processorDeviceFamily}}) ? $cpu_family{$out->{processorDeviceFamily}} : undef; - $speed = $out->{processorDeviceCurrentSpeed}; - $brand = $out->{processorDeviceBrandName}; + $speed = $out->{processorDeviceCurrentSpeed} || undef; + $brand = $out->{processorDeviceBrandName} || undef; } else { - $index = $out->{'Index'}; - $status = $out->{'Status'}; - $state = $out->{'State'}; - $brand = exists $out->{'Processor Brand'} ? $out->{'Processor Brand'} : undef; - $family = exists $out->{'Processor Family'} ? $out->{'Processor Family'} : undef; - $man = exists $out->{'Processor Manufacturer'} ? $out->{'Processor Manufacturer'} : undef; - $speed = exists $out->{'Current Speed'} ? $out->{'Current Speed'} : undef; + $index = get_nonempty_string('Index', $out, 9999); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $state = get_nonempty_string('State', $out, 'Unknown state'); + $brand = get_nonempty_string('Processor Brand', $out, undef); + $family = get_nonempty_string('Processor Family', $out, undef); + $man = get_nonempty_string('Processor Manufacturer', $out, undef); + $speed = get_nonempty_string('Current Speed', $out, undef); } - next CPU if blacklisted('cpu', $index); - # Ignore unoccupied CPU slots (omreport) next CPU if (defined $out->{'Processor Manufacturer'} and $out->{'Processor Manufacturer'} eq '[Not Occupied]') or (defined $out->{'Processor Brand'} and $out->{'Processor Brand'} eq '[Not Occupied]'); # Ignore unoccupied CPU slots (snmp) - if ($snmp and exists $out->{processorDeviceStatusReading} + if ($snmp and defined $out->{processorDeviceStatusReading} and $out->{processorDeviceStatusReading} == 0) { next CPU; } $count{cpu}++; + next CPU if blacklisted('cpu', $index); if (defined $brand) { $brand =~ s{\s\s+}{ }gxms; @@ -3498,8 +3496,6 @@ # CHASSIS: Check voltage probes #----------------------------------------- sub check_volts { - return if blacklisted('volt', 'all'); - my $index = undef; my $status = undef; my $reading = undef; @@ -3540,22 +3536,22 @@ VOLT: foreach my $out (@output) { if ($snmp) { - $index = $out->{voltageProbeIndex} - 1; - $status = $snmp_probestatus{$out->{voltageProbeStatus}}; - $reading = exists $out->{voltageProbeReading} + $index = ($out->{voltageProbeIndex} || 10000) - 1; + $status = get_snmp_probestatus($out->{voltageProbeStatus}); + $reading = defined $out->{voltageProbeReading} ? sprintf('%.3f V', $out->{voltageProbeReading}/1000) - : get_hashval($out->{voltageProbeDiscreteReading}, \%volt_discrete_reading); - $location = $out->{voltageProbeLocationName}; + : (get_hashval($out->{voltageProbeDiscreteReading}, \%volt_discrete_reading) || 'Unknown reading'); + $location = $out->{voltageProbeLocationName} || 'Unknown location'; } else { - $index = $out->{'Index'}; - $status = $out->{'Status'}; - $reading = $out->{'Reading'}; - $location = $out->{'Probe Name'}; + $index = get_nonempty_string('Index', $out, 9999); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $reading = get_nonempty_string('Reading', $out, 'Unknown reading'); + $location = get_nonempty_string('Probe Name', $out, 'Unknown location'); } - next VOLT if blacklisted('volt', $index); $count{volt}++; + next VOLT if blacklisted('volt', $index); my $msg = sprintf 'Voltage sensor %d [%s] is %s', $index, $location, $reading; @@ -3570,8 +3566,6 @@ # CHASSIS: Check batteries #----------------------------------------- sub check_batteries { - return if blacklisted('bp', 'all'); - my $index = undef; my $status = undef; my $reading = undef; @@ -3614,20 +3608,20 @@ BATTERY: foreach my $out (@output) { if ($snmp) { - $index = $out->{batteryIndex} - 1; - $status = $snmp_status{$out->{batteryStatus}}; - $reading = get_hashval($out->{batteryReading}, \%bat_reading); - $location = $out->{batteryLocationName}; + $index = ($out->{batteryIndex} || 10000) - 1; + $status = get_snmp_status($out->{batteryStatus}); + $reading = get_hashval($out->{batteryReading}, \%bat_reading) || 'Unknown reading'; + $location = $out->{batteryLocationName} || 'Unknown location'; } else { - $index = $out->{'Index'}; - $status = $out->{'Status'}; - $reading = $out->{'Reading'}; - $location = $out->{'Probe Name'}; + $index = get_nonempty_string('Index', $out, 9999); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $reading = get_nonempty_string('Reading', $out, 'Unknown reading'); + $location = get_nonempty_string('Probe Name', $out, 'Unknown location'); } - next BATTERY if blacklisted('bp', $index); $count{bat}++; + next BATTERY if blacklisted('bp', $index); my $msg = sprintf 'Battery probe %d [%s] is %s', $index, $location, $reading; @@ -3641,8 +3635,6 @@ # CHASSIS: Check amperage probes (power monitoring) #----------------------------------------- sub check_pwrmonitoring { - return if blacklisted('amp', 'all'); - my $index = undef; my $status = undef; my $reading = undef; @@ -3725,27 +3717,18 @@ AMP: foreach my $out (@output) { if ($snmp) { - $index = $out->{amperageProbeIndex} - 1; - $status = $snmp_status{$out->{amperageProbeStatus}}; + $index = ($out->{amperageProbeIndex} || 10000) - 1; + $status = get_snmp_probestatus($out->{amperageProbeStatus}); $type = get_hashval($out->{amperageProbeType}, \%amp_type); $reading = $type eq 'amperageProbeTypeIsDiscrete' ? get_hashval($out->{amperageProbeDiscreteReading}, \%amp_discrete) - : $out->{amperageProbeReading}; - $location = $out->{amperageProbeLocationName}; - $max_crit = exists $out->{amperageProbeUpperCriticalThreshold} - ? $out->{amperageProbeUpperCriticalThreshold} : 0; - $max_warn = exists $out->{amperageProbeUpperNonCriticalThreshold} - ? $out->{amperageProbeUpperNonCriticalThreshold} : 0; + : ($out->{amperageProbeReading} || 0); + $location = $out->{amperageProbeLocationName} || 'Unknown location'; + $max_crit = $out->{amperageProbeUpperCriticalThreshold} || 0; + $max_warn = $out->{amperageProbeUpperNonCriticalThreshold} || 0; $unit = exists $amp_unit{$amp_type{$out->{amperageProbeType}}} ? $amp_unit{$amp_type{$out->{amperageProbeType}}} : 'mA'; - # workaround for broken probes - if (!defined $reading) { - $type = 'amperageProbeTypeIsDiscrete'; - $reading = '[N/A]'; - $unit = q{}; - } - # calculate proper values and set unit for ampere probes if ($unit eq 'hA' and $type ne 'amperageProbeTypeIsDiscrete') { $reading /= 10; @@ -3755,40 +3738,54 @@ } } else { - $index = $out->{'Index'}; - next AMP if (!defined $index || $index !~ m/^\d+$/x); - $status = $out->{'Status'}; - $reading = $out->{'Reading'}; - $location = $out->{'Probe Name'}; - $max_crit = $out->{'Failure Threshold'} ne '[N/A]' - ? $out->{'Failure Threshold'} : 0; - $max_warn = $out->{'Warning Threshold'} ne '[N/A]' - ? $out->{'Warning Threshold'} : 0; + $index = get_nonempty_string('Index', $out, 9999); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $reading = get_nonempty_string('Reading', $out, 'Unknown reading'); + $location = get_nonempty_string('Probe Name', $out, 'Unknown location'); + $max_crit = get_nonempty_string('Failure Threshold', $out, 0); + $max_warn = get_nonempty_string('Warning Threshold', $out, 0); + + $max_crit = 0 if $max_crit eq '[N/A]'; + $max_warn = 0 if $max_warn eq '[N/A]'; + $reading =~ s{\A (\d+.*?)\s+([a-zA-Z]+) \s*\z}{$1}xms; - $unit = $2; + $unit = $2 || 'unknown'; $max_warn =~ s{\A (\d+.*?)\s+[a-zA-Z]+ \s*\z}{$1}xms; $max_crit =~ s{\A (\d+.*?)\s+[a-zA-Z]+ \s*\z}{$1}xms; } - next AMP if blacklisted('amp', $index); next AMP if $index !~ m{\A \d+ \z}xms; + + # Special case: Probe is present but unknown. This happens via + # SNMP on some systems where power monitoring capability is + # disabled due to non-redundant and/or non-instrumented power + # supplies. + # E.g. R410 with newer BMC firmware and 1 power supply + if ($snmp && $status eq 'Unknown' && $reading == 0) { + next AMP; + } + $count{amp}++; + next AMP if blacklisted('amp', $index); + # Special case: Discrete reading if (defined $type and $type eq 'amperageProbeTypeIsDiscrete') { my $msg = sprintf 'Amperage probe %d [%s] is %s', $index, $location, $reading; - report('chassis', $msg, $status2nagios{$status}, $index); + my $err = $snmp ? $probestatus2nagios{$status} : $status2nagios{$status}; + report('chassis', $msg, $err, $index); } + # Default else { my $msg = sprintf 'Amperage probe %d [%s] reads %s %s', $index, $location, $reading, $unit; - report('chassis', $msg, $status2nagios{$status}, $index); + my $err = $snmp ? $probestatus2nagios{$status} : $status2nagios{$status}; + report('chassis', $msg, $err, $index); } # Collect performance data if (defined $opt{perfdata}) { next AMP if $reading !~ m{\A \d+(\.\d+)? \z}xms; # discrete reading (not number) - #next AMP if $type eq 'amperageProbeTypeIsDiscrete'; my $label = join q{_}, 'pwr_mon', $index, lc $location; $label =~ s{\s}{_}gxms; push @perfdata, { @@ -3854,8 +3851,6 @@ # CHASSIS: Check intrusion #----------------------------------------- sub check_intrusion { - return if blacklisted('intr', 'all'); - my $index = undef; my $status = undef; my $reading = undef; @@ -3897,18 +3892,18 @@ INTRUSION: foreach my $out (@output) { if ($snmp) { - $index = $out->{intrusionIndex} - 1; - $status = $snmp_status{$out->{intrusionStatus}}; - $reading = get_hashval($out->{intrusionReading}, \%int_reading); + $index = ($out->{intrusionIndex} || 10000) - 1; + $status = get_snmp_status($out->{intrusionStatus}); + $reading = get_hashval($out->{intrusionReading}, \%int_reading) || 'Unknown reading'; } else { - $index = $out->{'Index'}; - $status = $out->{'Status'}; - $reading = $out->{'State'}; + $index = get_nonempty_string('Index', $out, 9999); + $status = get_nonempty_string('Status', $out, 'Unknown'); + $reading = get_nonempty_string('State', $out, 'Unknown reading'); } - next INTRUSION if blacklisted('intr', $index); $count{intr}++; + next INTRUSION if blacklisted('intr', $index); if ($status ne 'Ok') { my $msg = sprintf 'Chassis intrusion %d detected: %s', @@ -3927,6 +3922,126 @@ #----------------------------------------- +# CHASSIS: Check SD Card Device +#----------------------------------------- +sub check_sdcard { + my $index = undef; + my $status = undef; + my $state = undef; + my $location = undef; + my $capacity = undef; + my $setting = undef; + my @output = (); + + if ($snmp) { + my %sd_oid + = ( + '1.3.6.1.4.1.674.10892.1.1100.112.1.2.1' => 'sdCardDeviceIndex', + '1.3.6.1.4.1.674.10892.1.1100.112.1.3.1' => 'sdCardDeviceStatus', + '1.3.6.1.4.1.674.10892.1.1100.112.1.4.1' => 'sdCardDeviceType', + '1.3.6.1.4.1.674.10892.1.1100.112.1.7.1' => 'sdCardDeviceLocationName', + '1.3.6.1.4.1.674.10892.1.1100.112.1.8.1' => 'sdCardDeviceCardPresent', + '1.3.6.1.4.1.674.10892.1.1100.112.1.9.1' => 'sdCardDeviceCardState', + '1.3.6.1.4.1.674.10892.1.1100.112.1.10.1' => 'sdCardDeviceCardStorageSize', + ); + my $result = undef; + if ($opt{use_get_table}) { + my $sdCardDeviceTable = '1.3.6.1.4.1.674.10892.1.1100.112.1'; + $result = $snmp_session->get_table(-baseoid => $sdCardDeviceTable); + } + else { + $result = $snmp_session->get_entries(-columns => [keys %sd_oid]); + } + + # No SD cards is OK + return 0 if !defined $result; + + @output = @{ get_snmp_output($result, \%sd_oid) }; + } + else { + @output = @{ run_omreport("$omopt_chassis removableflashmedia") }; + } + + # Note: These values are bit fields, so combination values are possible. + my %sd_state + = ( + 0 => 'None', # state is none of the following: + 1 => 'Present', # device is present + 2 => 'IPMI-ready', # device is IPMI ready + 4 => 'Full-ready', # device is full ready + 8 => 'Offline', # device is offline + 16 => 'Failed', # device is failed + 32 => 'Active', # device is active + 64 => 'Bootable', # device is bootable + 128 => 'Write-protected', # device is write-protected + 256 => 'Standby', # device is in standby mode + ); + + my $c = 0; + SDCARD: + foreach my $out (@output) { + if ($snmp) { + $index = ($out->{sdCardDeviceIndex} || 10000) - 1; + $status = get_snmp_status($out->{sdCardDeviceStatus}); + + if (defined $out->{sdCardDeviceCardState}) { + my @states = (); # contains states SD card + + # get the combined state from the Device Status OID + foreach my $mask (sort keys %sd_state) { + if (($out->{sdCardDeviceCardState} & $mask) != 0) { + push @states, $sd_state{$mask}; + } + } + + # Finally, create the state string + $state = join q{, }, @states; + + # special case: absent + if ($out->{sdCardDeviceCardState} % 2 == 0) { + $state = 'Absent'; + } + } + + $location = $out->{sdCardDeviceLocationName} || 'Unknown location'; + $capacity = sprintf '%s MB', ($out->{sdCardDeviceCardStorageSize} || 'Unknown size'); + } + else { + $index = $c++; + $status = get_nonempty_string('Status', $out, 'Ok'); + $state = get_nonempty_string('State', $out, 'Unknown state'); + $location = get_nonempty_string('Connector Name', $out, 'Unknown location'); + $capacity = get_nonempty_string('Storage Size', $out, 'Unknown size'); + + $capacity =~ s{\[Not Available\]}{Unknown Size}; + } + + $count{sd}++ if $state ne 'Absent'; + next SDCARD if blacklisted('sd', $index); + + if ($status ne 'Ok') { + my $msg = sprintf 'SD Card %d needs attention: %s', + $index, $state; + report('chassis', $msg, $E_WARNING, $index); + } + # Special case: Not Present + elsif ($status eq 'Ok' and $state eq 'Absent') { + my $msg = sprintf 'SD Card %d [%s] is %s', + $index, $location, $state; + report('chassis', $msg, $E_OK, $index); + } + # Ok + else { + my $msg = sprintf 'SD Card %d [%s, %s] is %s', + $index, $location, $capacity, $state; + report('chassis', $msg, $E_OK, $index); + } + } + return; +} + + +#----------------------------------------- # CHASSIS: Check alert log #----------------------------------------- sub check_alertlog { @@ -3963,7 +4078,7 @@ $snmp_session->error; report('other', $msg, $E_UNKNOWN); } - $health = $snmp_status{$result->{$systemStateEventLogStatus}}; + $health = get_snmp_status($result->{$systemStateEventLogStatus}); } else { foreach (@{ run_command("$omreport $omopt_system esmlog -fmt ssv") }) { @@ -4362,7 +4477,9 @@ 14 => 'secondaryBackPlane', # Secondary Backplane for ESM 2 systems 15 => 'secondaryBackPlaneESM3And4', # Secondary Backplane for ESM 3 and 4 systems 16 => 'rac', # Remote Access Controller - 17 => 'imc' # Integrated Management Controller + 17 => 'iDRAC', # Integrated Dell Remote Access Controller + 19 => 'unifiedServerConfigurator', # Unified Server Configurator + 20 => 'lifecycleController', # Lifecycle Controller ); @@ -4372,7 +4489,7 @@ $sysinfo{'bmc'} = 1; $sysinfo{'bmc_fw'} = $out->{firmwareVersionName}; } - elsif ($fw_type{$out->{firmwareType}} =~ m{\A rac|imc \z}xms) { + elsif ($fw_type{$out->{firmwareType}} =~ m{\A rac|iDRAC \z}xms) { my $name = $out->{firmwareTypeName}; $name =~ s/\s//gxms; $sysinfo{'rac'} = 1; $sysinfo{'rac_name'} = $name; @@ -4422,6 +4539,7 @@ if ($check{batteries}) { check_batteries(); } if ($check{amperage}) { check_pwrmonitoring(); } if ($check{intrusion}) { check_intrusion(); } +if ($check{sdcard}) { check_sdcard(); } if ($check{alertlog}) { check_alertlog(); } if ($check{esmlog}) { check_esmlog(); } if ($check{esmhealth}) { check_esmlog_health(); } @@ -4455,11 +4573,21 @@ # Print messages if ($opt{debug}) { - print " System: $sysinfo{model}$sysinfo{rev}\n"; + # finding the mode of operation + my $mode = 'local'; + if ($snmp) { + # Setting the domain (IP version and transport protocol) + my $transport = $opt{tcp} ? 'TCP' : 'UDP'; + my $ipversion = $opt{ipv6} ? 'IPv6' : 'IPv4'; + $mode = "SNMPv$opt{protocol} $transport/$ipversion"; + } + + print " System: $sysinfo{model}$sysinfo{rev}"; + print q{ } x (25 - length "$sysinfo{model}$sysinfo{rev}"), "OMSA version: $sysinfo{om}\n"; print " ServiceTag: $sysinfo{serial}"; - print q{ } x (25 - length $sysinfo{serial}), "OMSA version: $sysinfo{om}\n"; + print q{ } x (25 - length $sysinfo{serial}), "Plugin version: $VERSION\n"; print " BIOS/date: $sysinfo{bios} $sysinfo{biosdate}"; - print q{ } x (25 - length "$sysinfo{bios} $sysinfo{biosdate}"), "Plugin version: $VERSION\n"; + print q{ } x (25 - length "$sysinfo{bios} $sysinfo{biosdate}"), "Checking mode: $mode\n"; if ($#report_storage >= 0) { print "-----------------------------------------------------------------------------\n"; print " Storage Components \n"; @@ -4570,9 +4698,20 @@ 'alertlog' => $snmp ? 'OK - not supported via snmp' : "OK - Alert Log content: $count{alert}{Ok} ok, $count{alert}{'Non-Critical'} warning and $count{alert}{Critical} critical", '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", ); print $okmsg{$opt{only}}; + + # show blacklisted components + if ($opt{show_blacklist} and %blacklist) { + my @blstr = (); + foreach (keys %blacklist) { + push @blstr, "$_=" . join ',', @{ $blacklist{$_} }; + } + print $linebreak; + print "----- BLACKLISTED: " . join '/', @blstr; + } } elsif ($exit_code == $E_OK && !$opt{debug}) { if (defined $opt{htmlinfo}) { @@ -4605,6 +4744,16 @@ print ', not checking storage'; } + # show blacklisted components + if ($opt{show_blacklist} and %blacklist) { + my @blstr = (); + foreach (keys %blacklist) { + push @blstr, "$_=" . join ',', @{ $blacklist{$_} }; + } + print $linebreak; + print "----- BLACKLISTED: " . join '/', @blstr; + } + if ($opt{okinfo} >= 1) { print $linebreak; printf q{----- BIOS='%s %s'}, $sysinfo{bios}, $sysinfo{biosdate}; | ||
[+] | Changed | check_openmanage-3.6.5.tar.bz2/check_openmanage.8 ^ |
@@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "CHECK_OPENMANAGE 8" -.TH CHECK_OPENMANAGE 8 "2010-08-30" "check_openmanage 3.6.0" "Nagios plugin" +.TH CHECK_OPENMANAGE 8 "2011-02-08" "check_openmanage 3.6.5" "Nagios plugin" .SH "NAME" check_openmanage \- Nagios plugin for checking the hardware status on Dell servers running OpenManage @@ -220,6 +220,15 @@ finding it requires running a really slow omreport command, when the plugin is run locally via \s-1NRPE\s0. .RE +.IP "\-B, \-\-show\-blacklist" 4 +.IX Item "-B, --show-blacklist" +If used together with blacklisting, this option will make the plugin +output all blacklistings that are being used. The output will have the +correct blacklisting syntax, and will make it easy to maintain control +over which blacklistings that are used for each server, as any +blacklistings can be viewed from Nagios. +.Sp +When blacklisting is not used, this option has no effect. .IP "\-\-omreport \fI\s-1OMREPORT\s0 \s-1PATH\s0\fR" 4 .IX Item "--omreport OMREPORT PATH" Specify full path to omreport, if it is not installed in any of the @@ -361,6 +370,14 @@ .IX Item "--port PORT" \&\s-1SNMP\s0 port of the remote (monitored) system. Defaults to the well-known \&\s-1SNMP\s0 port 161. +.IP "\-6, \-\-ipv6" 4 +.IX Item "-6, --ipv6" +This option will cause the plugin to use IPv6. The default is IPv4 if +the option is not present. +.IP "\-\-tcp" 4 +.IX Item "--tcp" +This option will cause the plugin to use \s-1TCP\s0 as transport +protocol. The default is \s-1UDP\s0 if the option is not present. .IP "\-U, \-\-username \fI\s-1SECURITYNAME\s0\fR" 4 .IX Item "-U, --username SECURITYNAME" [SNMPv3] The User-based Security Model (\s-1USM\s0) used by SNMPv3 requires @@ -534,6 +551,9 @@ .IP "\fBintr\fR" 8 .IX Item "intr" Intrusion sensor +.IP "\fBsd\fR" 8 +.IX Item "sd" +\&\s-1SD\s0 card .RE .RS 4 .RE @@ -588,6 +608,9 @@ .IP "\fBintrusion\fR" 4 .IX Item "intrusion" Only check chassis intrusion +.IP "\fBsdcard\fR" 4 +.IX Item "sdcard" +Only check \s-1SD\s0 cards .IP "\fBesmhealth\fR" 4 .IX Item "esmhealth" Only check \s-1ESM\s0 log overall health, i.e. fill grade @@ -647,6 +670,9 @@ .IP "\fBintrusion\fR" 4 .IX Item "intrusion" Check chassis intrusion. Default: \s-1ON\s0 +.IP "\fBsdcard\fR" 4 +.IX Item "sdcard" +Check \s-1SD\s0 cards. Default: \s-1ON\s0 .IP "\fBesmhealth\fR" 4 .IX Item "esmhealth" Check the \s-1ESM\s0 log health, i.e. fill grade. Default: \s-1ON\s0 | ||
Changed | check_openmanage-3.6.5.tar.bz2/check_openmanage.exe ^ | |
[+] | Changed | check_openmanage-3.6.5.tar.bz2/check_openmanage.pod ^ |
@@ -2,7 +2,7 @@ # # pod2man -s 8 -r "`./check_openmanage -V | head -n 1`" -c 'Nagios plugin' check_openmanage.pod check_openmanage.8 # -# $Id: check_openmanage.pod 18203 2010-08-30 09:23:22Z trondham $ +# $Id: check_openmanage.pod 19334 2011-02-08 16:41:21Z trondham $ =head1 NAME @@ -109,6 +109,16 @@ finding it requires running a really slow omreport command, when the plugin is run locally via NRPE. +=item -B, --show-blacklist + +If used together with blacklisting, this option will make the plugin +output all blacklistings that are being used. The output will have the +correct blacklisting syntax, and will make it easy to maintain control +over which blacklistings that are used for each server, as any +blacklistings can be viewed from Nagios. + +When blacklisting is not used, this option has no effect. + =item --omreport I<OMREPORT PATH> Specify full path to omreport, if it is not installed in any of the @@ -279,6 +289,16 @@ SNMP port of the remote (monitored) system. Defaults to the well-known SNMP port 161. +=item -6, --ipv6 + +This option will cause the plugin to use IPv6. The default is IPv4 if +the option is not present. + +=item --tcp + +This option will cause the plugin to use TCP as transport +protocol. The default is UDP if the option is not present. + =item -U, --username I<SECURITYNAME> [SNMPv3] The User-based Security Model (USM) used by SNMPv3 requires @@ -492,6 +512,10 @@ Intrusion sensor +=item B<sd> + +SD card + =back =back @@ -565,6 +589,10 @@ Only check chassis intrusion +=item B<sdcard> + +Only check SD cards + =item B<esmhealth> Only check ESM log overall health, i.e. fill grade @@ -641,6 +669,10 @@ Check chassis intrusion. Default: ON +=item B<sdcard> + +Check SD cards. Default: ON + =item B<esmhealth> Check the ESM log health, i.e. fill grade. Default: ON | ||
[+] | Added | check_openmanage-3.6.5.tar.bz2/debian ^ |
+(directory) | ||
[+] | Added | check_openmanage-3.6.5.tar.bz2/debian/README.Debian ^ |
@@ -0,0 +1,11 @@ +check-openmanage for Debian +--------------------------- + +If want to install Dell OpenManage Server Administrator on some of +your Debian servers, take a look at the work done by SARA Reken- en +Netwerkdiensten: https://subtrac.sara.nl/oss/omsa_2_deb + +Here is an old page from Dell also pointing to the work done by +sara.nl: http://linux.dell.com/debian_9g.shtml + + -- Morten Werner Forsbring <werner@debian.org> Sun, 28 Feb 2010 20:01:17 +0100 | ||
[+] | Added | check_openmanage-3.6.5.tar.bz2/debian/changelog ^ |
@@ -0,0 +1,53 @@ +check-openmanage (3.6.5-1) unstable; urgency=low + + * New upstream release. + + -- Trond Hasle Amundsen <t.h.amundsen@usit.uio.no> Wed, 09 Feb 2011 14:27:36 +0100 + +check-openmanage (3.6.4-1) unstable; urgency=low + + * New upstream release. + + -- Trond Hasle Amundsen <t.h.amundsen@usit.uio.no> Tue, 04 Jan 2011 12:30:26 +0100 + +check-openmanage (3.6.3-1) unstable; urgency=low + + * New upstream release. + + -- Trond Hasle Amundsen <t.h.amundsen@usit.uio.no> Mon, 13 Dec 2010 10:49:20 +0100 + +check-openmanage (3.6.2-1) unstable; urgency=low + + * New upstream release. + + -- Trond Hasle Amundsen <t.h.amundsen@usit.uio.no> Tue, 25 Nov 2010 11:41:15 +0100 + +check-openmanage (3.6.1-1) unstable; urgency=low + + * New upstream release. + + -- Trond Hasle Amundsen <t.h.amundsen@usit.uio.no> Tue, 02 Nov 2010 12:12:15 +0100 + +check-openmanage (3.6.0-1) unstable; urgency=low + + * New upstream release. + + -- Trond Hasle Amundsen <t.h.amundsen@usit.uio.no> Mon, 30 Aug 2010 11:21:08 +0200 + +check-openmanage (3.5.10-1) unstable; urgency=low + + * New upstream release. + + -- Trond Hasle Amundsen <t.h.amundsen@usit.uio.no> Wed, 14 Jul 2010 13:44:04 +0200 + +check-openmanage (3.5.9-1) unstable; urgency=low + + * New upstream release. + + -- Trond Hasle Amundsen <t.h.amundsen@usit.uio.no> Wed, 30 Jun 2010 13:21:20 +0200 + +check-openmanage (3.5.8-1) unstable; urgency=low + + * Initial release. + + -- Morten Werner Forsbring <werner@debian.org> Thu, 17 Jun 2010 16:41:15 +0200 | ||
[+] | Added | check_openmanage-3.6.5.tar.bz2/debian/compat ^ |
@@ -0,0 +1 @@ +7 | ||
[+] | Added | check_openmanage-3.6.5.tar.bz2/debian/control ^ |
@@ -0,0 +1,21 @@ +Source: check-openmanage +Section: admin +Priority: extra +Maintainer: Morten Werner Forsbring <werner@debian.org> +Build-Depends: debhelper (>= 7), perl +Standards-Version: 3.8.3 +Homepage: http://folk.uio.no/trondham/software/check_openmanage.html + +Package: check-openmanage +Architecture: all +Depends: ${perl:Depends}, ${misc:Depends} +Suggests: nagios-nrpe-plugin | libnet-snmp-perl +Description: Nagios plugin to monitor hardware health on Dell servers + check_openmanage is a plugin for Nagios which checks the hardware + health of Dell servers running OpenManage Server Administrator + (OMSA). The plugin can be used remotely with SNMP or locally with + NRPE, check_by_ssh or similar, whichever suits your needs and + particular taste. The plugin checks the health of the storage + subsystem, power supplies, memory modules, temperature probes etc., + and gives an alert if any of the components are faulty or operate + outside normal parameters. | ||
[+] | Added | check_openmanage-3.6.5.tar.bz2/debian/copyright ^ |
@@ -0,0 +1,27 @@ +Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 +Name: check_openmanage +Maintainer: Trond Hasle Amundsen <t.h.amundsen@usit.uio.no> +Source: http://folk.uio.no/trondham/software/check_openmanage.html + +Copyright: 2010, Trond Hasle Amundsen <t.h.amundsen@usit.uio.no> +License: GPL-3 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 3 dated June, 2007. + . + On Debian GNU/Linux systems, the complete text of version 3 of the GNU + General Public License can be found in `/usr/share/common-licenses/GPL-3' + +Files: debian/* +Copyright: 2010, Morten Werner Forsbring <werner@debian.org> +Licence: GPL-3+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + On Debian systems, the complete text of the latest version of the GNU + General Public License can be found in `/usr/share/common-licenses/GPL'. + . + The complete text of version 3 of the GNU General Public License can + be found in `/usr/share/common-licenses/GPL-3'. | ||
[+] | Added | check_openmanage-3.6.5.tar.bz2/debian/dirs ^ |
@@ -0,0 +1 @@ +usr/lib/nagios/plugins | ||
[+] | Added | check_openmanage-3.6.5.tar.bz2/debian/docs ^ |
@@ -0,0 +1 @@ +README | ||
[+] | Added | check_openmanage-3.6.5.tar.bz2/debian/rules ^ |
@@ -0,0 +1,60 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +DESTDIR=debian/check-openmanage + +configure: configure-stamp +configure-stamp: + dh_testdir + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + install -p -m 0755 check_openmanage $(DESTDIR)/usr/lib/nagios/plugins + +binary-indep: build install + +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs CHANGES + dh_installdocs + dh_installexamples check_openmanage.php + dh_installman check_openmanage.8 + dh_link + dh_strip + dh_compress + dh_fixperms + dh_perl + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure | ||
[+] | Added | check_openmanage-3.6.5.tar.bz2/nagios-plugins-check-openmanage.spec ^ |
@@ -0,0 +1,187 @@ +# Definitions used throughout the spec file +%global plugin check_openmanage +%global nagiospluginsdir %{_libdir}/nagios/plugins + +# No binaries here, do not build a debuginfo package +%global debug_package %{nil} + +Name: nagios-plugins-check-openmanage +Version: 3.6.5 +Release: 1%{?dist} +Summary: Nagios plugin to monitor hardware health on Dell servers + +Group: Applications/System +License: GPLv3+ +URL: http://folk.uio.no/trondham/software/%{plugin}.html +Source0: http://folk.uio.no/trondham/software/files/%{plugin}-%{version}.tar.gz + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: perl + +Obsoletes: check_openmanage <= 3.6.3-1 + +%description +check_openmanage is a plugin for Nagios which checks the hardware +health of Dell servers running OpenManage Server Administrator +(OMSA). The plugin can be used remotely with SNMP or locally with +NRPE, check_by_ssh or similar, whichever suits your needs and +particular taste. The plugin checks the health of the storage +subsystem, power supplies, memory modules, temperature probes etc., +and gives an alert if any of the components are faulty or operate +outside normal parameters. + +%prep +%setup -q -n %{plugin}-%{version} + +%build +pod2man -s 8 -r "%{plugin} %{version}" -c "Nagios plugin" %{plugin}.pod %{plugin}.8 + +%install +%{__rm} -rf %{buildroot} +%{__install} -d %{buildroot}%{nagiospluginsdir} +%{__install} -d %{buildroot}%{_mandir}/man8 +%{__install} -pD -m 0755 %{plugin} %{buildroot}%{nagiospluginsdir} +%{__install} -pD -m 0644 %{plugin}.8 %{buildroot}%{_mandir}/man8 + +%clean +%{__rm} -rf %{buildroot} + +%files +%defattr(-, root, root, -) +%doc README COPYING CHANGES +%{nagiospluginsdir}/* +%{_mandir}/man8/*.8* + + +%changelog +* Wed Feb 9 2011 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.6.5-1 +- Version 3.6.5 + +* Tue Jan 4 2011 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.6.4-2 +- Don't compress the man page, rpmbuild takes care of that. Thanks to + Jose Pedro Oliveira for a patch that fixes this. + +* Tue Jan 4 2011 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.6.4-1 +- Version 3.6.4 +- Initial build with new spec file +- Spec file adapted to Fedora/EPEL standards + +* Mon Dec 13 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.6.3-1 +- Version 3.6.3 + +* Thu Nov 25 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.6.2-1 +- Version 3.6.2 + +* Tue Nov 2 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.6.1-1 +- Version 3.6.1 + +* Mon Aug 30 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.6.0-1 +- Version 3.6.0 + +* Wed Jul 14 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.10-1 +- Version 3.5.10 + +* Tue Jun 29 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.9-1 +- Version 3.5.9 + +* Thu Jun 17 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.8-1 +- Version 3.5.8 + +* Wed Mar 19 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.7-1 +- Version 3.5.7 + +* Tue Feb 23 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.6-1 +- Version 3.5.6 + +* Fri Jan 22 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.5-1 +- Version 3.5.5 + +* Wed Jan 13 2010 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.4-1 +- Version 3.5.4 + +* Thu Dec 17 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.3-1 +- Version 3.5.3 + +* Tue Nov 17 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.2-1 +- Version 3.5.2 + +* Thu Oct 22 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.1-1 +- Version 3.5.1 + +* Tue Oct 13 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.5.0-1 +- Version 3.5.0 +- New location for the manual page (section 3 -> 8) + +* Fri Aug 7 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.9-1 +- Version 3.4.9 + +* Fri Jul 31 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.8-1 +- Version 3.4.8 + +* Fri Jul 24 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.7-1 +- Version 3.4.7 + +* Tue Jul 7 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.6-1 +- Version 3.4.6 + +* Mon Jun 22 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.5-1 +- Version 3.4.5 + +* Mon Jun 22 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.4-1 +- Version 3.4.4 + +* Thu Jun 11 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.3-1 +- Version 3.4.3 + +* Wed Jun 3 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.2-1 +- Version 3.4.2 + +* Mon May 27 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.1-1 +- Version 3.4.1 + +* Mon May 25 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.4.0-1 +- Version 3.4.0 + +* Tue May 5 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.3.2-1 +- Version 3.3.2 + +* Tue Apr 28 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.3.1-1 +- Version 3.3.1 + +* Tue Apr 7 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.3.0-1 +- Version 3.3.0 + +* Sun Mar 29 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.7-1 +- Version 3.2.7 + +* Thu Mar 5 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.6-1 +- Version 3.2.6 + +* Tue Feb 24 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.5-1 +- Version 3.2.5 +- take 64bit (other libdir) into consideration + +* Tue Feb 17 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.4-1 +- Version 3.2.4 + +* Mon Feb 9 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.3-1 +- Version 3.2.3 + +* Tue Feb 3 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.2-1 +- Version 3.2.2 + +* Tue Feb 3 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.1-1 +- Version 3.2.1 + +* Tue Jan 27 2009 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.2.0-1 +- Version 3.2.0 + +* Sat Dec 20 2008 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.0.2-1 +- Version 3.0.2 + +* Thu Dec 4 2008 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 3.0.0-1 +- Version 3.0.0 + +* Wed Nov 19 2008 Trond H. Amundsen <t.h.amundsen@usit.uio.no> - 2.1.0-0 +- first RPM release |