# $Id$

<% if node['nagios']['check_ganglia_metric']['enabled'] then -%>
define command {
	command_name    check_ganglia_metric
<%
case node[:platform_family]
  when 'debian'
-%>
	command_line    /usr/local/bin/check_ganglia_metric.py --gmetad_host=<%= node['nagios']['check_ganglia_metric']['gmetad_host'] %> --cache_path=/var/lib/nagios3/.check_ganglia_metric.cache --metric_host=$HOSTADDRESS$ --metric_name=$ARG1$ --warning=$ARG2$ --critical=$ARG3$
<%
  when 'rhel'
-%>
	command_line    /usr/bin/check_ganglia_metric.py --gmetad_host=<%= node['nagios']['check_ganglia_metric']['gmetad_host'] %> --cache_path=/var/log/nagios/.check_ganglia_metric.cache --metric_host=$HOSTADDRESS$ --metric_name=$ARG1$ --warning=$ARG2$ --critical=$ARG3$
<% end -%>
}
<% end -%>
<% node['nagios']['objects']['commands'].each do |command| -%>
define command {
  <% command.each do |key, value| -%>
	<%= key %>	<%= value %>
  <% end -%>
}

<% end -%>
