Bug 2329175 - check_openmanage incorrectly reports the version of OpenManage in its output.
Summary: check_openmanage incorrectly reports the version of OpenManage in its output.
Keywords:
Status: NEW
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: nagios-plugins-openmanage
Version: epel8
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Trond H. Amundsen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-11-27 16:53 UTC by Brad Viviano
Modified: 2024-11-27 16:53 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Brad Viviano 2024-11-27 16:53:30 UTC
Description of problem:

When NOT using SNMP, output is reporting the wrong installed version of OMSA.

Version-Release number of selected component (if applicable):

Affects RHEL7 - RHEL9.

nagios-plugins-openmanage-3.7.12-1.el7.x86_64
nagios-plugins-openmanage-3.7.12-1.el8.x86_64
nagios-plugins-openmanage-3.7.12-20.el9.x86_64

I understand that the RHEL7 packages might no longer be updated, I am just reporting for completeness.

How reproducible:

Very

Steps to Reproduce:
1. Install Dell OpenManager Server Administrator (Any Verison) onto a supported Dell server
2. Install nagios-plugins-openmanage
3. Run the check: /usr/lib64/nagios/plugins/check_openmanage -o 3

Actual results:

# /usr/lib64/nagios/plugins/check_openmanage -o 3
OK - System: 'PowerEdge R740', SN: '13DP3Y2', 384 GB ram (12 dimms), 1 logical drives, 3 physical drives
----- BIOS='2.22.2 09/12/2024', iDRAC9='7.00.00.174 (Build 2)'
----- Ctrl 0 [PERC H730P Adapter]: Fw='25.5.9.0001', Dr='07.727.03.00-rc1'
----- Ctrl 1 [12Gbps SAS HBA]: Fw='16.17.01.00', Dr='43.100.00.00'
----- Ctrl 2 [12Gbps SAS HBA]: Fw='16.17.01.00', Dr='43.100.00.00'
----- Ctrl 3 [12Gbps SAS HBA]: Fw='16.17.01.00', Dr='43.100.00.00'
----- Ctrl 4 [12Gbps SAS HBA]: Fw='16.17.01.00', Dr='43.100.00.00'
----- Encl 0:0:1 [Backplane]: Fw='2.52'
----- OpenManage Server Administrator (OMSA) version: '11.0.20'


Expected results:

# /usr/lib64/nagios/plugins/check_openmanage -o 3
OK - System: 'PowerEdge R740', SN: '13DP3Y2', 384 GB ram (12 dimms), 1 logical drives, 3 physical drives
----- BIOS='2.22.2 09/12/2024', iDRAC9='7.00.00.174 (Build 2)'
----- Ctrl 0 [PERC H730P Adapter]: Fw='25.5.9.0001', Dr='07.727.03.00-rc1'
----- Ctrl 1 [12Gbps SAS HBA]: Fw='16.17.01.00', Dr='43.100.00.00'
----- Ctrl 2 [12Gbps SAS HBA]: Fw='16.17.01.00', Dr='43.100.00.00'
----- Ctrl 3 [12Gbps SAS HBA]: Fw='16.17.01.00', Dr='43.100.00.00'
----- Ctrl 4 [12Gbps SAS HBA]: Fw='16.17.01.00', Dr='43.100.00.00'
----- Encl 0:0:1 [Backplane]: Fw='2.52'
----- OpenManage Server Administrator (OMSA) version: '11.1.0.0'

Additional info:

In non-SNMP mode, check_openmanage uses `omreport about` to get the OMSA version information, called in the function `get_omreport_about`:

sub get_omreport_about {
    if (open my $OM, '-|', "$omreport about -fmt ssv") {
        my @lines = <$OM>;
        close $OM;
        foreach (@lines) {
            if (m/\A Version;(.+) \z/xms) {
                $sysinfo{om} = $1;
                chomp $sysinfo{om};
            }
        }
    }
    return;
}

However the output of `omreport about` has 2 lines that match the above RegEx, one for the version of OMSA and one for the version of Java used in OMSA:

# omreport about -fmt ssv

Product name;Dell OpenManage Server Administrator
Version;11.1.0.0
Copyright;Copyright (C) Dell Inc. 1995-2024 All rights reserved.
Company;Dell Inc.
Latest Version;11.1.0.0
;
Latest OpenJDK available for download
Version;11.0.20
Download Link;https://adoptium.net/temurin/releases/?version=11
;

This is causing check_openmange to report the version of Java in the check_openmanage check, NOT the version of OpenManage.

I would propose you make the following change to `get_omreport_about`:

sub get_omreport_about {
    if (open my $OM, '-|', "$omreport about -fmt ssv") {
        my @lines = <$OM>;
        close $OM;
        foreach (@lines) {
            if (m/\A Version;(.+) \z/xms) {
                $sysinfo{om} = $1;
                chomp $sysinfo{om};
                last;
            }
        }
    }
    return;
}

Adding 'last' will cause the foreach loop to abort after the first match, which is the OMSA version and not have it continue on and report the Java version:

# ./check_openmanage -o 3
OK - System: 'PowerEdge R740', SN: '13DP3Y2', 384 GB ram (12 dimms), 1 logical drives, 3 physical drives
----- BIOS='2.22.2 09/12/2024', iDRAC9='7.00.00.174 (Build 2)'
----- Ctrl 0 [PERC H730P Adapter]: Fw='25.5.9.0001', Dr='07.727.03.00-rc1'
----- Ctrl 1 [12Gbps SAS HBA]: Fw='16.17.01.00', Dr='43.100.00.00'
----- Ctrl 2 [12Gbps SAS HBA]: Fw='16.17.01.00', Dr='43.100.00.00'
----- Ctrl 3 [12Gbps SAS HBA]: Fw='16.17.01.00', Dr='43.100.00.00'
----- Ctrl 4 [12Gbps SAS HBA]: Fw='16.17.01.00', Dr='43.100.00.00'
----- Encl 0:0:1 [Backplane]: Fw='2.52'
----- OpenManage Server Administrator (OMSA) version: '11.1.0.0'

Thanks.


Note You need to log in before you can comment on or make changes to this bug.