summaryrefslogtreecommitdiff
path: root/manifests/defaults
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2011-04-12 18:29:54 -0400
committerMicah Anderson <micah@riseup.net>2011-04-12 18:29:54 -0400
commitfb75fcec220f9e2943d2e7af292ff884fd237f6d (patch)
tree26985e0489afcaca384088255bf4b51629856cb4 /manifests/defaults
parent7735baa65f0dc37f94d4854fd62c817de94d64f2 (diff)
Fix nagios check_smtp duplicate definition
On Debian, the nagios-plugins packages install /etc/nagios-plugins/config/mail.cfg which contains the check_smtp/check_imap commands, and these commands cannot be duplicated. The addition of these commands in this module in c9c4f5bb895e98e31d84c751a7fcbdae9bf57008 and 1c4de48baf4ffcf5f39894a101a3c59479959b47 now cause Debian nagios servers to fail to start with this message: Warning: Duplicate definition found for command 'check_smtp' (config file '/etc/starting on line 9) The versions of these check commands that were added in the above commits are actually more full-featured than the ones that Debian ships, most notably because they allow for the port to be passed as an option. In most cases their names are the same, although the imap and pop ssl commands are different. This leads to a somewhat unfortunate situation where the module defines duplicated commands, which are better, but in some cases are differently named than the ones shipped in the package. Ideally, those names would converge, and the debian package commands would add the port options by default, and we'd case out debian/ubuntu to not ship these in this module. However, due to the added benefit of the options provided in the commands shipped in this module, along with the benefits that come with the module being able to automatically configure these, I've elected to simply remove the debian package file (which is a config file, so it will be honored by the packaging system).
Diffstat (limited to 'manifests/defaults')
-rw-r--r--manifests/defaults/commands.pp6
1 files changed, 6 insertions, 0 deletions
diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp
index 0a7ad4f..9068c63 100644
--- a/manifests/defaults/commands.pp
+++ b/manifests/defaults/commands.pp
@@ -6,6 +6,12 @@ class nagios::defaults::commands {
# common service commands
case $operatingsystem {
debian,ubuntu: {
+ # debian and ubuntu ship the nagios::command::smtp and
+ # nagios::command::imap_pop3 commands in the nagios-plugins packages,
+ # which are placed in /etc/nagios-plugins/config/mail.cfg, however they
+ # are inferior to the ones provided in this module below because they do
+ # not provide port options, so we just remove them
+ file { '/etc/nagios-plugins/config/mail.cfg': ensure => absent; }
nagios_command {
check_dummy:
command_line => '$USER1$/check_dummy $ARG1$';