# $Id: 5bf28fff52bcffcac4b03fca685aa9f2ee110b57 $

<% 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 -%>

define command {
	command_name    check_file_age
	command_line    $USER1$/check_file_age -f $ARG1$ -w $ARG2$ -c $ARG3$
}

define command {
	command_name    check_ntp_time
	command_line    $USER1$/check_ntp_time -H $HOSTADDRESS$
}

define command {
	command_name    check_tcp_port_cert
	command_line    $USER1$/check_tcp --ssl -H $HOSTADDRESS$ -p $ARG1$ -D $ARG2$
}

define command {
	command_name    check_http_port
	command_line    $USER1$/check_http -H $HOSTADDRESS$ -I $HOSTADDRESS$ -p $ARG1$
}

define command {
	command_name    check_https_port
	command_line    $USER1$/check_http --ssl -H $HOSTADDRESS$ -I $HOSTADDRESS$ -p $ARG1$
}

define command {
	command_name    check_https_port_cert
	command_line    $USER1$/check_http --ssl -H $HOSTADDRESS$ -I $HOSTADDRESS$ -p $ARG1$ -C $ARG2$
}

define command {
	command_name    check_ldap3
	command_line    $USER1$/check_ldap -H $HOSTADDRESS$ -b $ARG1$ -3
}

# this object already exists on the Debian wheezy.
#define command {
#	command_name    check_mysql_slave
#	command_line    $USER1$/check_mysql -H $HOSTADDRESS$ -S
#}


<% node['nagios']['objects']['commands'].each do |command| -%>
define command {
  <% command.each do |key, value| -%>
	<%= key %>	<%= value %>
  <% end -%>
}

<% end -%>
