# Internal commands:
contact="define contact {
	contact_name $1
	alias $3
	host_notification_period 24x7
	service_notification_period 24x7
	host_notification_options d,r
	service_notification_options c,r
	host_notification_commands host-notify-by-email
	service_notification_commands notify-by-email
	email $2
}"
ncontact="define contact {
	contact_name $1
	alias $3
	host_notification_period none
	service_notification_period none
	host_notification_options n
	service_notification_options n
	host_notification_commands host-notify-by-email
	service_notification_commands notify-by-email
	email $2
}"
define host {
	name host_templ
	max_check_attempts 3
	check_command check-host-alive
	notification_interval 240
	notification_period 24x7
	notification_options d,r
	register 0
}
define service {
	name service_templ
	check_period 24x7
	max_check_attempts 3
	check_interval 3
	retry_interval 1
	first_notification_delay 6
	notification_interval 240
	notification_period 24x7
	notification_options c,r
	register 0
}
define host {
	name host_templ_delay_15m
	use host_templ
	first_notification_delay 15
	register 0
}
define service {
	name service_templ_delay_15m
	use service_templ
	first_notification_delay 15
	register 0
}
host="define host {
	use host_templ_grp_$5
	host_name $1
	alias $3
	address $2
	parents $4
}
define hostescalation {
	host_name $1
	contact_groups $5
	first_notification 2
	last_notification 4
	notification_interval 120
}"
host_wop="define host {
	use host_templ_grp_$4
	host_name $1
	address $2
	alias $3
}
define hostescalation {
	host_name $1
	contact_groups $4
	first_notification 2
	last_notification 4
	notification_interval 120
}"
phost="define host {
	use host_templ_grp_$5
	host_name $1
	address $2
	alias $3
	parents $4
}
define hostescalation {
	host_name $1
	contact_groups $5
	first_notification 2
	last_notification 4
	notification_interval 120
}
define service {
	use service_templ_grp_$5
	host_name $1
	service_description PING
	check_command check_ping_u!100.0,30%!500.0,60%
}"
hostdep="define hostdependency {
	dependent_host_name $2
	host_name $1
	notification_failure_criteria o,d
}"
command="define command {
	command_name $1
	command_line $2
}"
contactgroup="define contactgroup {
	contactgroup_name $1
	alias $2
	members $3
}"
hostgroup="define hostgroup {
	hostgroup_name $1
	alias $2
	members $4
}"
servicegroup="define servicegroup {
	servicegroup_name $1
	alias $2
}"
completegroup="define contactgroup {
	contactgroup_name $1
	alias $2
	members $3  
}
define hostgroup {
	hostgroup_name $1   
	alias $2
}
define servicegroup {
	servicegroup_name $1
	alias $2
}
define host {
	name host_templ_grp_$1
	use host_templ
	contact_groups $1
	hostgroups $1
	register 0
}
define service {
	name service_templ_grp_$1
	use service_templ
	contact_groups $1
	servicegroups $1
	register 0
}"
hostgroupescalation="define hostgroupescalation {
	hostgroup_name $1
	first_notification $2
	last_notification $3
	notification_interval $4
	contact_groups $5
}"

# Commands
define command {
	command_name check_ping_u
	command_line $USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}
define command {
	command_name check_ping6_u
	command_line $USER1$/check_icmp -6 -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}
#define command {
#  command_name check_ssh
#  command_line $USER1$/check_ssh -H $HOSTADDRESS$ -t 25
#}
define command {
	command_name check_ssh202
	command_line $USER1$/check_ssh -H $HOSTADDRESS$ -p 202 -t 25
}
define command {
	command_name check_http_vhost
	command_line $USER1$/check_http -H $HOSTADDRESS$
}
define command {
	command_name check_https
	command_line $USER1$/check_http -S -H $HOSTADDRESS$ -C 30,14
}
define command {
	command_name check_elasticsearch
	command_line $USER1$/check_elasticsearch -H $HOSTADDRESS$ -p 9200
}
#define command {
#  command_name check_imap
#  command_line $USER1$/check_imap -H $HOSTADDRESS$
#}
define command {
	command_name check_imapt
	command_line $USER1$/check_imap -H $HOSTADDRESS$ -p $ARG1$
}
define command {
	command_name check_smtps
	command_line $USER1$/check_tcp -S -D 14 -H $HOSTADDRESS$ -p 465
}
define command {
	command_name check_urd
	command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 465
}
define command {
	command_name check_submission
	command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 587
}
define command {
	command_name check_smtpsg
	command_line $USER1$/check_smtp -H $HOSTADDRESS$ -p 26
}
define command {
	command_name check_sagator
	command_line $USER1$/check_smtp -H $HOSTADDRESS$ -p 27
}
define command {
	command_name check_sgcoll
	command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 28
}
define command {
	command_name check_pop3_login
	command_line $USER1$/check_pop -H $HOSTADDRESS$ -S -p 995 -E -s "USER $ARG1$\r\nPASS $ARG2$\r\n" -d 5 -e "+OK Logged in"
}
define command {
	command_name check_imap_login
	command_line $USER1$/check_imap -H $HOSTADDRESS$ -S -p 993 -E -s "0 login $ARG1$ $ARG2$\r\n" -d 5 -e "Logged in"
}
define command {
	command_name check_pop3s
	command_line $USER1$/check_pop -S -D 30,14 -H $HOSTADDRESS$ -p 995
}
define command {
	command_name check_imaps
	command_line $USER1$/check_imap -S -D 30,14 -H $HOSTADDRESS$ -p 993
}
define command {
	command_name check_ica
	command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 1494
}
define command {
	command_name check_pgsql_local
	command_line $USER1$/check_pgsql
}
define command {
	command_name check_tcp_port
	command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$
}

# NRPE commands
define command {
	command_name check_nrpe
	command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -u -t 20
}
define command {
	command_name check_nrpe_t30
	command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -u -t 30
}
define command {
	command_name check_nrpe_t60
	command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -u -t 60
}
define command {
	command_name check_nrpe_t120
	command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -u -t 120
}

# Services
ping="define service {
	use service_templ_grp_$2
	host_name $1
	service_description PING
	check_command check_ping_u!100.0,30%!500.0,60%
}"
ping6="define service {
	use service_templ_grp_$2
	host_name $1
	service_description PING
	check_command check_ping6_u!100.0,30%!500.0,60%
}"
ping_slow="define service {
	use service_templ_grp_$2
	host_name $1
	service_description PING
	check_command check_ping_u!2000.0,40%!4000.0,80%
}"
ping6_slow="define service {
	use service_templ_grp_$2
	host_name $1
	service_description PING
	check_command check_ping6_u!2000.0,40%!4000.0,80%
}"
ping_custom="define service {
	use service_templ_grp_$2
	host_name $1
	service_description PING
	check_command check_ping_u!$3%!$4%
}"
tcp="define service {
	use service_templ_grp_$2
	host_name $1
	service_description TCP/$3
	check_command check_tcp!$3
}"
nrpe="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_$3
	check_command check_nrpe!check_$3
}"
ssh="define service {
	use service_templ_grp_$2
	host_name $1
	service_description SSH
	check_command check_ssh
}"
ssh202="define service {
	use service_templ_grp_$2
	host_name $1
	service_description SSH
	check_command check_ssh202
}"
http="define service {
	use service_templ_grp_$2
	host_name $1
	service_description HTTP
	check_command check_http_vhost
}"
https="define service {
	use service_templ_grp_$2
	host_name $1
	service_description HTTPS
	check_command check_https
}"
smtp="define service {
	use service_templ_grp_$2
	host_name $1
	service_description SMTP
	check_command check_smtp
}"
submission="define service {
	use service_templ_grp_$2
	host_name $1
	service_description SMTP submission port
	check_command check_submission
}"
smtpsg="define service {
	use service_templ_grp_$2
	host_name $1
	service_description SagatorSMTP
	check_command check_smtpsg
}"
sagator="define service {
	use service_templ_grp_$2
	host_name $1
	service_description SAGATOR
	check_command check_sagator
}"
sgcoll="define service {
	use service_templ_grp_$2
	host_name $1
	service_description SagatorCollector
	check_command check_sgcoll
}"
# SAGATOR SMTP policy
nrpe_policy="define service {
	use service_templ_grp_$2
	host_name $1
	service_description SMTP_POLICY
	check_command check_nrpe!check_policy
}"
# spamassassin
spamd="define service {
	use service_templ
	host_name $1
	service_description spamd
	check_command check_tcp!783
}"
psql="define service {
	use service_templ_grp_$2
	host_name $1
	service_description POSTGRES
	check_command check_tcp!5432
}"
pgsql_local="define service {
	use service_templ_grp_$2
	host_name $1
	service_description POSTGRES
	check_command check_pgsql_local
}"
bucardo="define service {
	use service_templ_grp_$2
	host_name $1
	service_description Bucardo replication
	check_command check_nrpe_t120!check_pgrepl
	check_interval 30
	retry_interval 10
}"
dnet="define service {
	use service_templ_grp_$2
	host_name $1
	service_description DNET
	check_command check_tcp!2064
}"
ftp="define service {
	use service_templ_grp_$2
	host_name $1
	service_description FTP
	check_command check_ftp
}"
dns="define service {
	use service_templ_grp_$2
	host_name $1
	service_description DNS
	check_command check_dns!$3
}"
imap="define service {
	use service_templ_grp_$2
	host_name $1
	service_description IMAP
	check_command check_imap
}"
pop3="define service {
	use service_templ_grp_$2
	host_name $1
	service_description POP3
	check_command check_pop
}"
imaps="define service {
	use service_templ_grp_$2
	host_name $1
	service_description IMAPS
	check_command check_imaps
}"
pop3_login="define service {
	use service_templ_grp_$2
	host_name $1
	service_description POP3 Login
	check_command check_pop3_login!$3!$4
}"
imap_login="define service {
	use service_templ_grp_$2
	host_name $1
	service_description IMAP Login
	check_command check_imap_login!$3!$4
}"
smtps="define service {
	use service_templ_grp_$2
	host_name $1
	service_description SMTPS
	check_command check_smtps
}"
pop3s="define service {
	use service_templ_grp_$2
	host_name $1
	service_description POP3S
	check_command check_pop3s
}"
telnet="define service {
	use service_templ_grp_$2
	host_name $1
	service_description TELNET
	check_command check_telnet
}"
ica="define service {
	use service_templ_grp_$2
	host_name $1
	service_description ICA
	check_command check_ica
}"

# SIP
define command {
	command_name check_sip_u
	command_line sipsak -N -s sip:$ARG1$@$HOSTADDRESS$ -H s2.upjs.sk
}
sip="define service {
	use service_templ_grp_$2
	host_name $1
	service_description SIP
	check_command check_sip_u!8111
}"
polycom_sip="define service {
	use service_templ_grp_$2
	host_name $1
	service_description SIP
	check_command check_sip_u!
}"
define command {
	command_name check_sip5061
	command_line sipsak -N -s sip:8111@$HOSTADDRESS$ -r 5061 -H s2.upjs.sk
}
sip5061="define service {
	use service_templ_grp_$2
	host_name $1
	service_description Asterisk SIP
	check_command check_sip5061
}"

# NUT
define command {
	command_name check_ups
	command_line $USER1$/check_ups -H $HOSTADDRESS$ -u $ARG1$ -T
}
ups_apc="define service {
	use service_templ_grp_$2
	host_name $1
	service_description UPS_APC
	check_command check_ups!apc
}"
ups_victron="define service {
	use service_templ_grp_$2
	host_name $1
	service_description UPS_APC
	check_command check_ups!victron
}"

# APCUPSD
define command {
	command_name check_apcupsd
	command_line $USER1$/check_apcupsd $HOSTADDRESS$
}
apcupsd="define service {
	use service_templ_grp_$2
	host_name $1
	service_description APCUPSD
	check_command check_apcupsd
}"

# RADIUS
define command {
	command_name check_radius_u
	command_line $USER1$/check_radius -H $HOSTADDRESS$ -F /etc/radiusclient/radiusclient.conf -u nagios -p gjuhaeiuh
}
radius="define service {
	use service_templ_grp_$2
	host_name $1
	service_description Radius
	check_command check_radius_u
}"

# MySQL
define command {
	command_name check_mysql_u
	command_line $USER1$/check_mysql -H $HOSTADDRESS$ -u nagios
}
define command {
	command_name check_mysql
	command_line $USER1$/check_mysql -H $HOSTADDRESS$ -u nagios
}
mysql="define service {
	use service_templ_grp_$2
	host_name $1
	service_description MySQL
	check_command check_mysql
}"

# PgSQL
define command {
	command_name check_pgsql_u
	command_line $USER1$/check_pgsql -H $HOSTADDRESS$ -l nagios
}
pgsql="define service {
	use service_templ_grp_$2
	host_name $1
	service_description pgsql
	check_command check_pgsql_u
}"

# MongoDB
mongodb="define service {
	use service_templ_grp_$2
	host_name $1
	service_description mongodb
	check_command check_tcp_port!27017
}"

# DHCP
#define command {
#  command_name check_dhcp
#  command_line $USER1$/check_dhcp -s $HOSTADDRESS$
#}
dhcp="define service {
	use service_templ_grp_$2
	host_name $1
	service_description DHCP
	check_command check_dhcp
}"

# ms-rdp
define command {
	command_name check_rdp
	command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 3389
}
rdp="define service {
	use service_templ_grp_$2
	host_name $1
	service_description MS RDP
	check_command check_rdp
}"

# ldaps (LDAP over SSL)
define command {
	command_name check_ldaps
	command_line $USER1$/check_ldaps -H $HOSTADDRESS$ -b org
}
ldaps="define service {
	use service_templ_grp_$2
	host_name $1
	service_description LDAPS
	check_command check_ldaps
}"

# eth
define command {
	command_name check_eth
	command_line $USER1$/check_eth eth$ARG1$ $ARG2$ 90 95
}
eth0="define service {
	use service_templ_grp_$2
	host_name $1
	service_description eth0
	check_command check_eth!0!1000
}"
eth1="define service {
	use service_templ_grp_$2
	host_name $1
	service_description eth1
	check_command check_eth!1!1000
}"
eth2="define service {
	use service_templ_grp_$2
	host_name $1
	service_description eth2
	check_command check_eth!2!1000
}"
eth3="define service {
	use service_templ_grp_$2
	host_name $1
	service_description eth3
	check_command check_eth!3!1000
}"

# NRPE services
nrpe_users="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_users
	check_command check_nrpe!check_users
}"
nrpe_load="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_load
	check_command check_nrpe!check_load
}"
nrpe_sa="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_sa
	check_command check_nrpe!check_sa
}"
# disks
disk_root="define service {
	use service_templ_grp_$2
	host_name $1
	service_description disk_root
	check_command check_local_disk!10%!5%!/
}"
disk_backuppc="define service {
	use service_templ_grp_$2
	host_name $1
	service_description disk_backuppc
	check_command check_local_disk!10%!5%!/var/lib/BackupPC
}"
nrpe_disk="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_$3
	check_command check_nrpe!check_disk_$3
}"
nrpe_disk_var="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_var
	check_command check_nrpe!check_disk_var
}"
nrpe_disk_www="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_www
	check_command check_nrpe!check_disk_www
}"
nrpe_disk_home="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_home
	check_command check_nrpe!check_disk_home
}"
nrpe_disk_mysql="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_mysql
	check_command check_nrpe!check_disk_mysql
}"
nrpe_disk_pgsql="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_pgsql
	check_command check_nrpe!check_disk_pgsql
}"
nrpe_disk_mongodb="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_mongodb
	check_command check_nrpe!check_disk_mongodb
}"
nrpe_disk_valkey="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_valkey
	check_command check_nrpe!check_disk_valkey
}"
nrpe_disk_elasticsearch="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_elasticsearch
	check_command check_nrpe!check_disk_elasticsearch
}"
nrpe_disk_root="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_root
	check_command check_nrpe!check_disk_root
}"
nrpe_disk_tmp="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_tmp
	check_command check_nrpe!check_disk_tmp
}"
nrpe_disk_opt="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_opt
	check_command check_nrpe!check_disk_opt
}"
nrpe_disk_data="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_data
	check_command check_nrpe!check_disk_data
}"
nrpe_disk_backuppc="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_backuppc
	check_command check_nrpe!check_disk_backuppc
}"
nrpe_disk_log="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk_log
	check_command check_nrpe!check_disk_log
}"
nrpe_quota_apache="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_quota_apache
	check_command check_nrpe!check_quota_apache
}"
nrpe_disk1="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk1
	check_command check_nrpe!check_disk1
}"
nrpe_disk2="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk2
	check_command check_nrpe!check_disk2
}"
nrpe_disk3="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk3
	check_command check_nrpe!check_disk3
}"
nrpe_disk4="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_disk4
	check_command check_nrpe!check_disk4
}"
nrpe_zombie_procs="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_zombie_procs
	check_command check_nrpe!check_zombie_procs
}"
nrpe_total_procs="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_total_procs
	check_command check_nrpe!check_total_procs
}"
nrpe_recv_mail="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_recv_mail
	check_command check_nrpe!check_recv_mail
}"
nrpe_mysql="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_mysql
	check_command check_nrpe!check_mysql
}"
nrpe_mailq="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_mailq
	check_command check_nrpe_t30!check_mailq
	check_interval 30
	retry_interval 10
}"
nrpe_swap="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_swap
	check_command check_nrpe!check_swap
}"
nrpe_mem="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_mem
	check_command check_nrpe!check_mem
}"
nrpe_sagator="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_sagator
	check_command check_nrpe_t30!check_sagator
}"
# eth
nrpe_eth="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_$3
	check_command check_nrpe!check_$3
}"
nrpe_eth0="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_eth0
	check_command check_nrpe!check_eth0
}"
nrpe_eth1="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_eth1
	check_command check_nrpe!check_eth1
}"
nrpe_eth2="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_eth2
	check_command check_nrpe!check_eth2
}"
nrpe_eth3="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_eth3
	check_command check_nrpe!check_eth3
}"
nrpe_eth4="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_eth4
	check_command check_nrpe!check_eth4
}"
nrpe_eth5="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_eth5
	check_command check_nrpe!check_eth5
}"
nrpe_eth6="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_eth6
	check_command check_nrpe!check_eth6
}"
nrpe_eth7="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_eth7
	check_command check_nrpe!check_eth7
}"
nrpe_eth8="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_eth8
	check_command check_nrpe!check_eth8
}"
nrpe_eth9="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_eth9
	check_command check_nrpe!check_eth9
}"
nrpe_ens3="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_ens3
	check_command check_nrpe!check_ens3
}"
nrpe_tun0="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_tun0
	check_command check_nrpe!check_tun0
}"
# DISKIO
nrpe_diskio="define service {
	use service_templ_grp_$2
	host_name $1
	service_description diskio_$3
	check_command check_nrpe!check_diskio_$3
}"
nrpe_diskio_a="define service {
	use service_templ_grp_$2
	host_name $1
	service_description diskio_a
	check_command check_nrpe!check_diskio_a
}"
nrpe_diskio_b="define service {
	use service_templ_grp_$2
	host_name $1
	service_description diskio_b
	check_command check_nrpe!check_diskio_b
}"
nrpe_diskio_c="define service {
	use service_templ_grp_$2
	host_name $1
	service_description diskio_c
	check_command check_nrpe!check_diskio_c
}"
nrpe_diskio_d="define service {
	use service_templ_grp_$2
	host_name $1
	service_description diskio_d
	check_command check_nrpe!check_diskio_d
}"
nrpe_diskio_e="define service {
	use service_templ_grp_$2
	host_name $1
	service_description diskio_e
	check_command check_nrpe!check_diskio_e
}"
nrpe_diskio_f="define service {
	use service_templ_grp_$2
	host_name $1
	service_description diskio_f
	check_command check_nrpe!check_diskio_f
}"
nrpe_diskio_g="define service {
	use service_templ_grp_$2
	host_name $1
	service_description diskio_g
	check_command check_nrpe!check_diskio_g
}"
nrpe_diskio_h="define service {
	use service_templ_grp_$2
	host_name $1
	service_description diskio_h
	check_command check_nrpe!check_diskio_h
}"
# sync
nrpe_sync="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_sync
	check_command check_nrpe!check_sync
}"
# temperature
nrpe_temp="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_Temperature
	check_command check_nrpe!check_temp
}"
# HW RAID
nrpe_hwraid="define service {
	use service_templ_grp_$2
	host_name $1
	service_description HW RAID
	check_command check_nrpe!check_hwraid
}"
# aacraid
nrpe_aacraid="define service {
	use service_templ_grp_$2
	host_name $1
	service_description AACRAID
	check_command check_nrpe!check_aacraid
}"
# cciss raid status
nrpe_cciss="define service {
	use service_templ_grp_$2
	host_name $1
	service_description SmartArray RAID
	check_command check_nrpe!check_cciss
}"
# Apache, Lighttpd & php-fpm
define command {
	command_name check_apache
	command_line $USER1$/check_apache -H $HOSTADDRESS$
}
apache="define service {
	use service_templ_grp_$2
	host_name $1
	service_description apache
	check_command check_apache
}"
define command {
	command_name check_lighttpd
	command_line $USER1$/check_lighttpd -H $HOSTADDRESS$
}
lighttpd="define service {
	use service_templ_grp_$2
	host_name $1
	service_description lighttpd
	check_command check_lighttpd
}"
define command {
	command_name check_nginx
	command_line $USER1$/check_apache -n -U http://$HOSTADDRESS$/nginx_status
}
nginx="define service {
	use service_templ_grp_$2
	host_name $1
	service_description nginx
	check_command check_nginx
}"
define command {
	command_name check_php_fpm
	command_line $USER1$/check_php_fpm -H $HOSTADDRESS$
}
php_fpm="define service {
	use service_templ_grp_$2
	host_name $1
	service_description php-fpm
	check_command check_php_fpm
}"

# papouch.com
define command {
	command_name check_papouch
	command_line $USER1$/check_papouch -H $HOSTADDRESS$
}
papouch="define service {
	use service_templ_grp_$2
	host_name $1
	service_description Temperature sensor
	check_command check_papouch
}"
define command {
	command_name check_papouch_snmp
	command_line $USER1$/check_papouch -S $HOSTADDRESS$ -c 15,30
}
papouch_snmp="define service {
	use service_templ_grp_$2
	host_name $1
	service_description Temperature sensor
	check_command check_papouch_snmp
}"
nrpe_backuppc="define service {
	use service_templ_grp_$2
	host_name $1
	service_description BackupPC age
	check_command check_nrpe!check_backuppc
}"

# Samba
smb="define service {
	use service_templ_grp_$2
	host_name $1
	service_description SMB netbios
	check_command check_tcp_port!139
}
define service {
	use service_templ_grp_$2 
	host_name $1
	service_description SMB DS
	check_command check_tcp_port!445
}"

# NFS
nfs="define service {
	use service_templ_grp_$2 
	host_name $1
	service_description NFS
	check_command check_tcp_port!2049
}"

# PPTP
pptp="define service {
	use service_templ_grp_$2 
	host_name $1
	service_description PPTP
	check_command check_tcp_port!1723
}"

# winnrpe
nrpe_wload="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_check_cpu
	check_command check_nrpe!check_cpu
}"
nrpe_wswap="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_check_mem
	check_command check_nrpe!check_mem
}"

# elasticsearch
elasticsearch="define service {
	use service_templ_grp_$2
	host_name $1
	service_description elasticsearch
	check_command check_elasticsearch
}"
nrpe_elasticsearch="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_elasticsearch
	check_command check_nrpe!check_elasticsearch
}"

# cisco port-channel
define command {
	command_name check_portchannel
	command_line $USER1$/check_portchannel -H $HOSTADDRESS$
}
portchannel="define service {
	use service_templ_grp_$2
	host_name $1
	service_description Port-channel
	check_command check_portchannel
}"

# json universal grapher
define command {
	command_name check_json
	command_line $USER1$/check_json $ARG1$
}
json="define service {
	use service_templ_grp_$2
	host_name $1
	service_description json_data
	check_command check_json!https://$3/$4
}"
json_http="define service {
	use service_templ_grp_$2
	host_name $1
	service_description json_data
	check_command check_json!http://$3/$4
}"

# Redis on localhost via NRPE
nrpe_valkey="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_valkey
	check_command check_nrpe!check_valkey
}"

# SSL certs
nrpe_ssl_certs="define service {
	use service_templ_grp_$2
	host_name $1
	service_description NRPE_pki_certs
	check_command check_nrpe!check_ssl_certs
}"

# Time synchronization check
define command {
	command_name check_timesync
	command_line $USER1$/check_timesync -H $HOSTADDRESS$
}
timesync="define service {
	use service_templ_grp_$2
	host_name $1
	service_description TimeSync
	check_command check_timesync
}"
