Bug 1752383

Summary: Nagios check_oracle plugin not compatible with el6.
Product: [Fedora] Fedora EPEL Reporter: Philip Ward <p.g.ward>
Component: nagios-pluginsAssignee: Stephen John Smoogen <smooge>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: el6CC: athmanem, b.heden, herrold, johan.hoeke, kirill.gryaznov, lemenkov, smooge, smooge, ssoto, swilkerson
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: nagios-plugins-2.3.1-1.el7 nagios-plugins-2.3.1-3.el6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-05 00:07:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Philip Ward 2019-09-16 08:50:35 UTC
Description of problem:


Version-Release number of selected component (if applicable):
nagios-plugins-oracle-2.2.1-17.20190829gitfb792ff.el6.x86_64

How reproducible:
Attempt to run check_oracle on an el6 system.

Steps to Reproduce:
1. Install nagios-plugins-oracle
2. Run Check_oracle against your database:
export ORACLE_HOME=/a02/app/oracle/product/12.1.0.2 ; /usr/lib64/nagios/plugins/check_oracle --db <dbname>
3.

Actual results:
pgrep: invalid option -- 'c'
Usage: pgrep [-flvx] [-d DELIM] [-n|-o] [-P PPIDLIST] [-g PGRPLIST] [-s SIDLIST]
  [-u EUIDLIST] [-U UIDLIST] [-G GIDLIST] [-t TERMLIST] [PATTERN]
/usr/lib64/nagios/plugins/check_oracle: line 170: [: : integer expression expected
<dbname> Database is DOWN

Expected results:
<dbname> OK - 1 PMON process(es) running

Additional info:
Line 169 of the check_oracle script uses the -c flag with pgrep. pgrep shipped with el6 (procps-3.2.8-45.el6_9.3.x86_64) does not have the -c flag.

Comment 1 Philip Ward 2019-09-16 08:52:32 UTC
On el6 line 169 of the check_oracle  script reads:

pmonchk=$(pgrep -f -c "(asm|ora|xe)_pmon_${2}$")

Change it to

pmonchk=$(pgrep -f "(asm|ora|xe)_pmon_${2}$" | wc -l)

and the script works.

Comment 2 Stephen John Smoogen 2019-09-16 15:09:06 UTC
Thanks. I will make a patch and put this out in the next couple of days for an update to 2.2.2 which rolled out while this was in testing.

Comment 3 Philip Ward 2019-10-22 14:17:15 UTC
Thanks Stephen. I have just updated to nagios-plugins-oracle-2.2.2-2.20190926git1b8ad57.el6.x86_64 and the bug is back. I assume my report was too close to the release date for the patch to get in?

Comment 4 Kirill Gryaznov 2019-11-20 13:22:01 UTC
Made pull request - https://github.com/nagios-plugins/nagios-plugins/pull/495

Comment 5 Kirill Gryaznov 2019-11-29 12:54:49 UTC
pull request accepted

Comment 6 Stephen John Smoogen 2019-12-10 19:50:31 UTC
*** Bug 1769834 has been marked as a duplicate of this bug. ***

Comment 7 Stephen John Smoogen 2019-12-10 23:18:25 UTC
FEDORA-EPEL-2019-f6182b7356 has been submitted as an update to Fedora EPEL 6.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-f6182b7356

This build should have the fix for this. It is also a major change so I have made the change need 5 karma to get out of testing.

Comment 8 Fedora Update System 2019-12-10 23:36:09 UTC
FEDORA-EPEL-2019-a181371b74 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-a181371b74

Comment 9 Fedora Update System 2019-12-11 17:24:44 UTC
nagios-plugins-2.3.1-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-a181371b74

Comment 10 ssoto 2020-01-02 18:57:41 UTC
Tested EL6 version. Working good!

Comment 11 Fedora Update System 2020-01-05 00:07:16 UTC
nagios-plugins-2.3.1-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 ssoto 2020-01-06 18:53:16 UTC
This issue was closed but the issue was created for a bug in EL6. The EL6 version has not been pushed to stable.

Comment 13 Kirill Gryaznov 2020-01-21 15:45:13 UTC
What is the fix status for EL6?

Comment 14 Fedora Update System 2020-01-28 19:50:44 UTC
FEDORA-EPEL-2020-f97bb3ff1c has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-f97bb3ff1c

Comment 15 Fedora Update System 2020-01-31 02:56:49 UTC
nagios-plugins-2.3.1-3.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-f97bb3ff1c

Comment 16 Fedora Update System 2020-02-15 02:34:32 UTC
nagios-plugins-2.3.1-3.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.