HOSTALIAS doesn't update after changing config files

Bug #1234376 reported by Filipegiusti
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
nagios3 (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Fix Released
High
Unassigned

Bug Description

[Impact]
Under nagios 3.2.3 with state retention enabled, any host aliases or display names assigned to a host would be persisted into the retention file, and would supersede subsequent configuration changes. As a result, changes to either hosts' aliases or display names would not be reflected in either the nagios CGI interface or notification macros (like HOSTALIAS)

There are numerous references to this bug online, including several upstream nagios issues:
http://tracker.nagios.org/view.php?id=238
http://tracker.nagios.org/view.php?id=272

And several blog posts:
http://ten-fingers-and-a-brain.com/2011/10/nagios-doesnt-update-the-host-alias-macro-%E2%80%93-workaround/
http://www.claudiokuenzler.com/blog/179/nagios-notifications-contain-wrong-host-alias-name#.VIZph-pGjUY

[Test Case]
Although the bug is in nagios3-core, it's easiest to observe using nagios3-cgi:

1. Install nagios3-cgi
2. Edit /etc/nagios3/cgi.cfg and set use_authentication=0
3. Edit /etc/apache2/conf.d/nagios3.conf and remove the AuthName, AuthType, AuthUserFile, and require lines
4. Restart apache2 to pick up the new config
5. Open http://localhost/cgi-bin/nagios3/extinfo.cgi?type=1&host=localhost
6. Observe that the host is described as "Host localhost (localhost)" - "localhost" is both the host name and the alias
7. Edit /etc/nagios3/conf.d/localhost_nagios2.cfg and change alias to "otherhost" (line 10 or so)
8. Restart nagios3 to pick up the new config
9. Open http://localhost/cgi-bin/nagios3/extinfo.cgi?type=1&host=localhost again

Buggy behavior: host is still described as "Host localhost (localhost)"
Fixed behavior: host description is updated to "Host otherhost (localhost)" to reflect alias change

[Regression Potential]
It's difficult to understand what the upstream intent was when this bug was introduced to know if it's addressing a broader issue - both the introduction and resolution of the issue lack useful commentary in the commit messages.

However, this patch is definitely a behavior change: previously changes to the disk configuration would not be reflected in the nagios runtime configuration without manual intervention. It's possible there are use cases which rely on this behavior. However, it seems unlikely to me that a user would change a configuration file and restart the daemon and not intend for those changes to take effect

This issue has proven to be frustrating to our usage of nagios in production, and my belief is that fixing it would create less net confusion than leaving it. However, maybe that's not enough to satisfy the SRU bar.

Outside of that change, the patch is very narrow and regression potential seems low.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nagios3 (Ubuntu):
status: New → Confirmed
Evan Broder (broder)
Changed in nagios3 (Ubuntu Precise):
status: New → Confirmed
Changed in nagios3 (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Evan Broder (broder) wrote :
description: updated
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Evan, I sponsored that one

Changed in nagios3 (Ubuntu Precise):
status: Confirmed → In Progress
importance: Undecided → High
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Filipegiusti, or anyone else affected,

Accepted nagios3 into precise-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/nagios3/3.2.3-3ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in nagios3 (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Evan Broder (broder) wrote :

Thanks for the approvals, Sebastian and Brian.

I've repeated the steps I outlined in the description and confirmed that the bug does not occur with the packages in -proposed. I've also installed the packages in our production nagios server and confirmed that things seem to more or less work as expected.

tags: added: verification-done
removed: verification-needed
Mathew Hodson (mhodson)
tags: added: precise
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for nagios3 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nagios3 - 3.2.3-3ubuntu1.1

---------------
nagios3 (3.2.3-3ubuntu1.1) precise-proposed; urgency=low

  * Don't retain host aliases or display names (LP: #1234376)
 -- Evan Broder <email address hidden> Mon, 08 Dec 2014 18:32:34 -0800

Changed in nagios3 (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.