1 $LOAD_PATH.push("#{File.dirname(__FILE__)}/../_lib")
2 #${chef-repo}/_lib/grid.rb
6 description 'Grid Base nagios node'
10 'role[nameservice-client-grid]',
11 'role[ganglia-gmond]',
15 #env_run_lists "prod" => ["recipe[apache2]"], "staging" => ["recipe[apache2::staging]"], "_default" => []
17 this_cluster = Grid::CLUSTERS[:base]
18 this_subcluster = Grid::CLUSTERS[:base][:nagioses]
19 mcast_addr = this_subcluster[:mcast_addr]
23 udp_send_channels4ucast = []
24 this_subcluster[:nodes].first(2).each {|host|
25 udp_send_channels4ucast.push(
28 'host' => "#{host}.#{Grid::DOMAIN}",
41 Grid::CLUSTERS[:base].each {|key, cluster|
44 'name' => cluster[:use_host_object],
45 'use' => 'generic-grid-host',
50 cluster[:nodes].each {|node|
54 'use' => cluster[:use_host_object],
55 'address' => "#{node}.#{Grid::DOMAIN}",
62 'hostgroup_name' => cluster[:name],
63 'alias' => cluster[:alias],
64 'members' => cluster[:nodes].join(','),
67 hostgroup_names.push(cluster[:name])
73 'name' => 'generic-grid-contact',
74 'service_notification_period' => '24x7',
75 'host_notification_period' => '24x7',
76 'service_notification_options' => 'w,u,c,r',
77 'host_notification_options' => 'd,u,r',
78 'service_notification_commands' => 'notify-service-by-email',
79 'host_notification_commands' => 'notify-host-by-email',
83 'contact_name' => 'alice',
84 'use' => 'generic-grid-contact',
86 'email' => 'alice@localhost'
89 'contact_name' => 'bob',
90 'use' => 'generic-grid-contact',
92 'email' => 'bob@localhost'
97 'contactgroup_name' => 'grid-admins',
98 'alias' => 'Grid Administrators',
100 #'members' => 'alice,bob'
105 'name' => 'generic-grid-host',
106 'use' => 'generic-host',
107 'alias' => 'Grid Node',
108 'check_command' => 'check-host-alive',
109 'max_check_attempts' => '20',
110 'notification_interval' => '60',
111 'notification_period' => '24x7',
112 'notification_options' => 'd,u,r',
115 ] + host_templates + hosts,
120 'hostgroup_name' => 'grid-servers',
121 'alias' => 'GridServers',
122 'hostgroup_members' => hostgroup_names.join(',')
126 # ganglia gmetad monitoring
128 'use' => 'generic-check_ganglia_cache-service',
129 'host_name' => 'localhost',
130 'contact_groups' => 'grid-admins',
133 'use' => 'generic-ganglia_heartbeat-service',
134 'hostgroup_name' => "#{this_cluster[:gmetads][:name]}",
135 'contact_groups' => 'grid-admins',
137 # standard monitoring.
139 'use' => 'generic-ping-service',
140 'hostgroup_name' => 'grid-servers',
141 'contact_groups' => 'grid-admins',
144 'use' => 'generic-ssh-service',
145 'hostgroup_name' => 'grid-servers',
146 'contact_groups' => 'grid-admins',
149 'use' => 'generic-ntp-service',
150 'hostgroup_name' => 'grid-servers',
151 'contact_groups' => 'grid-admins',
154 'use' => 'generic-load_one-service',
155 'hostgroup_name' => 'grid-servers',
156 'contact_groups' => 'grid-admins',
159 'use' => 'generic-load_five-service',
160 'hostgroup_name' => 'grid-servers',
161 'contact_groups' => 'grid-admins',
164 'use' => 'generic-load_fifteen-service',
165 'hostgroup_name' => 'grid-servers',
166 'contact_groups' => 'grid-admins',
169 'use' => 'generic-part_max_used-service',
170 'hostgroup_name' => 'grid-servers',
171 'contact_groups' => 'grid-admins',
174 'use' => 'generic-proc_total-service',
175 'hostgroup_name' => 'grid-servers',
176 'contact_groups' => 'grid-admins',
179 'use' => 'generic-http-service',
181 => "#{this_cluster[:gmetads][:name]},#{this_cluster[:nagioses][:name]}",
182 'contact_groups' => 'grid-admins',
186 'use' => 'generic-ldap-service',
187 'hostgroup_name' => 'grid-nameservice-servers',
188 'check_command' => 'check_ldap3!dc=grid,dc=example,dc=com',
189 'contact_groups' => 'grid-admins',
193 'servicedependencies' => [
195 'host_name' => 'localhost',
196 'service_description' => 'Cache for check_ganglia_metric',
197 'dependent_host_name' => '.*',
198 #'dependent_hostgroup_name' => 'grid-servers',
199 'dependent_service_description' => '.* via Ganglia$',
200 'execution_failure_criteria' => 'c,p'
207 'cluster_name' => 'grid-base',
208 'objects' => nagios_objects,
210 'Allow' => ["from .#{Grid::DOMAIN}"],
211 'AuthType' => 'Kerberos',
213 'KrbAuthRealms' => Grid::REALM,
214 'Krb5Keytab' => '/etc/krb5.keytab'
217 'check_external_commands' => '1',
218 'use_regexp_matching' => '1',
219 'authorized_for_system_information' => '*',
220 'authorized_for_configuration_information' => '*',
221 'authorized_for_system_commands' => '*',
222 'authorized_for_all_services' => '*',
223 'authorized_for_all_hosts' => '*',
224 'authorized_for_all_service_commands' => '*',
225 'authorized_for_all_host_commands' => '*',
226 'check_ganglia_metric' => {
228 'gmetad_host' => "gm90.#{Grid::DOMAIN}"
237 'name' => this_subcluster[:alias],
238 'owner' => Grid::DOMAIN
242 'udp_send_channels' => [
244 'mcast_join' => mcast_addr,
250 'udp_recv_channels' => [
252 'mcast_join' => mcast_addr,
259 'udp_send_channels' => udp_send_channels4ucast,
260 'udp_recv_channels' => [