summaryrefslogtreecommitdiff
path: root/manifests/defaults
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/defaults')
-rw-r--r--manifests/defaults/commands.pp44
-rw-r--r--manifests/defaults/service_templates.pp56
-rw-r--r--manifests/defaults/templates.pp15
-rw-r--r--manifests/defaults/vars.pp3
4 files changed, 62 insertions, 56 deletions
diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp
index 18925e1..e80e147 100644
--- a/manifests/defaults/commands.pp
+++ b/manifests/defaults/commands.pp
@@ -1,12 +1,13 @@
-# configure nagios commands on the server
+# defaults commands we wanna have available
class nagios::defaults::commands {
- include nagios::command::smtp
- include nagios::command::imap_pop3
+ include ::nagios::command::smtp
+ include ::nagios::command::imap_pop3
+ include ::nagios::plugins::horde_login
# common service commands
case $::operatingsystem {
- debian,ubuntu: {
+ 'Debian','Ubuntu': {
nagios_command {
'check_dummy':
command_line => '$USER1$/check_dummy $ARG1$';
@@ -15,7 +16,7 @@ class nagios::defaults::commands {
'check_http_url':
command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$';
'check_http_url_regex':
- command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -e $ARG3$';
+ command_line => '$USER1$/check_http -H $ARG1$ -p $ARG2$ -u $ARG3$ -e $ARG4$';
'check_https_url':
command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$';
'check_https_url_regex':
@@ -24,10 +25,6 @@ class nagios::defaults::commands {
command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$ -d $ARG5$';
'check_ntp_time':
command_line => '$USER1$/check_ntp_time -H $HOSTADDRESS$ -w 0.5 -c 1';
- 'check_openvpn_server':
- command_line => '$USER1$/check_openvpn_server.pl -H $HOSTADDRESS$ -p 1194';
- 'check_openvpn_server_ip_port':
- command_line => '$USER1$/check_openvpn_server.pl -H $ARG1$ -p $ARG2$';
'check_silc':
command_line => '$USER1$/check_tcp -p 706 -H $ARG1$';
'check_sobby':
@@ -99,16 +96,16 @@ class nagios::defaults::commands {
nagios_command {
# from apache module
'http_port':
- command_line => '$USER1$/check_http -p $ARG1$ -H $HOSTADDRESS$ -I $HOSTADDRESS$';
+ command_line => '$USER1$/check_http -p $ARG1$ -H $HOSTADDRESS$ -I $HOSTADDRESS$';
'check_http_port_url_content':
- command_line => '$USER1$/check_http -H $ARG1$ -p $ARG2$ -u $ARG3$ -s $ARG4$';
+ command_line => '$USER1$/check_http -H $ARG1$ -p $ARG2$ -u $ARG3$ -s $ARG4$';
'check_https_port_url_content':
- command_line => '$USER1$/check_http --ssl -H $ARG1$ -p $ARG2$ -u $ARG3$ -s $ARG4$';
+ command_line => '$USER1$/check_http --ssl -H $ARG1$ -p $ARG2$ -u $ARG3$ -s $ARG4$';
'check_http_url_content':
- command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -s $ARG3$';
+ command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -s $ARG3$';
'check_https_url_content':
- command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -s $ARG3$';
+ command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -s $ARG3$';
# from bind module
'check_dig2':
@@ -130,14 +127,19 @@ class nagios::defaults::commands {
# notification commands
$mail_cmd_location = $::operatingsystem ? {
- centos => '/bin/mail',
- default => '/usr/bin/mail'
+ 'CentOS' => '/bin/mail',
+ default => '/usr/bin/mail'
}
- nagios_command {
- 'notify-host-by-email':
- command_line => "/usr/bin/printf \"%b\" \"***** Nagios *****\\n\\nNotification Type: \$NOTIFICATIONTYPE\$\\n\\nHost: \$HOSTNAME\$ (\$HOSTALIAS\$)\\nAddress: \$HOSTADDRESS\$\\nState: \$HOSTSTATE\$\\nDuration: \$HOSTDURATION\$\\n\\nDate/Time: \$LONGDATETIME\$\\n\\nOutput: \$HOSTOUTPUT\$\" | ${mail_cmd_location} -s \"\$HOSTSTATE\$ - \$HOSTNAME\$\" \$CONTACTEMAIL\$";
- 'notify-service-by-email':
- command_line => "/usr/bin/printf \"%b\" \"***** Nagios *****\\n\\nNotification Type: \$NOTIFICATIONTYPE\$\\n\\nHost: \$HOSTNAME\$ (\$HOSTALIAS\$)\\nAddress: \$HOSTADDRESS\$\\n\\nService: \$SERVICEDESC\$\\nState: \$SERVICESTATE\$\\nDuration: \$SERVICEDURATION\$\\n\\nDate/Time: \$LONGDATETIME\$\\n\\nOutput: \$SERVICEOUTPUT\$\" | ${mail_cmd_location} -s \"\$SERVICESTATE\$ - \$HOSTALIAS\$: \$SERVICEDESC\$\" \$CONTACTEMAIL\$";
+ case $::lsbdistcodename {
+ 'wheezy': { }
+ default: {
+ 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\$";
+ '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\$";
+ }
+ }
}
}
diff --git a/manifests/defaults/service_templates.pp b/manifests/defaults/service_templates.pp
index 84740af..e39441a 100644
--- a/manifests/defaults/service_templates.pp
+++ b/manifests/defaults/service_templates.pp
@@ -1,32 +1,32 @@
+# define the generic service template
class nagios::defaults::service_templates {
- # this inoperative for the moment, see :
- # http://projects.reductivelabs.com/issues/1180
-
- nagios_service {
- 'generic-service':
- active_checks_enabled => '1',
- passive_checks_enabled => '1',
- parallelize_check => '1',
- obsess_over_service => '1',
- check_freshness => '0',
- notifications_enabled => '1',
- event_handler_enabled => '1',
- flap_detection_enabled => '1',
- failure_prediction_enabled => '1',
- process_perf_data => '1',
- retain_status_information => '1',
- retain_nonstatus_information => '1',
- notification_interval => '0',
- is_volatile => '0',
- check_period => '24x7',
- normal_check_interval => '5',
- retry_check_interval => '1',
- max_check_attempts => '4',
- notification_period => '24x7',
- notification_options => 'w,u,c,r',
- contact_groups => 'admins',
- register => '0',
- }
+ # this inoperative for the moment, see :
+ # http://projects.reductivelabs.com/issues/1180
+ nagios_service {
+ 'generic-service':
+ active_checks_enabled => '1',
+ passive_checks_enabled => '1',
+ parallelize_check => '1',
+ obsess_over_service => '1',
+ check_freshness => '0',
+ notifications_enabled => '1',
+ event_handler_enabled => '1',
+ flap_detection_enabled => '1',
+ failure_prediction_enabled => '1',
+ process_perf_data => '1',
+ retain_status_information => '1',
+ retain_nonstatus_information => '1',
+ notification_interval => '0',
+ is_volatile => '0',
+ check_period => '24x7',
+ check_interval => '5',
+ retry_check_interval => '1',
+ max_check_attempts => '4',
+ notification_period => '24x7',
+ notification_options => 'w,u,c,r',
+ contact_groups => 'admins',
+ register => '0',
+ }
}
diff --git a/manifests/defaults/templates.pp b/manifests/defaults/templates.pp
index 9711dd4..5158189 100644
--- a/manifests/defaults/templates.pp
+++ b/manifests/defaults/templates.pp
@@ -1,14 +1,17 @@
+# manage nagios_templates
class nagios::defaults::templates {
include nagios::defaults::vars
file { 'nagios_templates':
- path => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_templates.cfg",
- source => [ "puppet:///modules/site_nagios/configs/${::fqdn}/nagios_templates.cfg",
+ path => "${nagios::defaults::vars::int_cfgdir}/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/site_nagios/configs/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;
+ 'puppet:///modules/nagios/configs/nagios_templates.cfg' ],
+ notify => Service['nagios'],
+ owner => root,
+ group => root,
+ mode => '0644';
}
}
diff --git a/manifests/defaults/vars.pp b/manifests/defaults/vars.pp
index 87f41f8..e1a6224 100644
--- a/manifests/defaults/vars.pp
+++ b/manifests/defaults/vars.pp
@@ -1,7 +1,8 @@
+# some default vars
class nagios::defaults::vars {
case $nagios::cfgdir {
'': { $int_cfgdir = $::operatingsystem ? {
- centos => '/etc/nagios/',
+ centos => '/etc/nagios',
default => '/etc/nagios3'
}
}