summaryrefslogtreecommitdiff
path: root/manifests/defaults
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2010-05-05 23:22:10 +0200
committermh <mh@immerda.ch>2010-05-05 23:22:10 +0200
commit33b091b896fbb0b54ee9968c452ef2a8867893d8 (patch)
tree863c61e2de0c258c859527e14e86b47ffd8f0bb1 /manifests/defaults
parent77f601607093b7fb22f3498574d0dedd2cbe01d9 (diff)
parent5d5ec8c28d0fe39359af8db159b14faeae397e1f (diff)
merged with lavamind
Diffstat (limited to 'manifests/defaults')
-rw-r--r--manifests/defaults/commands.pp75
-rw-r--r--manifests/defaults/contactgroups.pp9
-rw-r--r--manifests/defaults/contacts.pp15
-rw-r--r--manifests/defaults/host_templates.pp24
-rw-r--r--manifests/defaults/hostgroups.pp13
-rw-r--r--manifests/defaults/service_templates.pp32
-rw-r--r--manifests/defaults/templates.pp14
-rw-r--r--manifests/defaults/timeperiods.pp33
8 files changed, 215 insertions, 0 deletions
diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp
new file mode 100644
index 0000000..c3190af
--- /dev/null
+++ b/manifests/defaults/commands.pp
@@ -0,0 +1,75 @@
+class nagios::defaults::commands {
+
+ # common service commands
+
+ nagios_command {
+ check_dummy:
+ command_line => '$USER1$/check_dummy $ARG1$';
+ check_ping:
+ command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$';
+ check-host-alive:
+ command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1';
+ check_tcp:
+ command_line => '$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$';
+ check_udp:
+ command_line => '$USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$';
+ check_load:
+ command_line => '$USER1$/check_load --warning=$ARG1$,$ARG2$,$ARG3$ --critical=$ARG4$,$ARG5$,$ARG6$';
+ check_disk:
+ command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e -p $ARG3$';
+ check_all_disks:
+ command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e';
+ check_ssh:
+ command_line => '$USER1$/check_ssh $HOSTADDRESS$';
+ check_ssh_port:
+ command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$';
+ check_http:
+ command_line => '$USER1$/check_http -H $HOSTADDRESS$ -I $HOSTADDRESS$';
+ check_https:
+ command_line => '$USER1$/check_http --ssl -H $HOSTADDRESS$ -I $HOSTADDRESS$';
+ check_https_cert:
+ command_line => '$USER1$/check_http --ssl -C 20 -H $HOSTADDRESS$ -I $HOSTADDRESS$';
+ 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$';
+ check_https_url:
+ command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$';
+ check_https_url_regex:
+ command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -e $ARG3$';
+ check_mysql:
+ command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$';
+ check_mysql_db:
+ 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_silc:
+ command_line => '$USER1$/check_tcp -p 706 -H $ARG1$';
+ check_sobby:
+ command_line => '$USER1$/check_tcp -H $ARG1$ -p $ARG2$';
+ check_jabber:
+ command_line => '$USER1$/check_jabber -H $ARG1$';
+ }
+
+ # commands for services defined by other modules
+
+ nagios_command {
+ # from apache module
+ http_port:
+ command_line => '$USER1$/check_http -p $ARG1$ -H $HOSTADDRESS$ -I $HOSTADDRESS$';
+ # from bind module
+ check_dig2:
+ command_line => '$USER1$/check_dig -H $HOSTADDRESS$ -l $ARG1$ --record_type=$ARG2$';
+ }
+
+ # notification 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" | /usr/bin/mail -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$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$'
+
+ }
+
+}
diff --git a/manifests/defaults/contactgroups.pp b/manifests/defaults/contactgroups.pp
new file mode 100644
index 0000000..f5affc6
--- /dev/null
+++ b/manifests/defaults/contactgroups.pp
@@ -0,0 +1,9 @@
+class nagios::defaults::contactgroups {
+
+ nagios_contactgroup {
+ 'admins':
+ alias => 'Nagios Administrators',
+ members => 'root',
+ }
+
+}
diff --git a/manifests/defaults/contacts.pp b/manifests/defaults/contacts.pp
new file mode 100644
index 0000000..0252b5a
--- /dev/null
+++ b/manifests/defaults/contacts.pp
@@ -0,0 +1,15 @@
+class nagios::defaults::contacts {
+
+ nagios_contact {
+ 'root':
+ alias => 'Root',
+ service_notification_period => '24x7',
+ host_notification_period => '24x7',
+ service_notification_options => 'w,u,c,r',
+ host_notification_options => 'd,r',
+ service_notification_commands => 'notify-service-by-email',
+ host_notification_commands => 'notify-host-by-email',
+ email => 'root@localhost',
+ }
+
+}
diff --git a/manifests/defaults/host_templates.pp b/manifests/defaults/host_templates.pp
new file mode 100644
index 0000000..699b965
--- /dev/null
+++ b/manifests/defaults/host_templates.pp
@@ -0,0 +1,24 @@
+class nagios::defaults::host_templates {
+
+ # this inoperative for the moment, see :
+ # http://projects.reductivelabs.com/issues/1180
+
+ nagios_host {
+ 'generic-host':
+ 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',
+ check_command => 'check-host-alive',
+ max_check_attempts => '10',
+ notification_interval => '0',
+ notification_period => '24x7',
+ notification_options => 'd,u,r',
+ contact_groups => 'admins',
+ register => '0',
+ }
+
+}
diff --git a/manifests/defaults/hostgroups.pp b/manifests/defaults/hostgroups.pp
new file mode 100644
index 0000000..3a4f4d1
--- /dev/null
+++ b/manifests/defaults/hostgroups.pp
@@ -0,0 +1,13 @@
+class nagios::defaults::hostgroups {
+
+ nagios_hostgroup {
+ 'all':
+ alias => 'All Servers',
+ members => '*';
+ 'debian-servers':
+ alias => 'Debian GNU/Linux Servers';
+ 'centos-servers':
+ alias => 'CentOS GNU/Linux Servers';
+ }
+
+}
diff --git a/manifests/defaults/service_templates.pp b/manifests/defaults/service_templates.pp
new file mode 100644
index 0000000..326ce05
--- /dev/null
+++ b/manifests/defaults/service_templates.pp
@@ -0,0 +1,32 @@
+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',
+ }
+
+}
diff --git a/manifests/defaults/templates.pp b/manifests/defaults/templates.pp
new file mode 100644
index 0000000..5a3d23d
--- /dev/null
+++ b/manifests/defaults/templates.pp
@@ -0,0 +1,14 @@
+class nagios::defaults::templates {
+
+ file { 'nagios_templates':
+ path => "${nagios::nagios_cfgdir}/conf.d/nagios_templates.cfg",
+ source => [ "puppet://$server/modules/site-nagios/configs/${fqdn}/nagios_templates.cfg",
+ "puppet://$server/modules/site-nagios/configs/${operatingsystem}/nagios_templates.cfg",
+ "puppet://$server/modules/site-nagios/configs/nagios_templates.cfg",
+ "puppet://$server/modules/nagios/configs/${operatingsystem}/nagios_templates.cfg",
+ "puppet://$server/modules/nagios/configs/nagios_templates.cfg" ],
+ notify => Service['nagios'],
+ mode => 0644, owner => root, group => root;
+ }
+
+}
diff --git a/manifests/defaults/timeperiods.pp b/manifests/defaults/timeperiods.pp
new file mode 100644
index 0000000..0d05118
--- /dev/null
+++ b/manifests/defaults/timeperiods.pp
@@ -0,0 +1,33 @@
+class nagios::defaults::timeperiods {
+
+ nagios_timeperiod {
+ '24x7':
+ alias => '24 Hours A Day, 7 Days A Week',
+ sunday => '00:00-24:00',
+ monday => '00:00-24:00',
+ tuesday => '00:00-24:00',
+ wednesday => '00:00-24:00',
+ thursday => '00:00-24:00',
+ friday => '00:00-24:00',
+ saturday => '00:00-24:00';
+ 'workhours':
+ alias => 'Standard Work Hours',
+ monday => '09:00-17:00',
+ tuesday => '09:00-17:00',
+ wednesday => '09:00-17:00',
+ thursday => '09:00-17:00',
+ friday => '09:00-17:00';
+ 'nonworkhours':
+ alias => 'Non-Work Hours',
+ sunday => '00:00-24:00',
+ monday => '00:00-09:00,17:00-24:00',
+ tuesday => '00:00-09:00,17:00-24:00',
+ wednesday => '00:00-09:00,17:00-24:00',
+ thursday => '00:00-09:00,17:00-24:00',
+ friday => '00:00-09:00,17:00-24:00',
+ saturday => '00:00-24:00';
+ 'never':
+ alias => 'Never';
+ }
+
+}