summaryrefslogtreecommitdiff
path: root/manifests/defaults
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/defaults')
-rw-r--r--manifests/defaults/commands.pp106
-rw-r--r--manifests/defaults/host_templates.pp12
-rw-r--r--manifests/defaults/hostgroups.pp20
-rw-r--r--manifests/defaults/plugins.pp10
-rw-r--r--manifests/defaults/service_templates.pp18
-rw-r--r--manifests/defaults/templates.pp13
-rw-r--r--manifests/defaults/vars.pp10
7 files changed, 131 insertions, 58 deletions
diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp
index c3190af..933f3b9 100644
--- a/manifests/defaults/commands.pp
+++ b/manifests/defaults/commands.pp
@@ -1,55 +1,91 @@
class nagios::defaults::commands {
- # common service commands
+ include nagios::command::smtp
+ include nagios::command::imap_pop3
- nagios_command {
- check_dummy:
+ # common service commands
+ case $operatingsystem {
+ debian,ubuntu: {
+ nagios_command {
+ check_dummy:
command_line => '$USER1$/check_dummy $ARG1$';
- check_ping:
+ 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_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$';
+ }
+ }
+ default: {
+ 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:
+ check-host-alive:
command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1';
- check_tcp:
+ check_tcp:
command_line => '$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$';
- check_udp:
+ check_udp:
command_line => '$USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$';
- check_load:
+ check_load:
command_line => '$USER1$/check_load --warning=$ARG1$,$ARG2$,$ARG3$ --critical=$ARG4$,$ARG5$,$ARG6$';
- check_disk:
+ check_disk:
command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e -p $ARG3$';
- check_all_disks:
+ check_all_disks:
command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e';
- check_ssh:
+ check_ssh:
command_line => '$USER1$/check_ssh $HOSTADDRESS$';
- check_ssh_port:
+ check_ssh_port:
command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$';
- check_http:
+ check_ssh_port_host:
+ command_line => '$USER1$/check_ssh -p $ARG1$ $ARG2$';
+ check_http:
command_line => '$USER1$/check_http -H $HOSTADDRESS$ -I $HOSTADDRESS$';
- check_https:
+ check_https:
command_line => '$USER1$/check_http --ssl -H $HOSTADDRESS$ -I $HOSTADDRESS$';
- check_https_cert:
+ check_https_cert:
command_line => '$USER1$/check_http --ssl -C 20 -H $HOSTADDRESS$ -I $HOSTADDRESS$';
- check_http_url:
+ check_http_url:
command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$';
- check_http_url_regex:
+ check_http_url_regex:
command_line => '$USER1$/check_http -H $ARG1$ -u $ARG2$ -e $ARG3$';
- check_https_url:
+ check_https_url:
command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$';
- check_https_url_regex:
+ check_https_url_regex:
command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -e $ARG3$';
- check_mysql:
+ check_mysql:
command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$';
- check_mysql_db:
+ check_mysql_db:
command_line => '$USER1$/check_mysql -H $ARG1$ -P $ARG2$ -u $ARG3$ -p $ARG4$ -d $ARG5$';
- check_ntp_time:
+ check_ntp_time:
command_line => '$USER1$/check_ntp_time -H $HOSTADDRESS$ -w 0.5 -c 1';
- check_silc:
+ check_silc:
command_line => '$USER1$/check_tcp -p 706 -H $ARG1$';
- check_sobby:
+ check_sobby:
command_line => '$USER1$/check_tcp -H $ARG1$ -p $ARG2$';
- check_jabber:
+ check_jabber:
command_line => '$USER1$/check_jabber -H $ARG1$';
- }
+ check_git:
+ command_line => '$USER1$/check_tcp -H $ARG1$ -p 9418';
+ }
+ }
+ }
# commands for services defined by other modules
@@ -57,9 +93,27 @@ class nagios::defaults::commands {
# from apache module
http_port:
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$';
+ check_https_port_url_content:
+ 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$';
+ check_https_url_content:
+ command_line => '$USER1$/check_http --ssl -H $ARG1$ -u $ARG2$ -s $ARG3$';
+
# from bind module
check_dig2:
command_line => '$USER1$/check_dig -H $HOSTADDRESS$ -l $ARG1$ --record_type=$ARG2$';
+
+ # from mysql module
+ check_mysql_health:
+ command_line => '$USER1$/check_mysql_health --hostname $ARG1$ --port $ARG2$ --username $ARG3$ --password $ARG4$ --mode $ARG5$ --database $ARG6$';
+
+ # better check_dns
+ check_dns2:
+ command_line => '$USER1$/check_dns2 -c $ARG1$ A $ARG2$';
}
# notification commands
diff --git a/manifests/defaults/host_templates.pp b/manifests/defaults/host_templates.pp
index 699b965..0f47324 100644
--- a/manifests/defaults/host_templates.pp
+++ b/manifests/defaults/host_templates.pp
@@ -12,12 +12,12 @@ class nagios::defaults::host_templates {
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',
+ 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
index 3a4f4d1..8715ade 100644
--- a/manifests/defaults/hostgroups.pp
+++ b/manifests/defaults/hostgroups.pp
@@ -1,13 +1,11 @@
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';
- }
-
+ 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/plugins.pp b/manifests/defaults/plugins.pp
new file mode 100644
index 0000000..842f9ce
--- /dev/null
+++ b/manifests/defaults/plugins.pp
@@ -0,0 +1,10 @@
+class nagios::defaults::plugins {
+
+ nagios::plugin {
+ 'check_mysql_health':
+ source => 'nagios/plugins/check_mysql_health';
+ 'check_dns2':
+ source => 'nagios/plugins/check_dns2';
+ }
+
+}
diff --git a/manifests/defaults/service_templates.pp b/manifests/defaults/service_templates.pp
index 326ce05..84740af 100644
--- a/manifests/defaults/service_templates.pp
+++ b/manifests/defaults/service_templates.pp
@@ -17,15 +17,15 @@ class nagios::defaults::service_templates {
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',
+ 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
index 5a3d23d..c97eee4 100644
--- a/manifests/defaults/templates.pp
+++ b/manifests/defaults/templates.pp
@@ -1,12 +1,13 @@
class nagios::defaults::templates {
+ include nagios::defaults::vars
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" ],
+ 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",
+ "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
new file mode 100644
index 0000000..6302f13
--- /dev/null
+++ b/manifests/defaults/vars.pp
@@ -0,0 +1,10 @@
+class nagios::defaults::vars {
+ case $nagios_cfgdir {
+ '': { $int_nagios_cfgdir = $operatingsystem ? {
+ centos => '/etc/nagios/',
+ default => '/etc/nagios3'
+ }
+ }
+ default: { $int_nagios_cfgdir = $nagios_cfgdir }
+ }
+}