From 83d9e8613d3d1b16b69f30dd24fbbf84867f61df Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sat, 25 Dec 2010 17:52:38 -0500 Subject: add in the missing --warning and --critical options to check_mysql_health --- manifests/service/mysql.pp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/service/mysql.pp b/manifests/service/mysql.pp index d501f06..6b68b73 100644 --- a/manifests/service/mysql.pp +++ b/manifests/service/mysql.pp @@ -20,7 +20,15 @@ define nagios::service::mysql( if ($check_host == 'absent') { fail("Please specify a hostname, ip address or socket to check a mysql instance.") } + + if $check_warning != undef { + $real_check_warning = "--warning $check_warning" + } + if $check_critical != undef { + $real_check_critical = "--critical $check_critical" + } + case $check_mode { 'tcp': { if ($check_host == 'localhost') { @@ -42,6 +50,6 @@ define nagios::service::mysql( nagios::service { "mysql_health_${name}": ensure => $ensure, - check_command => "check_mysql_health!${check_host}!${check_port}!${check_username}!${check_password}!${name}!${check_database}", + check_command => "check_mysql_health!${check_host}!${check_port}!${check_username}!${check_password}!${real_check_warning}${real_check_critical}${name}!${check_database}", } } -- cgit v1.2.3 From 89d7f78db3ede8c9a343f115b13d6e4f12b1fe7a Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sat, 25 Dec 2010 17:54:04 -0500 Subject: fix check_mysql_health real_check_host variable --- manifests/service/mysql.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/service/mysql.pp b/manifests/service/mysql.pp index 6b68b73..96b63c6 100644 --- a/manifests/service/mysql.pp +++ b/manifests/service/mysql.pp @@ -50,6 +50,6 @@ define nagios::service::mysql( nagios::service { "mysql_health_${name}": ensure => $ensure, - check_command => "check_mysql_health!${check_host}!${check_port}!${check_username}!${check_password}!${real_check_warning}${real_check_critical}${name}!${check_database}", + check_command => "check_mysql_health!${real_check_host}!${check_port}!${check_username}!${check_password}!${real_check_warning}${real_check_critical}${name}!${check_database}", } } -- cgit v1.2.3 From d51c4fb34ba3cc9df45186b5eb556d45d298b05c Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sat, 25 Dec 2010 18:26:22 -0500 Subject: fix the --warning --critical by appending it as optional ending arguments in the command specifier --- manifests/defaults/commands.pp | 2 +- manifests/service/mysql.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp index 25ab1bc..20e0d7b 100644 --- a/manifests/defaults/commands.pp +++ b/manifests/defaults/commands.pp @@ -93,7 +93,7 @@ class nagios::defaults::commands { # from mysql module check_mysql_health: - command_line => '$USER1$/check_mysql_health --hostname $ARG1$ --port $ARG2$ --username $ARG3$ --password $ARG4$ --mode $ARG5$ --database $ARG6$'; + command_line => '$USER1$/check_mysql_health --hostname $ARG1$ --port $ARG2$ --username $ARG3$ --password $ARG4$ --mode $ARG5$ --database $ARG6$ $ARG7$ $ARG8$'; } # notification commands diff --git a/manifests/service/mysql.pp b/manifests/service/mysql.pp index 96b63c6..ab4d8db 100644 --- a/manifests/service/mysql.pp +++ b/manifests/service/mysql.pp @@ -50,6 +50,6 @@ define nagios::service::mysql( nagios::service { "mysql_health_${name}": ensure => $ensure, - check_command => "check_mysql_health!${real_check_host}!${check_port}!${check_username}!${check_password}!${real_check_warning}${real_check_critical}${name}!${check_database}", + check_command => "check_mysql_health!${real_check_host}!${check_port}!${check_username}!${check_password}!${name}!${check_database}!${real_check_warning}!${real_check_critical}", } } -- cgit v1.2.3 From 6c74be1b9365826063d8298acd73f8c5717531ff Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sat, 25 Dec 2010 18:51:18 -0500 Subject: it might be that having ! when there are no arguments will cause nagios to be unhappy, so lets only put them in when we have arguments to pass --- manifests/service/mysql.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'manifests') diff --git a/manifests/service/mysql.pp b/manifests/service/mysql.pp index ab4d8db..7ebdd85 100644 --- a/manifests/service/mysql.pp +++ b/manifests/service/mysql.pp @@ -22,11 +22,11 @@ define nagios::service::mysql( } if $check_warning != undef { - $real_check_warning = "--warning $check_warning" + $real_check_warning = "!--warning $check_warning" } if $check_critical != undef { - $real_check_critical = "--critical $check_critical" + $real_check_critical = "!--critical $check_critical" } case $check_mode { @@ -50,6 +50,6 @@ define nagios::service::mysql( nagios::service { "mysql_health_${name}": ensure => $ensure, - check_command => "check_mysql_health!${real_check_host}!${check_port}!${check_username}!${check_password}!${name}!${check_database}!${real_check_warning}!${real_check_critical}", + check_command => "check_mysql_health!${real_check_host}!${check_port}!${check_username}!${check_password}!${name}!${check_database}${real_check_warning}${real_check_critical}", } } -- cgit v1.2.3 From fb75fcec220f9e2943d2e7af292ff884fd237f6d Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 12 Apr 2011 18:29:54 -0400 Subject: 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). --- manifests/defaults/commands.pp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'manifests') 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$'; -- cgit v1.2.3 From 43cc87a174f53062fa04990faf046ece9ab76f66 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 12 Apr 2011 19:01:38 -0400 Subject: add imap and pop service definitions --- manifests/service/imap.pp | 32 ++++++++++++++++++++++++++++++++ manifests/service/pop.pp | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 manifests/service/imap.pp create mode 100644 manifests/service/pop.pp (limited to 'manifests') diff --git a/manifests/service/imap.pp b/manifests/service/imap.pp new file mode 100644 index 0000000..063231d --- /dev/null +++ b/manifests/service/imap.pp @@ -0,0 +1,32 @@ +define nagios::service::imap( + $ensure = 'present', + $host = 'absent', + $port = '143', + $tls = true, + $tls_port = '993' +){ + + $real_host = $host ? { + 'absent' => $name, + default => $host + } + + nagios::service{ + "imap_${name}_${port}": + ensure => $ensure; + "imaps_${name}_${tls_port}": + ensure => $tls ? { + true => ensure, + default => 'absent' + }; + } + + if $ensure != 'absent' { + Nagios::Service["imap_${name}_${port}"]{ + check_command => "check_imap!${real_host}!${port}", + } + Nagios::Service["imaps_${name}_${tls_port}"]{ + check_command => "check_imap_ssl!${real_host}!${tls_port}", + } + } +} diff --git a/manifests/service/pop.pp b/manifests/service/pop.pp new file mode 100644 index 0000000..3b87afc --- /dev/null +++ b/manifests/service/pop.pp @@ -0,0 +1,32 @@ +define nagios::service::pop( + $ensure = 'present', + $host = 'absent', + $port = '110', + $tls = true, + $tls_port = '995' +){ + + $real_host = $host ? { + 'absent' => $name, + default => $host + } + + nagios::service{ + "pop_${name}_${port}": + ensure => $ensure; + "pops_${name}_${tls_port}": + ensure => $tls ? { + true => ensure, + default => 'absent' + }; + } + + if $ensure != 'absent' { + Nagios::Service["pop_${name}_${port}"]{ + check_command => "check_pop3!${real_host}!${port}", + } + Nagios::Service["pops_${name}_${tls_port}"]{ + check_command => "check_pop3_ssl!${real_host}!${tls_port}", + } + } +} -- cgit v1.2.3 From 6b1b71b9007ecc938754a6b256d9f5b7cc63c780 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 12 Apr 2011 19:18:02 -0400 Subject: fix typo in imap/pop services --- manifests/service/imap.pp | 2 +- manifests/service/pop.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/service/imap.pp b/manifests/service/imap.pp index 063231d..b703db4 100644 --- a/manifests/service/imap.pp +++ b/manifests/service/imap.pp @@ -16,7 +16,7 @@ define nagios::service::imap( ensure => $ensure; "imaps_${name}_${tls_port}": ensure => $tls ? { - true => ensure, + true => $ensure, default => 'absent' }; } diff --git a/manifests/service/pop.pp b/manifests/service/pop.pp index 3b87afc..9ec4aec 100644 --- a/manifests/service/pop.pp +++ b/manifests/service/pop.pp @@ -16,7 +16,7 @@ define nagios::service::pop( ensure => $ensure; "pops_${name}_${tls_port}": ensure => $tls ? { - true => ensure, + true => $ensure, default => 'absent' }; } -- cgit v1.2.3 From fae5aaef210a09a8b7b46b00ed36721d9beb83af Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 12 Apr 2011 19:41:05 -0400 Subject: add check_git command to debian/ubuntu as well --- manifests/defaults/commands.pp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'manifests') diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp index 9068c63..f5fface 100644 --- a/manifests/defaults/commands.pp +++ b/manifests/defaults/commands.pp @@ -35,6 +35,8 @@ class nagios::defaults::commands { command_line => '$USER1$/check_tcp -H $ARG1$ -p $ARG2$'; check_jabber: command_line => '$USER1$/check_jabber -H $ARG1$'; + check_git: + command_line => '$USER1$/check_tcp -H $ARG1$ -p 9418'; } } default: { -- cgit v1.2.3 From 673a61cec6ce8209ed5a169cd53da7bcf9ba94d6 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 19 Apr 2011 15:14:11 -0400 Subject: fix check_health_mode parameter --- manifests/service/mysql.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/service/mysql.pp b/manifests/service/mysql.pp index 7ebdd85..1b7bf81 100644 --- a/manifests/service/mysql.pp +++ b/manifests/service/mysql.pp @@ -50,6 +50,6 @@ define nagios::service::mysql( nagios::service { "mysql_health_${name}": ensure => $ensure, - check_command => "check_mysql_health!${real_check_host}!${check_port}!${check_username}!${check_password}!${name}!${check_database}${real_check_warning}${real_check_critical}", + check_command => "check_mysql_health!${real_check_host}!${check_port}!${check_username}!${check_password}!${check_health_mode}!${check_database}${real_check_warning}${real_check_critical}", } } -- cgit v1.2.3 From b5d1ad97b2b33d9a64991616ebe42bc9e0be8737 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 19 Apr 2011 16:19:10 -0400 Subject: add the potential for the --name to be set for arbitrary sql commands --- manifests/service/mysql.pp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/service/mysql.pp b/manifests/service/mysql.pp index 1b7bf81..2fde402 100644 --- a/manifests/service/mysql.pp +++ b/manifests/service/mysql.pp @@ -21,6 +21,10 @@ define nagios::service::mysql( fail("Please specify a hostname, ip address or socket to check a mysql instance.") } + if $check_name != undef { + $real_check_name = "!--name $check_name" + } + if $check_warning != undef { $real_check_warning = "!--warning $check_warning" } @@ -50,6 +54,6 @@ define nagios::service::mysql( nagios::service { "mysql_health_${name}": ensure => $ensure, - check_command => "check_mysql_health!${real_check_host}!${check_port}!${check_username}!${check_password}!${check_health_mode}!${check_database}${real_check_warning}${real_check_critical}", + check_command => "check_mysql_health!${real_check_host}!${check_port}!${check_username}!${check_password}!${check_health_mode}!${check_database}${real_check_name}${real_check_warning}${real_check_critical}", } } -- cgit v1.2.3 From 5bfc4bb9490b0001343ffe011aea978c36f3e1f3 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 28 Apr 2011 17:12:24 -0400 Subject: fix formatting to be standard --- manifests/irc_bot.pp | 162 +++++++++++++++++++++++++-------------------------- 1 file changed, 81 insertions(+), 81 deletions(-) (limited to 'manifests') diff --git a/manifests/irc_bot.pp b/manifests/irc_bot.pp index 961755a..31d7add 100644 --- a/manifests/irc_bot.pp +++ b/manifests/irc_bot.pp @@ -1,93 +1,93 @@ class nagios::irc_bot { - if ( ! ($nagios_nsa_server and $nagios_nsa_nickname and $nagios_nsa_channel) ) { - fail("Please provide values at least for \$nagios_nsa_server, \$nagios_nsa_nickname and \$nagios_nsa_channel") - } + if ( ! ($nagios_nsa_server and $nagios_nsa_nickname and $nagios_nsa_channel) ) { + fail("Please provide values at least for \$nagios_nsa_server, \$nagios_nsa_nickname and \$nagios_nsa_channel") + } - $nagios_nsa_socket = $nagios_nsa_socket ? { - '' => $operatingsystem ? { - centos => '/var/run/nagios-nsa/nsa.socket', - default => '/var/run/nagios3/nsa.socket' - }, - default => $nagios_nsa_socket, - } - $nagios_nsa_pidfile = $nagios_nsa_pidfile ? { - '' => $operatingsystem ? { - centos => '/var/run/nagios-nsa/nsa.pid', - default => '/var/run/nagios3/nsa.pid' - }, - default => $nagios_nsa_pidfile, - } - $nagios_nsa_port = $nagios_nsa_port ? { - '' => '6667', - default => $nagios_nsa_port, - } - $nagios_nsa_realname = $nagios_nsa_realname ? { - '' => 'Nagios', - default => $nagios_nsa_realname, - } + $nagios_nsa_socket = $nagios_nsa_socket ? { + '' => $operatingsystem ? { + centos => '/var/run/nagios-nsa/nsa.socket', + default => '/var/run/nagios3/nsa.socket' + }, + default => $nagios_nsa_socket, + } + $nagios_nsa_pidfile = $nagios_nsa_pidfile ? { + '' => $operatingsystem ? { + centos => '/var/run/nagios-nsa/nsa.pid', + default => '/var/run/nagios3/nsa.pid' + }, + default => $nagios_nsa_pidfile, + } + $nagios_nsa_port = $nagios_nsa_port ? { + '' => '6667', + default => $nagios_nsa_port, + } + $nagios_nsa_realname = $nagios_nsa_realname ? { + '' => 'Nagios', + default => $nagios_nsa_realname, + } - if (! $nagios_nsa_password) { - $nagios_nsa_password = '' - } + if (! $nagios_nsa_password) { + $nagios_nsa_password = '' + } - file { "/usr/local/bin/riseup-nagios-client.pl": - owner => root, group => root, mode => 0755, - source => "puppet:///modules/nagios/irc_bot/riseup-nagios-client.pl", - } - file { "/usr/local/bin/riseup-nagios-server.pl": - owner => root, group => root, mode => 0755, - source => "puppet:///modules/nagios/irc_bot/riseup-nagios-server.pl", - } - file { "/etc/init.d/nagios-nsa": - owner => root, group => root, mode => 0755, - content => template("nagios/irc_bot/${operatingsystem}/nagios-nsa.sh.erb"), - require => File["/usr/local/bin/riseup-nagios-server.pl"], - } - file { "/etc/nagios_nsa.cfg": - ensure => present, - owner => nagios, group => root, mode => 0400, - content => template('nagios/irc_bot/nsa.cfg.erb'), - } + file { "/usr/local/bin/riseup-nagios-client.pl": + owner => root, group => root, mode => 0755, + source => "puppet:///modules/nagios/irc_bot/riseup-nagios-client.pl", + } + file { "/usr/local/bin/riseup-nagios-server.pl": + owner => root, group => root, mode => 0755, + source => "puppet:///modules/nagios/irc_bot/riseup-nagios-server.pl", + } + file { "/etc/init.d/nagios-nsa": + owner => root, group => root, mode => 0755, + content => template("nagios/irc_bot/${operatingsystem}/nagios-nsa.sh.erb"), + require => File["/usr/local/bin/riseup-nagios-server.pl"], + } + file { "/etc/nagios_nsa.cfg": + ensure => present, + owner => nagios, group => root, mode => 0400, + content => template('nagios/irc_bot/nsa.cfg.erb'), + } - package { "libnet-irc-perl": - ensure => present, - } + package { "libnet-irc-perl": + ensure => present, + } - service { "nagios-nsa": - ensure => "running", - hasstatus => true, - require => [File["/etc/nagios_nsa.cfg"], - Package["libnet-irc-perl"], - Service['nagios'] ], - } + service { "nagios-nsa": + ensure => "running", + hasstatus => true, + require => [File["/etc/nagios_nsa.cfg"], + Package["libnet-irc-perl"], + Service['nagios'] ], + } - case $operatingsystem { - centos: { - Package['libnet-irc-perl']{ - name => 'perl-Net-IRC', - } - Service['nagios-nsa']{ - enable => true, - } - } - debian,ubuntu: { - exec { "nagios_nsa_init_script": - command => "/usr/sbin/update-rc.d nagios-nsa defaults", - unless => "/bin/ls /etc/rc3.d/ | /bin/grep nagios-nsa", - require => File["/etc/init.d/nagios-nsa"], - before => Service['nagios-nsa'], - } + case $operatingsystem { + centos: { + Package['libnet-irc-perl']{ + name => 'perl-Net-IRC', + } + Service['nagios-nsa']{ + enable => true, + } + } + debian,ubuntu: { + exec { "nagios_nsa_init_script": + command => "/usr/sbin/update-rc.d nagios-nsa defaults", + unless => "/bin/ls /etc/rc3.d/ | /bin/grep nagios-nsa", + require => File["/etc/init.d/nagios-nsa"], + before => Service['nagios-nsa'], } } + } - nagios_command { - "notify-by-irc": - command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($SERVICEDESC$) $NOTIFICATIONTYPE$ n.$SERVICEATTEMPT$ $SERVICESTATETYPE$ $SERVICEEXECUTIONTIME$s $SERVICELATENCY$s $SERVICEOUTPUT$ $SERVICEPERFDATA$"'; - "host-notify-by-irc": - command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($HOSTALIAS$) $NOTIFICATIONTYPE$ n.$HOSTATTEMPT$ $HOSTSTATETYPE$ took $HOSTEXECUTIONTIME$s $HOSTOUTPUT$ $HOSTPERFDATA$ $HOSTLATENCY$s"'; - } + nagios_command { + "notify-by-irc": + command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($SERVICEDESC$) $NOTIFICATIONTYPE$ n.$SERVICEATTEMPT$ $SERVICESTATETYPE$ $SERVICEEXECUTIONTIME$s $SERVICELATENCY$s $SERVICEOUTPUT$ $SERVICEPERFDATA$"'; + "host-notify-by-irc": + command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($HOSTALIAS$) $NOTIFICATIONTYPE$ n.$HOSTATTEMPT$ $HOSTSTATETYPE$ took $HOSTEXECUTIONTIME$s $HOSTOUTPUT$ $HOSTPERFDATA$ $HOSTLATENCY$s"'; + } - if $use_shorewall { - include shorewall::rules::out::irc - } + if $use_shorewall { + include shorewall::rules::out::irc + } } -- cgit v1.2.3 From 4827958dda15705ac1eeb5eacc7e694a92bb7a5d Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 28 Apr 2011 17:43:49 -0400 Subject: add configuration variable to irc bot to enable IRC notice type messages which can be turned on by the puppet variable $nagios_nsa_usenotices --- manifests/irc_bot.pp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'manifests') diff --git a/manifests/irc_bot.pp b/manifests/irc_bot.pp index 31d7add..130f46f 100644 --- a/manifests/irc_bot.pp +++ b/manifests/irc_bot.pp @@ -30,6 +30,10 @@ class nagios::irc_bot { $nagios_nsa_password = '' } + if (! $nagios_nsa_usenotices) { + $nagios_nsa_usenotices = '' + } + file { "/usr/local/bin/riseup-nagios-client.pl": owner => root, group => root, mode => 0755, source => "puppet:///modules/nagios/irc_bot/riseup-nagios-client.pl", -- cgit v1.2.3 From 237e886f2ede3b830d28cf5e000dd5d95d8a343a Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 13 Jul 2011 19:19:44 -0300 Subject: Ensure commands.cfg exists The file commands.cfg was introduced at 61aab91919b2e6d9cb5d7afe3befe40de67ac132. This change make sure the file exists so nagios doesn't stop running. --- manifests/base.pp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'manifests') diff --git a/manifests/base.pp b/manifests/base.pp index 8b96308..589e98b 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -26,6 +26,13 @@ class nagios::base { mode => 0644, owner => root, group => root; } + file { 'nagios_commands_cfg': + path => "${nagios::defaults::vars::int_nagios_cfgdir}/commands.cfg", + ensure => present, + notify => Service['nagios'], + mode => 0644, owner => root, group => root; + } + file { 'nagios_cgi_cfg': path => "${nagios::defaults::vars::int_nagios_cfgdir}/cgi.cfg", source => [ "puppet:///modules/site-nagios/configs/${fqdn}/cgi.cfg", -- cgit v1.2.3 From 5df607a33d87ba8ab86a4116669ed2bc61c7131c Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 13 Jul 2011 19:53:37 -0300 Subject: Debian doesn't need explicit check_smtp definition This plugin is already defined at nagios-plugins, so removing it for the same reason as e7f85f647e6f641bd85fbdfdb26982350f782370. --- manifests/command/smtp.pp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/command/smtp.pp b/manifests/command/smtp.pp index 04f8543..5cb777e 100644 --- a/manifests/command/smtp.pp +++ b/manifests/command/smtp.pp @@ -1,7 +1,11 @@ class nagios::command::smtp { nagios_command{ 'check_smtp': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$'; + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$', + ensure => $operatingsystem ? { + debian,ubuntu => absent, + default => present, + }; 'check_smtp_tls': command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; 'check_smtp_cert': -- cgit v1.2.3 From 86a6c028e16a09cdbc2458c117b405898c885688 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 13 Jul 2011 20:03:04 -0300 Subject: Debian doesn't need explicit check_smtp definition (2) This plugin is already defined at nagios-plugins, so removing it for the same reason as e7f85f647e6f641bd85fbdfdb26982350f782370. This commit has more readable implementation than the previous. --- manifests/command/smtp.pp | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) (limited to 'manifests') diff --git a/manifests/command/smtp.pp b/manifests/command/smtp.pp index 5cb777e..e4df505 100644 --- a/manifests/command/smtp.pp +++ b/manifests/command/smtp.pp @@ -1,18 +1,30 @@ class nagios::command::smtp { - nagios_command{ - 'check_smtp': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$', - ensure => $operatingsystem ? { - debian,ubuntu => absent, - default => present, - }; - 'check_smtp_tls': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; - 'check_smtp_cert': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; - 'check_ssmtp': - command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S'; - 'check_ssmtp_cert': - command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; + case $operatingsystem { + debian,ubuntu: { + nagios_command{ + 'check_smtp_tls': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; + 'check_smtp_cert': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; + 'check_ssmtp': + command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S'; + 'check_ssmtp_cert': + command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; + } + } + default: { + nagios_command{ + 'check_smtp': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$'; + 'check_smtp_tls': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; + 'check_smtp_cert': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; + 'check_ssmtp': + command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S'; + 'check_ssmtp_cert': + command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; + } + } } } -- cgit v1.2.3 From 4c16852f285db60ff0006326e8bed11a2384d74f Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 13 Jul 2011 20:12:10 -0300 Subject: Do not define check_ssmtp on debian --- manifests/command/smtp.pp | 2 -- 1 file changed, 2 deletions(-) (limited to 'manifests') diff --git a/manifests/command/smtp.pp b/manifests/command/smtp.pp index e4df505..f320f1c 100644 --- a/manifests/command/smtp.pp +++ b/manifests/command/smtp.pp @@ -6,8 +6,6 @@ class nagios::command::smtp { command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; 'check_smtp_cert': command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; - 'check_ssmtp': - command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S'; 'check_ssmtp_cert': command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; } -- cgit v1.2.3 From c46fa52e5b14e1c3e121d43bb3a9561158be2729 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 13 Jul 2011 20:19:31 -0300 Subject: Do not define check_imap on debian --- manifests/command/imap_pop3.pp | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) (limited to 'manifests') diff --git a/manifests/command/imap_pop3.pp b/manifests/command/imap_pop3.pp index 174b09c..082a360 100644 --- a/manifests/command/imap_pop3.pp +++ b/manifests/command/imap_pop3.pp @@ -1,14 +1,31 @@ class nagios::command::imap_pop3 { - nagios_command{ - 'check_imap': - command_line => '$USER1$/check_imap -H $ARG1$ -p $ARG2$'; - 'check_imap_ssl': - command_line => '$USER1$/check_imap -H $ARG1$ -p $ARG2$ -S'; - 'check_pop3': - command_line => '$USER1$/check_pop -H $ARG1$ -p $ARG2$'; - 'check_pop3_ssl': - command_line => '$USER1$/check_pop -H $ARG1$ -p $ARG2$ -S'; - 'check_managesieve': - command_line => '$USER1$/check_tcp -H $ARG1$ -p 2000'; + case $operatingsystem { + debian,ubuntu: { + nagios_command { + 'check_imap_ssl': + command_line => '$USER1$/check_imap -H $ARG1$ -p $ARG2$ -S'; + 'check_pop3': + command_line => '$USER1$/check_pop -H $ARG1$ -p $ARG2$'; + 'check_pop3_ssl': + command_line => '$USER1$/check_pop -H $ARG1$ -p $ARG2$ -S'; + 'check_managesieve': + command_line => '$USER1$/check_tcp -H $ARG1$ -p 2000'; + } + } + default: { + nagios_command { + 'check_imap': + command_line => '$USER1$/check_imap -H $ARG1$ -p $ARG2$'; + 'check_imap_ssl': + command_line => '$USER1$/check_imap -H $ARG1$ -p $ARG2$ -S'; + 'check_pop3': + command_line => '$USER1$/check_pop -H $ARG1$ -p $ARG2$'; + 'check_pop3_ssl': + command_line => '$USER1$/check_pop -H $ARG1$ -p $ARG2$ -S'; + 'check_managesieve': + command_line => '$USER1$/check_tcp -H $ARG1$ -p 2000'; + } + } } + } -- cgit v1.2.3 From 55ac508405e87bdab99ac0cbe0eacac28a8f60b8 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 13 Jul 2011 20:19:48 -0300 Subject: Minor style change --- manifests/command/smtp.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/command/smtp.pp b/manifests/command/smtp.pp index f320f1c..a887e0a 100644 --- a/manifests/command/smtp.pp +++ b/manifests/command/smtp.pp @@ -1,7 +1,7 @@ class nagios::command::smtp { case $operatingsystem { debian,ubuntu: { - nagios_command{ + nagios_command { 'check_smtp_tls': command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; 'check_smtp_cert': @@ -11,7 +11,7 @@ class nagios::command::smtp { } } default: { - nagios_command{ + nagios_command { 'check_smtp': command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$'; 'check_smtp_tls': -- cgit v1.2.3 From 3567924a0365c6241053cb6f244da5ac453b14ba Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Thu, 14 Jul 2011 02:03:26 -0400 Subject: Change IRC notifications to #/#max To give a little more info/meaning on what the number $SERVICEATTEMPT$ is, change the current notification from "... n.$SERVICEATTEMPT$" to "... $SERVICEATTEMPT$/$MAXSERVICEATTEMPTS$". --- manifests/irc_bot.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/irc_bot.pp b/manifests/irc_bot.pp index 961755a..8f9b62d 100644 --- a/manifests/irc_bot.pp +++ b/manifests/irc_bot.pp @@ -82,9 +82,9 @@ class nagios::irc_bot { nagios_command { "notify-by-irc": - command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($SERVICEDESC$) $NOTIFICATIONTYPE$ n.$SERVICEATTEMPT$ $SERVICESTATETYPE$ $SERVICEEXECUTIONTIME$s $SERVICELATENCY$s $SERVICEOUTPUT$ $SERVICEPERFDATA$"'; + command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($SERVICEDESC$) $NOTIFICATIONTYPE$ $SERVICEATTEMPT$/$MAXSERVICEATTEMPTS$ $SERVICESTATETYPE$ $SERVICEEXECUTIONTIME$s $SERVICELATENCY$s $SERVICEOUTPUT$ $SERVICEPERFDATA$"'; "host-notify-by-irc": - command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($HOSTALIAS$) $NOTIFICATIONTYPE$ n.$HOSTATTEMPT$ $HOSTSTATETYPE$ took $HOSTEXECUTIONTIME$s $HOSTOUTPUT$ $HOSTPERFDATA$ $HOSTLATENCY$s"'; + command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($HOSTALIAS$) $NOTIFICATIONTYPE$ $HOSTATTEMPT$/$MAXHOSTATTEMPTS$ $HOSTSTATETYPE$ took $HOSTEXECUTIONTIME$s $HOSTOUTPUT$ $HOSTPERFDATA$ $HOSTLATENCY$s"'; } if $use_shorewall { -- cgit v1.2.3 From 388b8bb30d35454f2467805f37571af74c83b939 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Thu, 14 Jul 2011 02:05:26 -0400 Subject: Add a dependency between the IRC bot config and service When we modify the config file, we'd like for the service to restart in order for it to use the new configuration. --- manifests/irc_bot.pp | 1 + 1 file changed, 1 insertion(+) (limited to 'manifests') diff --git a/manifests/irc_bot.pp b/manifests/irc_bot.pp index 8f9b62d..04bed58 100644 --- a/manifests/irc_bot.pp +++ b/manifests/irc_bot.pp @@ -47,6 +47,7 @@ class nagios::irc_bot { ensure => present, owner => nagios, group => root, mode => 0400, content => template('nagios/irc_bot/nsa.cfg.erb'), + notify => Service["nagios-nsa"], } package { "libnet-irc-perl": -- cgit v1.2.3 From e64f3a2fcc19bf6da3f81807531df740c3930657 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Thu, 14 Jul 2011 03:45:18 -0400 Subject: IRC bot: add a 'disabled' class For when you need to ensure that the bot doesn't start on a server. --- manifests/irc_bot/disabled.pp | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 manifests/irc_bot/disabled.pp (limited to 'manifests') diff --git a/manifests/irc_bot/disabled.pp b/manifests/irc_bot/disabled.pp new file mode 100644 index 0000000..812ef94 --- /dev/null +++ b/manifests/irc_bot/disabled.pp @@ -0,0 +1,5 @@ +class nagios::irc_bot::disabled inherits nagios::irc_bot { + Service['nagios-nsa'] { + ensure => stopped, + } +} -- cgit v1.2.3 From cde75b06b4484f705218c2ef28d49ff545d75f84 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Thu, 14 Jul 2011 05:01:09 -0400 Subject: IRC-bot: use 'enable' for Debian Since the service "disable" bug was fixed in the debian service provider [1] in the puppet 2.6.2-5 package in squeeze, let's switch from the manual calls to the "enable" feature. [1]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=573551 Also add a requirement between service[nagios-nsa] and file[/etc/init.d/nagios-nsa]. This was ensured in Debian with the exec that we're now replacing but didn't find its way through the centosification. --- manifests/irc_bot.pp | 15 +++------------ manifests/irc_bot/disabled.pp | 1 + 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'manifests') diff --git a/manifests/irc_bot.pp b/manifests/irc_bot.pp index 04bed58..494f0c3 100644 --- a/manifests/irc_bot.pp +++ b/manifests/irc_bot.pp @@ -57,7 +57,9 @@ class nagios::irc_bot { service { "nagios-nsa": ensure => "running", hasstatus => true, + enable => true, require => [File["/etc/nagios_nsa.cfg"], + File["/etc/init.d/nagios-nsa"], Package["libnet-irc-perl"], Service['nagios'] ], } @@ -65,18 +67,7 @@ class nagios::irc_bot { case $operatingsystem { centos: { Package['libnet-irc-perl']{ - name => 'perl-Net-IRC', - } - Service['nagios-nsa']{ - enable => true, - } - } - debian,ubuntu: { - exec { "nagios_nsa_init_script": - command => "/usr/sbin/update-rc.d nagios-nsa defaults", - unless => "/bin/ls /etc/rc3.d/ | /bin/grep nagios-nsa", - require => File["/etc/init.d/nagios-nsa"], - before => Service['nagios-nsa'], + name => 'perl-Net-IRC', } } } diff --git a/manifests/irc_bot/disabled.pp b/manifests/irc_bot/disabled.pp index 812ef94..83ff15a 100644 --- a/manifests/irc_bot/disabled.pp +++ b/manifests/irc_bot/disabled.pp @@ -1,5 +1,6 @@ class nagios::irc_bot::disabled inherits nagios::irc_bot { Service['nagios-nsa'] { ensure => stopped, + enable => false, } } -- cgit v1.2.3 From 71cb2551a8f1a5a879f33f4da59dd663b038d949 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Thu, 14 Jul 2011 06:19:40 -0400 Subject: IRC-bot: rename nagios::irc_bot::disabled to nagios::irc_bot::disable All classes serving the same purpose as this one are called 'disable', so let's follow this standard. --- manifests/irc_bot/disable.pp | 8 ++++++++ manifests/irc_bot/disabled.pp | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 manifests/irc_bot/disable.pp delete mode 100644 manifests/irc_bot/disabled.pp (limited to 'manifests') diff --git a/manifests/irc_bot/disable.pp b/manifests/irc_bot/disable.pp new file mode 100644 index 0000000..d6b7c55 --- /dev/null +++ b/manifests/irc_bot/disable.pp @@ -0,0 +1,8 @@ +class nagios::irc_bot::disable inherits nagios::irc_bot::base { + + Service['nagios-nsa'] { + ensure => stopped, + enable => false, + } + +} diff --git a/manifests/irc_bot/disabled.pp b/manifests/irc_bot/disabled.pp deleted file mode 100644 index 83ff15a..0000000 --- a/manifests/irc_bot/disabled.pp +++ /dev/null @@ -1,6 +0,0 @@ -class nagios::irc_bot::disabled inherits nagios::irc_bot { - Service['nagios-nsa'] { - ensure => stopped, - enable => false, - } -} -- cgit v1.2.3 From db9b47560068218125cfb82b0a19a491cffba002 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Thu, 14 Jul 2011 07:03:12 -0400 Subject: IRC-bot: split up manifests by OS This gives us the possibility of using the nagios::irc_bot::disable class without having any config variable set. When using nagios::irc_bot, we still get yelled at when we didn't define the appropriate variables. While we're moving the code around, change the group applied on the different files from 'root' to '0' for better portability. --- manifests/irc_bot.pp | 81 +++++---------------------------------------- manifests/irc_bot/base.pp | 65 ++++++++++++++++++++++++++++++++++++ manifests/irc_bot/centos.pp | 7 ++++ 3 files changed, 81 insertions(+), 72 deletions(-) create mode 100644 manifests/irc_bot/base.pp create mode 100644 manifests/irc_bot/centos.pp (limited to 'manifests') diff --git a/manifests/irc_bot.pp b/manifests/irc_bot.pp index 494f0c3..59f7ed4 100644 --- a/manifests/irc_bot.pp +++ b/manifests/irc_bot.pp @@ -3,80 +3,17 @@ class nagios::irc_bot { fail("Please provide values at least for \$nagios_nsa_server, \$nagios_nsa_nickname and \$nagios_nsa_channel") } - $nagios_nsa_socket = $nagios_nsa_socket ? { - '' => $operatingsystem ? { - centos => '/var/run/nagios-nsa/nsa.socket', - default => '/var/run/nagios3/nsa.socket' - }, - default => $nagios_nsa_socket, - } - $nagios_nsa_pidfile = $nagios_nsa_pidfile ? { - '' => $operatingsystem ? { - centos => '/var/run/nagios-nsa/nsa.pid', - default => '/var/run/nagios3/nsa.pid' - }, - default => $nagios_nsa_pidfile, - } - $nagios_nsa_port = $nagios_nsa_port ? { - '' => '6667', - default => $nagios_nsa_port, - } - $nagios_nsa_realname = $nagios_nsa_realname ? { - '' => 'Nagios', - default => $nagios_nsa_realname, - } - - if (! $nagios_nsa_password) { - $nagios_nsa_password = '' - } - - file { "/usr/local/bin/riseup-nagios-client.pl": - owner => root, group => root, mode => 0755, - source => "puppet:///modules/nagios/irc_bot/riseup-nagios-client.pl", - } - file { "/usr/local/bin/riseup-nagios-server.pl": - owner => root, group => root, mode => 0755, - source => "puppet:///modules/nagios/irc_bot/riseup-nagios-server.pl", - } - file { "/etc/init.d/nagios-nsa": - owner => root, group => root, mode => 0755, - content => template("nagios/irc_bot/${operatingsystem}/nagios-nsa.sh.erb"), - require => File["/usr/local/bin/riseup-nagios-server.pl"], - } - file { "/etc/nagios_nsa.cfg": - ensure => present, - owner => nagios, group => root, mode => 0400, - content => template('nagios/irc_bot/nsa.cfg.erb'), - notify => Service["nagios-nsa"], - } - - package { "libnet-irc-perl": - ensure => present, - } - - service { "nagios-nsa": - ensure => "running", - hasstatus => true, - enable => true, - require => [File["/etc/nagios_nsa.cfg"], - File["/etc/init.d/nagios-nsa"], - Package["libnet-irc-perl"], - Service['nagios'] ], - } - case $operatingsystem { - centos: { - Package['libnet-irc-perl']{ - name => 'perl-Net-IRC', + centos: { + $nagios_nsa_default_socket = '/var/run/nagios-nsa/nsa.socket' + $nagios_nsa_default_pidfile = '/var/run/nagios-nsa/nsa.pid' + include nagios::irc_bot::centos + } + default: { + $nagios_nsa_default_socket = '/var/run/nagios3/nsa.socket' + $nagios_nsa_default_pidfile = '/var/run/nagios3/nsa.pid' + include nagios::irc_bot::base } - } - } - - nagios_command { - "notify-by-irc": - command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($SERVICEDESC$) $NOTIFICATIONTYPE$ $SERVICEATTEMPT$/$MAXSERVICEATTEMPTS$ $SERVICESTATETYPE$ $SERVICEEXECUTIONTIME$s $SERVICELATENCY$s $SERVICEOUTPUT$ $SERVICEPERFDATA$"'; - "host-notify-by-irc": - command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($HOSTALIAS$) $NOTIFICATIONTYPE$ $HOSTATTEMPT$/$MAXHOSTATTEMPTS$ $HOSTSTATETYPE$ took $HOSTEXECUTIONTIME$s $HOSTOUTPUT$ $HOSTPERFDATA$ $HOSTLATENCY$s"'; } if $use_shorewall { diff --git a/manifests/irc_bot/base.pp b/manifests/irc_bot/base.pp new file mode 100644 index 0000000..2c9b27b --- /dev/null +++ b/manifests/irc_bot/base.pp @@ -0,0 +1,65 @@ +class nagios::irc_bot::base { + + # Default values for the two first variables are defined in nagios::irc_bot + $nagios_nsa_socket = $nagios_nsa_socket ? { + '' => $nagios_nsa_default_socket, + default => $nagios_nsa_socket, + } + $nagios_nsa_pidfile = $nagios_nsa_pidfile ? { + '' => $nagios_nsa_default_pidfile, + default => $nagios_nsa_pidfile, + } + $nagios_nsa_port = $nagios_nsa_port ? { + '' => '6667', + default => $nagios_nsa_port, + } + $nagios_nsa_realname = $nagios_nsa_realname ? { + '' => 'Nagios', + default => $nagios_nsa_realname, + } + + if (! $nagios_nsa_password) { + $nagios_nsa_password = '' + } + + file { "/usr/local/bin/riseup-nagios-client.pl": + owner => root, group => 0, mode => 0755, + source => "puppet:///modules/nagios/irc_bot/riseup-nagios-client.pl", + } + file { "/usr/local/bin/riseup-nagios-server.pl": + owner => root, group => 0, mode => 0755, + source => "puppet:///modules/nagios/irc_bot/riseup-nagios-server.pl", + } + file { "/etc/init.d/nagios-nsa": + owner => root, group => 0, mode => 0755, + content => template("nagios/irc_bot/${operatingsystem}/nagios-nsa.sh.erb"), + require => File["/usr/local/bin/riseup-nagios-server.pl"], + } + file { "/etc/nagios_nsa.cfg": + ensure => present, + owner => nagios, group => 0, mode => 0400, + content => template('nagios/irc_bot/nsa.cfg.erb'), + notify => Service["nagios-nsa"], + } + + package { "libnet-irc-perl": + ensure => present, + } + + service { "nagios-nsa": + ensure => "running", + hasstatus => true, + enable => true, + require => [File["/etc/nagios_nsa.cfg"], + File["/etc/init.d/nagios-nsa"], + Package["libnet-irc-perl"], + Service['nagios'] ], + } + + nagios_command { + "notify-by-irc": + command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($SERVICEDESC$) $NOTIFICATIONTYPE$ $SERVICEATTEMPT$/$MAXSERVICEATTEMPTS$ $SERVICESTATETYPE$ $SERVICEEXECUTIONTIME$s $SERVICELATENCY$s $SERVICEOUTPUT$ $SERVICEPERFDATA$"'; + "host-notify-by-irc": + command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($HOSTALIAS$) $NOTIFICATIONTYPE$ $HOSTATTEMPT$/$MAXHOSTATTEMPTS$ $HOSTSTATETYPE$ took $HOSTEXECUTIONTIME$s $HOSTOUTPUT$ $HOSTPERFDATA$ $HOSTLATENCY$s"'; + } +} diff --git a/manifests/irc_bot/centos.pp b/manifests/irc_bot/centos.pp new file mode 100644 index 0000000..e77e93a --- /dev/null +++ b/manifests/irc_bot/centos.pp @@ -0,0 +1,7 @@ +class nagios::irc_bot::centos inherits nagios::irc_bot::base { + + Package['libnet-irc-perl']{ + name => 'perl-Net-IRC', + } + +} -- cgit v1.2.3 From 69b346b34c981b91e068222b15a8a825f08344c2 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 14 Jul 2011 13:05:08 -0300 Subject: Branching the definition for smtp, imap and pop3 commands --- manifests/command/imap_pop3.pp | 41 ++++++++++++++++------------------------- manifests/command/smtp.pp | 40 +++++++++++++++++----------------------- 2 files changed, 33 insertions(+), 48 deletions(-) (limited to 'manifests') diff --git a/manifests/command/imap_pop3.pp b/manifests/command/imap_pop3.pp index 082a360..3735136 100644 --- a/manifests/command/imap_pop3.pp +++ b/manifests/command/imap_pop3.pp @@ -1,31 +1,22 @@ class nagios::command::imap_pop3 { case $operatingsystem { - debian,ubuntu: { - nagios_command { - 'check_imap_ssl': - command_line => '$USER1$/check_imap -H $ARG1$ -p $ARG2$ -S'; - 'check_pop3': - command_line => '$USER1$/check_pop -H $ARG1$ -p $ARG2$'; - 'check_pop3_ssl': - command_line => '$USER1$/check_pop -H $ARG1$ -p $ARG2$ -S'; - 'check_managesieve': - command_line => '$USER1$/check_tcp -H $ARG1$ -p 2000'; - } - } - default: { - nagios_command { - 'check_imap': - command_line => '$USER1$/check_imap -H $ARG1$ -p $ARG2$'; - 'check_imap_ssl': - command_line => '$USER1$/check_imap -H $ARG1$ -p $ARG2$ -S'; - 'check_pop3': - command_line => '$USER1$/check_pop -H $ARG1$ -p $ARG2$'; - 'check_pop3_ssl': - command_line => '$USER1$/check_pop -H $ARG1$ -p $ARG2$ -S'; - 'check_managesieve': - command_line => '$USER1$/check_tcp -H $ARG1$ -p 2000'; - } + debian,ubuntu: { } # Debian/Ubuntu already define those checks + default: { + nagios_command { + 'check_imap': + command_line => '$USER1$/check_imap -H $ARG1$ -p $ARG2$'; } + } } + nagios_command { + 'check_imap_ssl': + command_line => '$USER1$/check_imap -H $ARG1$ -p $ARG2$ -S'; + 'check_pop3': + command_line => '$USER1$/check_pop -H $ARG1$ -p $ARG2$'; + 'check_pop3_ssl': + command_line => '$USER1$/check_pop -H $ARG1$ -p $ARG2$ -S'; + 'check_managesieve': + command_line => '$USER1$/check_tcp -H $ARG1$ -p 2000'; + } } diff --git a/manifests/command/smtp.pp b/manifests/command/smtp.pp index a887e0a..29d97f8 100644 --- a/manifests/command/smtp.pp +++ b/manifests/command/smtp.pp @@ -1,28 +1,22 @@ class nagios::command::smtp { case $operatingsystem { - debian,ubuntu: { - nagios_command { - 'check_smtp_tls': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; - 'check_smtp_cert': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; - 'check_ssmtp_cert': - command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; - } - } - default: { - nagios_command { - 'check_smtp': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$'; - 'check_smtp_tls': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; - 'check_smtp_cert': - command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; - 'check_ssmtp': - command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S'; - 'check_ssmtp_cert': - command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; - } + debian,ubuntu: { } # Debian/Ubuntu already define those checks + default: { + nagios_command { + 'check_smtp': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$'; + 'check_ssmtp': + command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S'; } + } + } + + nagios_command { + 'check_smtp_tls': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S'; + 'check_smtp_cert': + command_line => '$USER1$/check_smtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; + 'check_ssmtp_cert': + command_line => '$USER1$/check_ssmtp -H $ARG1$ -p $ARG2$ -S -D $ARG3$'; } } -- cgit v1.2.3 From e7de46c5516d3784acb7e258d0af40b88fc36e3a Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 15 Sep 2011 14:28:33 -0300 Subject: Host alerts not parsing variables due to excessive escaping (#3456) --- manifests/defaults/commands.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp index f542d7b..15c4478 100644 --- a/manifests/defaults/commands.pp +++ b/manifests/defaults/commands.pp @@ -125,7 +125,7 @@ class nagios::defaults::commands { nagios_command { 'notify-host-by-email': - command_line => "/usr/bin/printf \"%b\" \"***** Nagios *****\\n\\nNotification Type: \$NOTIFICATIONTYPE\$\\nHost: \\$HOSTNAME\\$\\nState: \$HOSTSTATE\$\\nAddress: \$HOSTADDRESS\$\\nInfo: \$HOSTOUTPUT\$\\n\\nDate/Time: \$LONGDATETIME\$\\n\" | ${mail_cmd_location} -s \"** \$NOTIFICATIONTYPE\$ Host Alert: \$HOSTNAME\$ is \$HOSTSTATE\$ **\" \$CONTACTEMAIL\$"; + command_line => "/usr/bin/printf \"%b\" \"***** Nagios *****\\n\\nNotification Type: \$NOTIFICATIONTYPE\$\\nHost: \$HOSTNAME\$\\nState: \$HOSTSTATE\$\\nAddress: \$HOSTADDRESS\$\\nInfo: \$HOSTOUTPUT\$\\n\\nDate/Time: \$LONGDATETIME\$\\n\" | ${mail_cmd_location} -s \"** \$NOTIFICATIONTYPE\$ Host Alert: \$HOSTNAME\$ is \$HOSTSTATE\$ **\" \$CONTACTEMAIL\$"; 'notify-service-by-email': command_line => "/usr/bin/printf \"%b\" \"***** Nagios *****\\n\\nNotification Type: \$NOTIFICATIONTYPE\$\\n\\nService: \$SERVICEDESC\$\\nHost: \$HOSTALIAS\$\\nAddress: \$HOSTADDRESS\$\\nState: \$SERVICESTATE\$\\n\\nDate/Time: \$LONGDATETIME\$\\n\\nAdditional Info:\\n\\n\$SERVICEOUTPUT\$\" | ${mail_cmd_location} -s \"** \$NOTIFICATIONTYPE\$ Service Alert: \$HOSTALIAS\$/\$SERVICEDESC\$ is \$SERVICESTATE\$ **\" \$CONTACTEMAIL\$"; } -- cgit v1.2.3 From 59da6a08e1b6d32c018098992e6ab597998afa94 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 8 Dec 2011 16:36:21 -0500 Subject: Revert "Fix nagios check_smtp duplicate definition" This reverts commit fb75fcec220f9e2943d2e7af292ff884fd237f6d. Reverted due to LeLutin's comments in #3310 and the fix implemented in #3298 in preparation of merging those --- manifests/defaults/commands.pp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'manifests') diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp index f5fface..ea30a07 100644 --- a/manifests/defaults/commands.pp +++ b/manifests/defaults/commands.pp @@ -6,12 +6,6 @@ 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$'; -- cgit v1.2.3 From 8e364f5929156827bc767d828b9c56b7144758fc Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 15 Jul 2011 17:36:42 +0200 Subject: it is not anymore necessary to add an empty source to purge directories --- manifests/base.pp | 3 --- 1 file changed, 3 deletions(-) (limited to 'manifests') diff --git a/manifests/base.pp b/manifests/base.pp index 589e98b..e770cf8 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -53,7 +53,6 @@ class nagios::base { file { 'nagios_private': path => "${nagios::defaults::vars::int_nagios_cfgdir}/private/", - source => "puppet:///modules/common/empty", ensure => directory, purge => true, recurse => true, @@ -71,7 +70,6 @@ class nagios::base { file { 'nagios_confd': path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/", - source => "puppet:///modules/common/empty", ensure => directory, purge => true, recurse => true, @@ -189,7 +187,6 @@ class nagios::base { # must be defined after exported resource overrides and cfg file defs file { 'nagios_cfgdir': path => "${nagios::defaults::vars::int_nagios_cfgdir}/", - source => "puppet:///modules/common/empty", ensure => directory, recurse => true, purge => true, -- cgit v1.2.3 From 32da5faa192dc00f781bdb679aafbc0f41ac180d Mon Sep 17 00:00:00 2001 From: "Christian G. Warden" Date: Wed, 1 Feb 2012 16:56:49 -0800 Subject: Fully qualify facter variables to suppress warnings merge conflict due to immerda's branch not being up-to-date on the bot --- manifests/apache.pp | 2 +- manifests/base.pp | 12 ++++++------ manifests/defaults/commands.pp | 4 ++-- manifests/defaults/templates.pp | 4 ++-- manifests/defaults/vars.pp | 2 +- manifests/init.pp | 4 ++-- manifests/irc_bot.pp | 2 +- manifests/irc_bot/base.pp | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) (limited to 'manifests') diff --git a/manifests/apache.pp b/manifests/apache.pp index c560e5b..6acf538 100644 --- a/manifests/apache.pp +++ b/manifests/apache.pp @@ -2,7 +2,7 @@ class nagios::apache inherits ::apache { $nagios_httpd = 'apache' include nagios - case $operatingsystem { + case $::operatingsystem { 'debian': { file { "${nagios::defaults::vars::int_nagios_cfgdir}/apache2.conf": ensure => present, diff --git a/manifests/base.pp b/manifests/base.pp index e770cf8..3e3f0e1 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -18,9 +18,9 @@ class nagios::base { file { 'nagios_main_cfg': path => "${nagios::defaults::vars::int_nagios_cfgdir}/nagios.cfg", source => [ "puppet:///modules/site-nagios/configs/${fqdn}/nagios.cfg", - "puppet:///modules/site-nagios/configs/${operatingsystem}/nagios.cfg", + "puppet:///modules/site-nagios/configs/${::operatingsystem}/nagios.cfg", "puppet:///modules/site-nagios/configs/nagios.cfg", - "puppet:///modules/nagios/configs/${operatingsystem}/nagios.cfg", + "puppet:///modules/nagios/configs/${::operatingsystem}/nagios.cfg", "puppet:///modules/nagios/configs/nagios.cfg" ], notify => Service['nagios'], mode => 0644, owner => root, group => root; @@ -36,9 +36,9 @@ class nagios::base { file { 'nagios_cgi_cfg': path => "${nagios::defaults::vars::int_nagios_cfgdir}/cgi.cfg", source => [ "puppet:///modules/site-nagios/configs/${fqdn}/cgi.cfg", - "puppet:///modules/site-nagios/configs/${operatingsystem}/cgi.cfg", + "puppet:///modules/site-nagios/configs/${::operatingsystem}/cgi.cfg", "puppet:///modules/site-nagios/configs/cgi.cfg", - "puppet:///modules/nagios/configs/${operatingsystem}/cgi.cfg", + "puppet:///modules/nagios/configs/${::operatingsystem}/cgi.cfg", "puppet:///modules/nagios/configs/cgi.cfg" ], mode => '0644', owner => 'root', group => 0, notify => Service['apache'], @@ -62,8 +62,8 @@ class nagios::base { file { 'nagios_private_resource_cfg': path => "${nagios::defaults::vars::int_nagios_cfgdir}/private/resource.cfg", - source => [ "puppet:///modules/site-nagios/configs/${operatingsystem}/private/resource.cfg.${architecture}", - "puppet:///modules/nagios/configs/${operatingsystem}/private/resource.cfg.${architecture}" ], + source => [ "puppet:///modules/site-nagios/configs/${::operatingsystem}/private/resource.cfg.${::architecture}", + "puppet:///modules/nagios/configs/${::operatingsystem}/private/resource.cfg.${::architecture}" ], notify => Service['nagios'], owner => root, group => nagios, mode => '0640'; } diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp index 1213485..aefed8a 100644 --- a/manifests/defaults/commands.pp +++ b/manifests/defaults/commands.pp @@ -4,7 +4,7 @@ class nagios::defaults::commands { include nagios::command::imap_pop3 # common service commands - case $operatingsystem { + case $::operatingsystem { debian,ubuntu: { nagios_command { check_dummy: @@ -124,7 +124,7 @@ class nagios::defaults::commands { # notification commands - $mail_cmd_location = $operatingsystem ? { + $mail_cmd_location = $::operatingsystem ? { centos => '/bin/mail', default => '/usr/bin/mail' } diff --git a/manifests/defaults/templates.pp b/manifests/defaults/templates.pp index c97eee4..aec97c0 100644 --- a/manifests/defaults/templates.pp +++ b/manifests/defaults/templates.pp @@ -4,9 +4,9 @@ class nagios::defaults::templates { file { 'nagios_templates': path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_templates.cfg", source => [ "puppet:///modules/site-nagios/configs/${fqdn}/nagios_templates.cfg", - "puppet:///modules/site-nagios/configs/${operatingsystem}/nagios_templates.cfg", + "puppet:///modules/site-nagios/configs/${::operatingsystem}/nagios_templates.cfg", "puppet:///modules/site-nagios/configs/nagios_templates.cfg", - "puppet:///modules/nagios/configs/${operatingsystem}/nagios_templates.cfg", + "puppet:///modules/nagios/configs/${::operatingsystem}/nagios_templates.cfg", "puppet:///modules/nagios/configs/nagios_templates.cfg" ], notify => Service['nagios'], mode => 0644, owner => root, group => root; diff --git a/manifests/defaults/vars.pp b/manifests/defaults/vars.pp index 6302f13..b0aef57 100644 --- a/manifests/defaults/vars.pp +++ b/manifests/defaults/vars.pp @@ -1,6 +1,6 @@ class nagios::defaults::vars { case $nagios_cfgdir { - '': { $int_nagios_cfgdir = $operatingsystem ? { + '': { $int_nagios_cfgdir = $::operatingsystem ? { centos => '/etc/nagios/', default => '/etc/nagios3' } diff --git a/manifests/init.pp b/manifests/init.pp index 1aecc3a..5050b69 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -21,7 +21,7 @@ class nagios { 'apache': { include apache } default: { include apache } } - case $operatingsystem { + case $::operatingsystem { 'centos': { $nagios_cfgdir = '/etc/nagios' include nagios::centos @@ -30,6 +30,6 @@ class nagios { $nagios_cfgdir = '/etc/nagios3' include nagios::debian } - default: { fail("No such operatingsystem: $operatingsystem yet defined") } + default: { fail("No such operatingsystem: ${::operatingsystem} yet defined") } } } diff --git a/manifests/irc_bot.pp b/manifests/irc_bot.pp index 7629b94..ea8d79b 100644 --- a/manifests/irc_bot.pp +++ b/manifests/irc_bot.pp @@ -3,7 +3,7 @@ class nagios::irc_bot { fail("Please provide values at least for \$nagios_nsa_server, \$nagios_nsa_nickname and \$nagios_nsa_channel") } - case $operatingsystem { + case $::operatingsystem { centos: { $nagios_nsa_default_socket = '/var/run/nagios-nsa/nsa.socket' $nagios_nsa_default_pidfile = '/var/run/nagios-nsa/nsa.pid' diff --git a/manifests/irc_bot/base.pp b/manifests/irc_bot/base.pp index c36d8e6..ee3ea39 100644 --- a/manifests/irc_bot/base.pp +++ b/manifests/irc_bot/base.pp @@ -36,7 +36,7 @@ class nagios::irc_bot::base { } file { "/etc/init.d/nagios-nsa": owner => root, group => 0, mode => 0755, - content => template("nagios/irc_bot/${operatingsystem}/nagios-nsa.sh.erb"), + content => template("nagios/irc_bot/${::operatingsystem}/nagios-nsa.sh.erb"), require => File["/usr/local/bin/riseup-nagios-server.pl"], } file { "/etc/nagios_nsa.cfg": -- cgit v1.2.3 From fb6ca15458566af5caaf4e6bc5f801afe17616f2 Mon Sep 17 00:00:00 2001 From: "Christian G. Warden" Date: Wed, 1 Feb 2012 18:00:04 -0800 Subject: fully qualify fqdn and hostname facter variables --- manifests/service.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/service.pp b/manifests/service.pp index afc8650..a739317 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -1,6 +1,6 @@ define nagios::service ( $ensure = present, - $host_name = $fqdn, + $host_name = $::fqdn, $check_command, $check_period = '', $normal_check_interval = '', @@ -16,7 +16,7 @@ define nagios::service ( # TODO: this resource should normally accept all nagios_host parameters - $real_name = "${hostname}_${name}" + $real_name = "${::hostname}_${name}" @@nagios_service { "${real_name}": ensure => $ensure, -- cgit v1.2.3 From 1159fd799dcf85bedbe0bb9ce44971263250ee46 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 10 Feb 2012 14:42:16 +0100 Subject: use trocla for that password --- manifests/service/mysql.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'manifests') diff --git a/manifests/service/mysql.pp b/manifests/service/mysql.pp index 2fde402..53f1461 100644 --- a/manifests/service/mysql.pp +++ b/manifests/service/mysql.pp @@ -1,11 +1,11 @@ -# Checks a mysql instance via tcp or socket +# Checks a mysql instance via tcp or socket define nagios::service::mysql( $ensure = present, $check_host = 'absent', $check_port = '3306', $check_username = 'nagios', - $check_password = $nagios_mysql_password, + $check_password = trocla("mysql_nagios_${::fqdn}",'plain','length: 32'), $check_database = 'information_schema', $check_warning = undef, $check_critical = undef, @@ -51,7 +51,7 @@ define nagios::service::mysql( } } } - + nagios::service { "mysql_health_${name}": ensure => $ensure, check_command => "check_mysql_health!${real_check_host}!${check_port}!${check_username}!${check_password}!${check_health_mode}!${check_database}${real_check_name}${real_check_warning}${real_check_critical}", -- cgit v1.2.3 From 1eef6f70c0b3096be24954bfd23306cf82a0d316 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 18 Apr 2012 14:41:13 -0400 Subject: put single quotes around the password to guard against exclamation points in passwords --- manifests/service/mysql.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/service/mysql.pp b/manifests/service/mysql.pp index 53f1461..4a9c81a 100644 --- a/manifests/service/mysql.pp +++ b/manifests/service/mysql.pp @@ -54,6 +54,6 @@ define nagios::service::mysql( nagios::service { "mysql_health_${name}": ensure => $ensure, - check_command => "check_mysql_health!${real_check_host}!${check_port}!${check_username}!${check_password}!${check_health_mode}!${check_database}${real_check_name}${real_check_warning}${real_check_critical}", + check_command => "check_mysql_health!${real_check_host}!${check_port}!${check_username}!'${check_password}'!${check_health_mode}!${check_database}${real_check_name}${real_check_warning}${real_check_critical}", } } -- cgit v1.2.3 From a2a80093d42b7e9eec9d2af3c66138f7ceaf9ed6 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 27 Jun 2012 15:55:50 -0400 Subject: 2.7 underscore rename: site-nagios --- manifests/apache.pp | 4 ++-- manifests/base.pp | 16 ++++++++-------- manifests/defaults/templates.pp | 6 +++--- manifests/nsca/client.pp | 4 ++-- manifests/nsca/server.pp | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) (limited to 'manifests') diff --git a/manifests/apache.pp b/manifests/apache.pp index 6acf538..2c8efa6 100644 --- a/manifests/apache.pp +++ b/manifests/apache.pp @@ -6,8 +6,8 @@ class nagios::apache inherits ::apache { 'debian': { file { "${nagios::defaults::vars::int_nagios_cfgdir}/apache2.conf": ensure => present, - source => ["puppet:///site-nagios/configs/${fqdn}/apache2.conf", - "puppet:///site-nagios/configs/apache2.conf", + source => ["puppet:///site_nagios/configs/${fqdn}/apache2.conf", + "puppet:///site_nagios/configs/apache2.conf", "puppet:///nagios/configs/apache2.conf"], } diff --git a/manifests/base.pp b/manifests/base.pp index 3e3f0e1..28474f9 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -17,9 +17,9 @@ class nagios::base { # this file should contain all the nagios_puppet-paths: file { 'nagios_main_cfg': path => "${nagios::defaults::vars::int_nagios_cfgdir}/nagios.cfg", - source => [ "puppet:///modules/site-nagios/configs/${fqdn}/nagios.cfg", - "puppet:///modules/site-nagios/configs/${::operatingsystem}/nagios.cfg", - "puppet:///modules/site-nagios/configs/nagios.cfg", + source => [ "puppet:///modules/site_nagios/configs/${fqdn}/nagios.cfg", + "puppet:///modules/site_nagios/configs/${::operatingsystem}/nagios.cfg", + "puppet:///modules/site_nagios/configs/nagios.cfg", "puppet:///modules/nagios/configs/${::operatingsystem}/nagios.cfg", "puppet:///modules/nagios/configs/nagios.cfg" ], notify => Service['nagios'], @@ -35,9 +35,9 @@ class nagios::base { file { 'nagios_cgi_cfg': path => "${nagios::defaults::vars::int_nagios_cfgdir}/cgi.cfg", - source => [ "puppet:///modules/site-nagios/configs/${fqdn}/cgi.cfg", - "puppet:///modules/site-nagios/configs/${::operatingsystem}/cgi.cfg", - "puppet:///modules/site-nagios/configs/cgi.cfg", + source => [ "puppet:///modules/site_nagios/configs/${fqdn}/cgi.cfg", + "puppet:///modules/site_nagios/configs/${::operatingsystem}/cgi.cfg", + "puppet:///modules/site_nagios/configs/cgi.cfg", "puppet:///modules/nagios/configs/${::operatingsystem}/cgi.cfg", "puppet:///modules/nagios/configs/cgi.cfg" ], mode => '0644', owner => 'root', group => 0, @@ -46,7 +46,7 @@ class nagios::base { file { 'nagios_htpasswd': path => "${nagios::defaults::vars::int_nagios_cfgdir}/htpasswd.users", - source => [ "puppet:///modules/site-nagios/htpasswd.users", + source => [ "puppet:///modules/site_nagios/htpasswd.users", "puppet:///modules/nagios/htpasswd.users" ], mode => 0640, owner => root, group => apache; } @@ -62,7 +62,7 @@ class nagios::base { file { 'nagios_private_resource_cfg': path => "${nagios::defaults::vars::int_nagios_cfgdir}/private/resource.cfg", - source => [ "puppet:///modules/site-nagios/configs/${::operatingsystem}/private/resource.cfg.${::architecture}", + source => [ "puppet:///modules/site_nagios/configs/${::operatingsystem}/private/resource.cfg.${::architecture}", "puppet:///modules/nagios/configs/${::operatingsystem}/private/resource.cfg.${::architecture}" ], notify => Service['nagios'], owner => root, group => nagios, mode => '0640'; diff --git a/manifests/defaults/templates.pp b/manifests/defaults/templates.pp index aec97c0..57718cd 100644 --- a/manifests/defaults/templates.pp +++ b/manifests/defaults/templates.pp @@ -3,9 +3,9 @@ class nagios::defaults::templates { file { 'nagios_templates': path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_templates.cfg", - source => [ "puppet:///modules/site-nagios/configs/${fqdn}/nagios_templates.cfg", - "puppet:///modules/site-nagios/configs/${::operatingsystem}/nagios_templates.cfg", - "puppet:///modules/site-nagios/configs/nagios_templates.cfg", + source => [ "puppet:///modules/site_nagios/configs/${fqdn}/nagios_templates.cfg", + "puppet:///modules/site_nagios/configs/${::operatingsystem}/nagios_templates.cfg", + "puppet:///modules/site_nagios/configs/nagios_templates.cfg", "puppet:///modules/nagios/configs/${::operatingsystem}/nagios_templates.cfg", "puppet:///modules/nagios/configs/nagios_templates.cfg" ], notify => Service['nagios'], diff --git a/manifests/nsca/client.pp b/manifests/nsca/client.pp index 6e2c472..403f5ec 100644 --- a/manifests/nsca/client.pp +++ b/manifests/nsca/client.pp @@ -3,8 +3,8 @@ class nagios::nsca::client { package { 'nsca': ensure => installed } file { '/etc/send_nsca.cfg': - source => [ "puppet:///modules/site-nagios/nsca/{$fqdn}/send_nsca.cfg", - "puppet:///modules/site-nagios/nsca/send_nsca.cfg", + source => [ "puppet:///modules/site_nagios/nsca/{$fqdn}/send_nsca.cfg", + "puppet:///modules/site_nagios/nsca/send_nsca.cfg", "puppet:///modules/nagios/nsca/send_nsca.cfg" ], owner => 'nagios', group => 'nogroup', diff --git a/manifests/nsca/server.pp b/manifests/nsca/server.pp index 9239f21..26f7e3b 100644 --- a/manifests/nsca/server.pp +++ b/manifests/nsca/server.pp @@ -9,8 +9,8 @@ class nagios::nsca::server { } file { '/etc/nsca.cfg': - source => [ "puppet:///modules/site-nagios/nsca/{$fqdn}/nsca.cfg", - "puppet:///modules/site-nagios/nsca/nsca.cfg", + source => [ "puppet:///modules/site_nagios/nsca/{$fqdn}/nsca.cfg", + "puppet:///modules/site_nagios/nsca/nsca.cfg", "puppet:///modules/nagios/nsca/nsca.cfg" ], owner => 'nagios', group => 'nogroup', -- cgit v1.2.3