Bug 1138943

Summary: [Nagios] - Discovery.py does not check for the correctness of nagios configuration before restarting nagios service
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: RamaKasturi <knarra>
Component: nagios-server-addonsAssignee: Ramesh N <rnachimu>
Status: CLOSED ERRATA QA Contact: RamaKasturi <knarra>
Severity: high Docs Contact:
Priority: unspecified    
Version: rhgs-3.0CC: asrivast, dpati, psriniva, rhsc-qe-bugs, rnachimu, sharne
Target Milestone: ---Keywords: ZStream
Target Release: RHGS 3.0.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nagios-server-addons-0.1.7-1.el6rhs Doc Type: Bug Fix
Doc Text:
Previously, the auto-config service tried to restart the Nagios service though there was a configuration error. As a result, auto-config service reported a message: "restarted nagios successfully", though the Nagios service was not running. With this fix, changes are made to check the configuration before restarting Nagios service.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-01-15 13:49:36 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:
Bug Depends On:    
Bug Blocks: 1087818    

Description RamaKasturi 2014-09-06 15:43:40 UTC
Description of problem:
Discovery.py does not check for the correctness of email and snmp config files and says "nagios restarted sucessfully" where as nagios would not have restarted sucessfully.

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


How reproducible:
nagios-server-addons-0.1.5-1.el6rhs.noarch

Steps to Reproduce:
1. Install nagios on a rhel machine.
2. Configure nagios on RHS nodes.
3. Now add some contact in gluster-templates.cfg which does not exist.

Actual results:
When discovery.py is run, script says nagios sucessfully restarted, where as nagios is stopped.

Expected results:
When discovery.py is run, script should check the correctness of all config the files which is used by nagios.

Additional info:

Comment 1 Ramesh N 2014-09-09 05:27:27 UTC
We can run 'nagios -v /etc/nagios/nagios.cfg' to check the correctness of the nagios configuration before restarting the Nagios.

Upstream patch http://review.gluster.org/#/c/8131/ will address this use case.

Comment 3 Ramesh N 2014-09-17 09:22:26 UTC
Fixed in upstream patch http://review.gluster.org/#/c/8131/.

Comment 4 Shalaka 2014-09-21 04:01:34 UTC
Please review and sign-off edited doc text.

Comment 5 Ramesh N 2014-09-22 07:14:40 UTC
The discovery.py script does not check the correctness of the nagios configuration (syntax check).So nagios restart may fail if there is some config error in the nagios configuration. Its not specific to email configuration, but for the any nagois configuration.

Note: I don't think accuracy is the right word here. We cann't verify the accuracy like verifying the correctness of email address by sending mail.

Comment 7 RamaKasturi 2014-10-17 05:42:32 UTC
From kanagaraj, i understand that these bugs have been moved to on_qa by errata. 

Since QE has not yet received the build i am moving this bug back to assigned state. Please move it on to on_qa once builds are attached to errata.

Comment 8 RamaKasturi 2014-11-14 05:35:24 UTC
Verified and works fine with build nagios-server-addons-0.1.8-1.el6rhs.noarch

When discovery.py is run and when email and snmp configs are not proper it says "CONFIG ERROR ! Check your Nagios configuration".

Comment 9 Pavithra 2014-12-24 09:07:47 UTC
Hi Ramesh,

Can you please review the edited doc text for technical accuracy and sign off?

Comment 10 Ramesh N 2014-12-24 11:45:52 UTC
Doc text looks good to me

Comment 12 errata-xmlrpc 2015-01-15 13:49:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0039.html