Path to 'mail' incorrect in /etc/nagios2/commands.cfg

Bug #231004 reported by Erik Forsberg
2
Affects Status Importance Assigned to Milestone
nagios2 (Debian)
Fix Released
Unknown
nagios2 (Ubuntu)
Invalid
Low
Unassigned
Hardy
Fix Released
Low
Unassigned

Bug Description

Binary package hint: nagios2

/etc/nagios2/commands.cfg defines several commands used as service_notification_command and host_notification_command. Unfortunately, the path to the program used to send mail is wrong - it's set to /bin/mail, should be /usr/bin/mail, at least with the 'mailx' program which seems to be the best candidate.

# lsb_release -rd
Description: Ubuntu 8.04
Release: 8.04

# apt-cache policy nagios2
nagios2:
  Installed: 2.11-1ubuntu1
  Candidate: 2.11-1ubuntu1
  Version table:
 *** 2.11-1ubuntu1 0
        500 http://se.archive.ubuntu.com hardy/universe Packages
        100 /var/lib/dpkg/status

Revision history for this message
Erik Forsberg (forsberg) wrote :
Revision history for this message
Lionel Porcheron (lionel.porcheron) wrote :

Thanks for the bug report and the patch. Looks a good candidate for SRU.

Changed in nagios2:
assignee: nobody → lionel.porcheron
importance: Undecided → Medium
status: New → Confirmed
Changed in nagios2:
status: Unknown → New
Revision history for this message
Thierry Carrez (ttx) wrote :

I looked into it and this problem is the result of several problems in the package building.

debian/rules calls configure with --use-mail=/usr/bin/mail so Nagios should generate default config files with the good pointer.
However there is no mailx | mailutils in the build dependencies so, when configure doublechecks it, it goes back to the default (/bin/mail).
Therefore the default configs are generated with /bin/mail rather than /usr/bin/mail.

It would be sufficient to add mailx | mailutils in the build dependencies if there weren't a new round of patching done afterwards with cfg-commands.cfg.diff. This diff-file needs to be changed too to keep track of the changes.

I'll do a debdiff and check if the problem is still there in nagios3.

Revision history for this message
Thierry Carrez (ttx) wrote :

This was fixed in nagios3 (upstream fixed the configure script so that it no longer ignores --use-mail, no need to add mailx | mailutils as build dep). I backport the fix for nagios2.

Revision history for this message
Thierry Carrez (ttx) wrote :

Here is the debdiff with the configure fix (backported from Nagios 3) and fixup of the cfg-commands.cfg.diff file so that it doesn't break with the new contents. Not sure this is SRU material though -- the problem being in a configuration file, in an off-by-default notification...

Revision history for this message
Mathias Gug (mathiaz) wrote :

Subscribing the motu-sru team as outlined on https://wiki.ubuntu.com/StableReleaseUpdates. Once motu-sru has acked the proposal, subscribe the ubuntu-universe-sponsor team to sponsor your debdiff.

You should also target hardy-proposed instead of hardy in your changelog.

Revision history for this message
Thierry Carrez (ttx) wrote :

Fixed debdiff with hardy-proposed as a target.

Thierry Carrez (ttx)
Changed in nagios2:
assignee: lionel.porcheron → tcarrez
Revision history for this message
Thierry Carrez (ttx) wrote :

I need to work more on this, especially since there is a security update in the pipe that I should merge in. MOTU-sru, feel free to unsubscribe...

Changed in nagios2:
status: Confirmed → In Progress
Revision history for this message
Thierry Carrez (ttx) wrote :

Minimal patch from 2.11-ubuntu1.2 version.

Revision history for this message
Thierry Carrez (ttx) wrote : Minimal patch

Minimal patch from 2.11-ubuntu1.2 version, added proper patch attribution to Erik.

Revision history for this message
Thierry Carrez (ttx) wrote : SRU Report

Bug Impact: nagios2 is configured by default with notification commands that make use of /bin/mail rather than /usr/bin/mail. That forces all Nagios users to fix this default configuration file if they want to make use of mail-based notifications (which is a very common use case). This is more a "user experience of Ubuntu integration" bug, and it can easily be workaround-ed with a one-time config file fix.

Affected supported releases: feisty, gutsy, hardy. Given the type of bug (only first-time installs affected) I would propose SRU-ing it for hardy only.

Development branch fix: nagios3 is shipped with Intrepid. This series has a configure file fix that allows to generate correct default configuration files in the build process.

Minimal patch: see previous comment.

TEST CASE:
$ sudo apt-get install nagios2
$ grep mail /etc/nagios2/commands.cfg
[ shows that commands.cfg calls /bin/mail for notification commands, should be /usr/bin/mail ]

I can also provide a more complex test case (involving Nagios configuration) where those notifications would be used and trigger an error message.

Regression potential discussion:
This update only impacts the commands.cfg file, to replace occurences of /bin/mail with /usr/bin/mail. I don't think it could break anything.

Changed in nagios2:
importance: Medium → Low
status: In Progress → Confirmed
Revision history for this message
Cody A.W. Somerville (cody-somerville) wrote :

Ack.

Revision history for this message
Thierry Carrez (ttx) wrote :

No nagios2 in intrepid, so this is "fixed" in the development release. nagios3 doesn't have this bug.

Changed in nagios2:
status: New → Confirmed
assignee: tcarrez → nobody
status: Confirmed → Invalid
Revision history for this message
Thierry Carrez (ttx) wrote :

Combined SRU with bug 252686

Revision history for this message
Luca Falavigna (dktrkranz) wrote :

Uploaded to hardy-proposed as 2.11-1ubuntu1.3.

Changed in nagios2:
importance: Undecided → Low
Revision history for this message
Jonathan Riddell (jr) wrote :

accepted into hardy-proposed, please test

Changed in nagios2:
status: Confirmed → Fix Committed
Revision history for this message
ShadowMax76 (shadowmax76) wrote :

Verification done (x86):

- nagios2 2.11-1ubuntu1.2 (hardy): /bin/mail.
- nagios2 2.11-1ubuntu1.3 (hardy-proposed): /usr/bin/mail.

Revision history for this message
Luca Falavigna (dktrkranz) wrote :

I can confirm version 2.11-1ubuntu1.3 correctly provides /usr/bin/mail in configuration file.

Revision history for this message
Martin Pitt (pitti) wrote :

Copied to hardy-updates.

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

Other bug subscribers

Remote bug watches

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