<% capacity_types.each do |cap_type, cap_values| -%> define command { command_name cs-nagios_check-capacity_<%= cap_values[:method_name] %> command_line <%= bin_path -%>cs-nagios check capacity <%= cap_values[:method_name] %> -w $ARG1$ -c $ARG2$ --config <%= config_file %> --zone $ARG3$ register 1 } <% end -%> <% zones.each do |zone| -%> <% capacity_types.each do |cap_type, cap_values| -%> define service { hostgroup_name Cloudstack service_description Cloudstack <%= zone['name'] %> <%= cap_values[:name] %> display_name Cloudstack <%= zone['name'] %> <%= cap_values[:method_name] %> use Generic-Service,service-pnp check_command cs-nagios_check-capacity_<%= cap_values[:method_name] -%>!80!90!<%= zone['name'] %> register 1 } <% end -%> <% end -%>