# $Id$

define service {
	name            generic-base-service
	use             generic-service

	is_volatile             0
	check_period            24x7
	max_check_attempts      3
	normal_check_interval   2
	retry_check_interval    1
	contact_groups          <%= node['nagios']['objects']['default_contact_groups'] %>
	notification_interval   240
	notification_period     24x7
	notification_options    w,u,c,r
<% if node['nagios']['with_pnp4nagios'] then -%>
	action_url      /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
<% end -%>
	register                0
}

define service {
	name            generic-ping-service
	use             generic-base-service

	service_description     PING
	max_check_attempts      3
	normal_check_interval   5
	retry_check_interval    1
	notification_options    c,r
	check_command           check_ping!100.0,20%!500.0,60%
	register                0
}

define service {
	name            generic-tcp-port-cert-service
	use             generic-base-service

	service_description     TCP_Cert
	check_command           check_tcp_port_cert!443!30
	register                0
}

define service {
	name            generic-ssh-service
	use             generic-base-service

	service_description     SSH
	check_command           check_ssh
	register                0
}

define service {
	name            generic-http-service
	use             generic-base-service

	service_description     HTTP
	check_command           check_http
	register                0
}

define service {
	name            generic-http-port-service
	use             generic-http-service

	service_description		HTTP_80
	check_command			check_http_port!80
	register                0
}

define service {
	name            generic-https-service
	use             generic-base-service

	service_description     HTTPS
	check_command           check_https
	register                0
}

define service {
	name            generic-https-port-service
	use             generic-https-service

	service_description     HTTPS_443
	check_command           check_https_port!443
	register                0
}

define service {
	name            generic-https-port-cert-service
	use             generic-https-service

	service_description     HTTPS_443_cert
	check_command           check_https_port_cert!443!30
	register                0
}

define service {
	name            generic-https-port6280-cert-service
	use             generic-https-service

	service_description     HTTPS_6280_cert
	check_command           check_https_port_cert!6280!30
	register                0
}

# MySQL
define service {
	name            generic-mysql-service
	use             generic-base-service

	service_description     MySQL
	check_command           check_mysql
	register                0
}

define service {
	name            generic-mysql-slave-service
	use             generic-base-service

	service_description     MySQL_Slave
	check_command           check_mysql_slave
	register                0
}

define service {
	name            generic-remote-mysql-heartbeat-service
	use             generic-mysql-service

	service_description     MySQL_Heartbeat
	normal_check_interval   1
	check_command           check_remote_mysql_heartbeat
	register                0
}

define service {
	name            generic-ntp-service
	use             generic-base-service

	service_description     NTP
	max_check_attempts      3
	normal_check_interval   5
	retry_check_interval    3
	check_command           check_ntp_time
	register                0
}

define service {
	name            generic-smtp-service
	use             generic-base-service

	service_description     SMTP
	check_command           check_smtp
	register                0
}

define service {
	name            generic-spop-service
	use             generic-base-service

	service_description     SPOP
	check_command           check_spop
	register                0
}

define service {
	name            generic-simap-service
	use             generic-base-service

	service_description     SIMAP
	check_command           check_simap
	register                0
}

define service {
	name            generic-ldap-service
	use             generic-base-service

	service_description     LDAP
	check_command           check_ldap!<%= node['nagios']['objects']['check_ldap']['base'] %>
	register                0
}

define service {
	name            generic-ups-service
	use             generic-base-service

	service_description     UPS
	check_command           check_ups!by80s
	register                0
}

# NRPE
define service {
	name            generic-nrpe-service
	use             generic-base-service

	service_description     NRPE
	max_check_attempts      3
	normal_check_interval   5
	retry_check_interval    1
	check_command           check_remote_load
	register                0
}

define service {
	name            generic-remote-apt-service
	use             generic-nrpe-service

	service_description     APT
	normal_check_interval   180
	retry_check_interval    60
	check_command           check_remote_apt
	register                0
}

define service {
	name            generic-remote-apc-status-service
	use             generic-nrpe-service

	service_description     APC_Status
	check_command           check_remote_apc_status
	register                0
}

define service {
	name            generic-remote-apc-load-service
	use             generic-nrpe-service

	service_description     APC_Load
	check_command           check_remote_apc_load
	register                0
}

define service {
	name            generic-remote-apc-bcharge-service
	use             generic-nrpe-service

	service_description     APC_BatteryCharge
	check_command           check_remote_apc_bcharge
	register                0
}

define service {
	name            generic-remote-apc-time-service
	use             generic-nrpe-service

	service_description     APC_Time
	check_command           check_remote_apc_time
	register                0
}

define service {
	name            generic-remote-dig-service
	use             generic-nrpe-service

	service_description     DIG
	check_command           check_remote_dig
	register                0
}

define service {
	name            generic-remote-dig-in-service
	use             generic-nrpe-service

	service_description     DIG_IN
	check_command           check_remote_dig_in	
	register                0
}

define service {
	name            generic-remote-dig-ex-service
	use             generic-nrpe-service

	service_description     DIG_EX
	check_command           check_remote_dig_ex
	register                0
}

define service {
	name            generic-remote-logs-service
	use             generic-nrpe-service

	service_description     Logs
	max_check_attempts      1
	notification_options    w,u,c
	check_command           check_remote_logs
	register                0
}

define service {
	name            generic-remote-load-service
	use             generic-nrpe-service

	service_description     Load_Avrg
	check_command           check_remote_load
	register                0
}

define service {
	name            generic-remote-users-service
	use             generic-nrpe-service

	service_description     Users
	check_command           check_remote_users
	register                0
}

<%
(0..3).each {|num|
-%>
define service {
	name            generic-remote-disk<%= num %>-service
	use             generic-nrpe-service

	service_description     Disk<%= num %>
	check_command           check_remote_disk<%= num %>
	register                0
}

<%
}
-%>
<%
(0..3).each {|num|
-%>
define service {
	name            generic-remote-smart<%= num %>-service
	use             generic-nrpe-service

	service_description     SMART<%= num %>
	normal_check_interval   10
	retry_check_interval    5
	check_command           check_remote_smart<%= num %>
	register                0
}

<%
}
-%>
define service {
	name            generic-remote-smart-devs-service
	use             generic-nrpe-service

	service_description     SMART_Devs
	normal_check_interval   10
	retry_check_interval    5
	check_command           check_remote_smart_devs
	register                0
}

define service {
	name            generic-remote-zombie-procs-service
	use             generic-nrpe-service

	service_description     Zombie_Procs
	check_command           check_remote_zombie_procs
	register                0
}

define service {
	name            generic-remote-total-procs-service
	use             generic-nrpe-service

	service_description     Total_Procs
	check_command           check_remote_total_procs
	register                0
}

define service {
	name            generic-remote-memory-service
	use             generic-nrpe-service

	service_description     Memory
	check_command           check_remote_memory
	register                0
}

define service {
	name            generic-remote-mailq-exim-service
	use             generic-nrpe-service

	service_description     Exim_Queue
	check_command           check_remote_mailq_exim
	register                0
}

define service {
	name            generic-remote-mailq-postfix-service
	use             generic-nrpe-service

	service_description     Postfix_Queue
	check_command           check_remote_mailq_postfix
	register                0
}

define service {
	name            generic-remote-xen-dom0-service
	use             generic-nrpe-service

	service_description     Xen_dom0
	check_command           check_remote_xen_dom0
	register                0
}

define service {
	name            generic-remote-xen-domU1-service
	use             generic-nrpe-service

	service_description     Xen_domU1
	check_command           check_remote_xen_domU1
	register                0
}

# JBoss
define service {
	name			generic-jboss-service
	use				generic-base-service

	service_description     JBoss
	register                0
}

define service{
	name			generic-remote-jboss-freemem-service
	use				generic-jboss-service

	service_description     JBoss_FreeMem
	check_command			check_remote_jboss_freemem
	register                0
}

define service{
	name			generic-remote-jboss-jk-curthread-service
	use				generic-jboss-service

	service_description     JBoss_JK_CurThread
	check_command			check_remote_jboss_jk_curthread
	register                0
}

define service{
	name			generic-remote-jboss-ds-conn1-service
	use				generic-jboss-service

	service_description     JBoss_DS_Conn1
	check_command			check_remote_jboss_ds_conn1
	register                0
}

define service{
	name			generic-remote-jboss-ds-conn2-service
	use				generic-jboss-service

	service_description     JBoss_DS_Conn2
	check_command			check_remote_jboss_ds_conn2
	register                0
}

define service{
	name			generic-remote-jboss-logs-service
	use				generic-jboss-service

	service_description     JBoss_Logs
	max_check_attempts      1
	notification_options    w,u,c
	check_command			check_remote_jboss_logs
	register                0
}

define service{
	name			generic-jbossjk-service
	use				generic-jboss-service

	service_description		JBossJK
	check_command			check_jbossjmx!4!"jboss.web:name=jk-8009,type=ThreadPool"!currentThreadCount!100!200
	register			0
}

