#############################################################################################
# ICINGA TEST CONFIG BY ISSUES
# (c) 2009-2015 Icinga Development Team and Community Contributors
#
# #2743
# icinga2 config conversion - collect all the "special" here
#############################################################################################

define contact{
        name                            2743testconfig-generic-contact
        service_notification_period     testconfig-24x7
        host_notification_period        testconfig-24x7
        service_notification_options    w,u,c,r,f,s
        host_notification_options       d,u,r,f,s
        service_notification_commands   2743test_notify
        host_notification_commands      2743test_notify
        register                        0
}


define contact{
        contact_name                    2743testconfig-admin
        use                             2743testconfig-generic-contact
        alias                           Icinga Test Admin

        email                           2743icinga@localhost
        pager                           2743bumstipager
        address1                        2743bumstiaddress1
        address2                        2743bumstiaddress2
        address4                        2743bumstiaddress4
        address6                        2743bumstiaddress6
	contactgroups			2743cg_all,2743cg_ops
}

define contact{
        contact_name                    2743testconfig-user
        use                             2743testconfig-generic-contact
        alias                           Icinga Test User

        email                           icinga@localhost
}

define contact{
        contact_name                    2743testconfig-manager
        use                             2743testconfig-generic-contact
        alias                           Icinga Test Manager

        email                           icinga@localhost
}

define contact{
        contact_name                    2743testconfig-operator
        use                             2743testconfig-generic-contact
        alias                           Icinga Test Operator

        email                           icinga@localhost
}

define contact{
        contact_name                    2743testconfig-ticket
        use                             2743testconfig-generic-contact
        alias                           Icinga Test Ticket

        email                           icinga@localhost
}

define contactgroup{
	contactgroup_name		2743cg_all
	members				2743testconfig-user,2743testconfig-manager,2743testconfig-operator
}

define contactgroup{
        contactgroup_name               2743cg_ops
        members                         2743testconfig-operator
}

define contactgroup{
        contactgroup_name               2743cg_manager
        members                         2743testconfig-manager,2743testconfig-admin
}

define contactgroup{
        contactgroup_name               2743cg_CBA
# uncomment this for error test
#        contactgroup_members            3008cg_C,2743cg_B,2743cg_A
}


define command{
	command_name			2743test
	command_line			/bin/echo "2743 ADMINPAGER: $ADMINPAGER$ ADMINEMAIL: $ADMINEMAIL$ USER1: $USER1$ USER15: $USER15$"
}

define command{
	command_name			2743test_with_args
	command_line			/bin/echo "2743 $ARG1$ $ARG2$"
}


define command{
	command_name			2743test_notify
	command_line			/bin/echo "2743 notification ADMINPAGER: $ADMINPAGER$ ADMINEMAIL: $ADMINEMAIL$ USER1: $USER1$ USER15: $USER15$"
}


define hostgroup {
        hostgroup_name      		2743hg_A
        members             		2743localhost1
}

define hostgroup {
        hostgroup_name      		2743hg_B
        members             		2743localhost2
}

define hostgroup {
        hostgroup_name      		2743hg_CBA
# uncomment this for error test
#        hostgroup_members   		2743hg_C,2743hg_B,2743hg_A
}

# eventhandler
define command {
        command_name                2743_eventhandler01
        command_line                /bin/echo "2743 eventhandler called. USER1: $USER1$ ADMINEMAIL: $ADMINEMAIL$ ADMINPAGER: $ADMINPAGER$"
}

# host templates

define host {
        name                       	2743hosttemplate01
        address                         127.0.0.1
        check_period                    testconfig-24x7
        check_command                   2743test_with_args!bumsti01!bumsti02
        contact_groups                  testconfig-group-admin
        notification_period             testconfig-workhours
        initial_state                   o
        check_interval                  5.000000 # foo_check
        retry_interval                  1.000000 # foo_retry
        max_check_attempts              10 # How many times to check before sending first notification
        active_checks_enabled           1
        passive_checks_enabled          1
        obsess_over_host                1
        event_handler_enabled           1
        low_flap_threshold              0.000000
        high_flap_threshold             0.000000
        flap_detection_enabled          1
        flap_detection_options          o,d,u
        freshness_threshold             0
        check_freshness                 0
        notification_options            d,u,r
        notifications_enabled           1
        notification_interval           120.000000 # Number of "time-units" to wait before re-notifying a contact that this host is still in a non-OK state.
        first_notification_delay        0.000000
        stalking_options                n
        process_perf_data               1
        failure_prediction_enabled      1
        retain_status_information       1
        retain_nonstatus_information    1
	register 			0
}



# hosts

define host {
        host_name       		2743localhost1
        alias   			2743localhost1
        address 			127.0.0.1
        check_period    		testconfig-24x7
        check_command   		2743test
        contact_groups  		testconfig-group-admin
        notification_period     	testconfig-workhours
        initial_state   		o
        check_interval  		5.000000
        retry_interval  		1.000000
        max_check_attempts      	10
        active_checks_enabled   	1
        passive_checks_enabled  	1
        obsess_over_host        	1
        event_handler_enabled   	1
        low_flap_threshold      	0.000000
        high_flap_threshold     	0.000000
        flap_detection_enabled  	1
        flap_detection_options  	o,d,u
        freshness_threshold     	0
        check_freshness 		0
        notification_options    	d,u,r
        notifications_enabled   	1
        notification_interval   	120.000000
        first_notification_delay        0.000000
        stalking_options        	n
        process_perf_data       	1
        failure_prediction_enabled      1
        retain_status_information       1
        retain_nonstatus_information    1
	_MYSQL_PASSWORD			foobar987763453!
}

define host {
        host_name                       2743localhost2
        alias                           2743localhost2
        address                         127.0.0.1
        check_period                    testconfig-24x7
        check_command                   2743test
        contact_groups                  testconfig-group-admin
        notification_period             testconfig-workhours
        initial_state                   o
        check_interval                  5.000000
        retry_interval                  1.000000
        max_check_attempts              10
        active_checks_enabled           1
        passive_checks_enabled          1
        obsess_over_host                1
        event_handler_enabled           1
        low_flap_threshold              0.000000
        high_flap_threshold             0.000000
        flap_detection_enabled          1
        flap_detection_options          o,d,u
        freshness_threshold             0
        check_freshness                 0
        notification_options            d,u,r
        notifications_enabled           1
        notification_interval           120.000000
        first_notification_delay        0.000000
        stalking_options                n
        process_perf_data               1
        failure_prediction_enabled      1
        retain_status_information       1
        retain_nonstatus_information    1
}

define host {
        host_name                       2743localhost3
        alias                           2743localhost3
        address                         127.0.0.1
        check_period                    testconfig-24x7
        check_command                   2743test
        contact_groups                  testconfig-group-admin
        notification_period             testconfig-workhours
        initial_state                   o
        check_interval                  5.000000
        retry_interval                  1.000000
        max_check_attempts              10
        active_checks_enabled           1
        passive_checks_enabled          1
        obsess_over_host                1
        event_handler_enabled           1
        low_flap_threshold              0.000000
        high_flap_threshold             0.000000
        flap_detection_enabled          1
        flap_detection_options          o,d,u
        freshness_threshold             0
        check_freshness                 0
        notification_options            d,u,r
        notifications_enabled           1
        notification_interval           120.000000
        first_notification_delay        0.000000
        stalking_options                n
        process_perf_data               1
        failure_prediction_enabled      1
        retain_status_information       1
        retain_nonstatus_information    1
}



define command{
        command_name                    2743test2
        command_line                    /bin/echo "2743 service"
}

##############################################
# host without service & command in tmpl
##############################################

define host {
	host_name			2743host_without_services
	use				2743hosttemplate01
}

##############################################
# hostgroup re-link test
##############################################
define hostgroup {
	hostgroup_name			2347hg_many
	members				2743localhost1,2743localhost2
}
##############################################
# servicegroup re-link test
##############################################
define servicegroup {
        servicegroup_name		2743sg_many
        members                         2743localhost1,2743service1,2743localhost2,2743service2,2743localhost1,2743service3,2743localhost1,2743service4,2743localhost1,2743service5,2743localhost1,2743service6
}

define servicegroup {
        servicegroup_name		2743sg_B
        members                         2743localhost2,2743service2
}

define servicegroup {
        servicegroup_name		2743sg_CBA
# uncomment this for error test
#        servicegroup_members		2743sg_C,2743sg_B,2743sg_A
}


##############################################
# service templates with hostnames & services
##############################################
define service {
        name				2743template01
        host_name                       2743localhost1
        check_command                   2743test2
        use                             test-generic-service
	register			0
        event_handler                   2743_eventhandler01
}

define service {
	service_description		2743servicewithhostnameintemplate
	use 				2743template01
}

##############################################
# service templates with services and multiuse
##############################################
define service {
        name                            2743template02
        host_name                       2743localhost1
        check_command                   2743test2
        use                             test-generic-service
	retry_interval			20
        register                        0
}

define service {
        name                            2743template03
        host_name                       2743localhost2
	check_interval			30
        check_command                   2743test2
        use                             test-generic-service
        register                        0
}


define service {
        service_description             2743servicewithmultipletemplates
        use                             2743template02,2743template03
        host_name                       2743localhost1
}

##############################################
# service with hostgroups and host members
##############################################
define service {
        service_description             2743servicewithhostgroup01
	hostgroup_name			2743hostgroupwithservices
        check_command                   2743test2
        use                             test-generic-service
}

define service {
        service_description             2743servicewithhostgroup02
        hostgroup_name                  2743hostgroupwithservices
        check_command                   2743test2
        use                             test-generic-service
}

define service {
        service_description             2743servicewithhostgroups03
        hostgroup_name                  2743hostgroupwithservicesmore,2743hostgroupwithservicesevenmore
        check_command                   2743test2
        use                             test-generic-service
}

define host {
	host_name			2743hghost01
	use				2743hosttemplate01
	hostgroups			2743hostgroupwithservices
}

define host {
	host_name			2743hghost02
	use				2743hosttemplate01
}

define host {
	host_name			2743hghost03
	use				2743hosttemplate01
}

define hostgroup {
	hostgroup_name			2743hostgroupwithservices
	members			 	2743hghost02,2743hghost03
}

define hostgroup {
        hostgroup_name                  2743hostgroupwithservicesmore
        members                         2743hghost02
}

define hostgroup {
        hostgroup_name                  2743hostgroupwithservicesevenmore
        members                         2743hghost03
}



##############################################
# services
##############################################
define service {
        service_description             2743service1
        host_name                       2743localhost1,2743localhost2
        check_command                   2743test2
        use                             test-generic-service
}

define service {
        service_description             2743service2
        host_name                       2743localhost1,2743localhost2
        check_command                   2743test2
        use                             test-generic-service
}

define service {
        service_description             2743service3
        host_name                       2743localhost1,2743localhost2
        check_command                   2743test2
        use                             test-generic-service
}

define service {
        service_description             2743service4
        host_name                       2743localhost1,2743localhost2
        check_command                   2743test2
        use                             test-generic-service
}

define service {
        service_description             2743service5
        host_name                       2743localhost1,2743localhost2
        check_command                   2743test2
        use                             test-generic-service
}

define service {
        service_description             2743service6
        host_name                       2743localhost1,2743localhost2
        check_command                   2743test2
        use                             test-generic-service
}


##############################################
# hostdependencies
##############################################

define host {
        host_name                       2743dep_host01
        use                             2743hosttemplate01
        hostgroups                      2743hg_dep1
}

define host {
        host_name                       2743dep_host02
        use                             2743hosttemplate01
        hostgroups                      2743hg_dep1
}

define host {
        host_name                       2743dep_host03
        use                             2743hosttemplate01
        hostgroups                      2743hg_dep2
}

define host {
        host_name                       2743dep_host04
        use                             2743hosttemplate01
}

define host {
        host_name                       2743dep_host05
        use                             2743hosttemplate01
}

define hostgroup {
        hostgroup_name                  2743hg_dep1
}

define hostgroup {
        hostgroup_name                  2743hg_dep2
}


# with host_name
define hostdependency {
        dependent_host_name             2743dep_host05
        host_name                       2743dep_host04
        inherits_parent                 1
        notification_failure_criteria   d,u
        execution_failure_criteria      d,u
        dependency_period               testconfig-24x7
}

# with hostgroup_name
define hostdependency {
        dependent_hostgroup_name        2743hg_dep1
        hostgroup_name			2743hg_dep2
        inherits_parent                 1
        notification_failure_criteria   d,u
        execution_failure_criteria      d,u
        dependency_period               testconfig-24x7
}

##############################################
# servicedependencies
##############################################

define host {
        host_name                       2743dep_hostsvc01
        use                             2743hosttemplate01
}

define host {
        host_name                       2743dep_hostsvc02
        use                             2743hosttemplate01
        hostgroups                      2743hg_svcdep1
}

define host {
        host_name                       2743dep_hostsvc03
        use                             2743hosttemplate01
        hostgroups                      2743hg_svcdep2
}

define host {
        host_name                       2743dep_hostsvc04
        use                             2743hosttemplate01
}

define host {
        host_name                       2743dep_hostsvc05
        use                             2743hosttemplate01
}

define hostgroup {
        hostgroup_name                  2743hg_svcdep1
}

define hostgroup {
        hostgroup_name                  2743hg_svcdep2
}

define service {
        service_description             2743dep_svc01
        host_name                       2743dep_hostsvc01,2743dep_hostsvc05,2743dep_hostsvc04,2743dep_hostsvc03
        check_command                   2743test2
        use                             test-generic-service
}

define service {
        service_description             2743dep_svc02
        host_name                       2743dep_hostsvc01,2743dep_hostsvc02
        check_command                   2743test2
        use                             test-generic-service
}

define service {
        service_description             2743dep_svc03
        host_name                       2743dep_hostsvc03
        check_command                   2743test2
        use                             test-generic-service
}

# with host_name and service_description
define servicedependency {
        host_name                       2743dep_hostsvc05
        dependent_host_name             2743dep_hostsvc01
        service_description             2743dep_svc01
        dependent_service_description   2743dep_svc02
        execution_failure_criteria      u,c
        notification_failure_criteria   w,u,c
	inherits_parent			1
}

# with hostgroup_name and service_description
define servicedependency {
	hostgroup_name			2743hg_svcdep2
	dependent_hostgroup_name	2743hg_svcdep1
        service_description             2743dep_svc01
        dependent_service_description   2743dep_svc02
        execution_failure_criteria      u,c
        notification_failure_criteria   w,u,c
        inherits_parent                 1
}

##############################################
# serviceescalations
##############################################

# hide servicegroup in template tree, and put escalation based on servicegroup
define service {
        name                            2743servicetemplate_sg01
        servicegroups                   2743sg_many
        check_command                   2743test2
        use                             test-generic-service
        register                        0
}

define service {
        use                             2743servicetemplate_sg01
        service_description             2743service_sg01
        host_name                       2743dep_hostsvc03
}

# with host_name and service_description
define serviceescalation {
        host_name                       2743dep_hostsvc05
        service_description             2743dep_svc01
        first_notification              2
        last_notification               6
	    contact_groups			        2743cg_ops,2743cg_manager ; 2743testconfig-admin, 2743testconfig-operator, 2743testconfig-manager

}

# with hostgroup_name and service_description
define serviceescalation {
        hostgroup_name                  2743hg_svcdep2
        service_description             2743dep_svc01
        first_notification              2
        last_notification               9
	    contact_groups			        2743cg_ops
        contacts                        2743testconfig-user
}

# with servicegroup_name
define serviceescalation {
        servicegroup_name               2743sg_many
        first_notification              2
        last_notification               1337
#        contact_groups                   2743cg_ops
        contacts                        2743testconfig-ticket
}


##############################################
# service with wildcard '*' on host_name
##############################################
#define service {
#        service_description             2743serviceforallhosts
#        host_name                  	*,!2743host_without_services
#        check_command                   2743test2
#        use                             test-generic-service
#        servicegroups                   2743sg_allservices
#}

define servicegroup {
        servicegroup_name              2743sg_allservices
}

##############################################
# hostgroup members with wildcard '*'
##############################################

define hostgroup {
        hostgroup_name                  2347hg_wildcard_all
	members				*
}

##############################################
# service with excludes on host_name
##############################################
define service {
        service_description             2743servicewithexcludes
        host_name                       2743localhost1,!2743localhost2,2743localhost3
        check_command                   2743test2
        use                             test-generic-service
}

##############################################
# service and template with additive inheritance
##############################################
define service {
        name             		2743servicetemplatecontacts
        host_name                       2743localhost1
        check_command                   2743test2
        use                             test-generic-service
	register			0
	contacts			2743testconfig-admin
}

define service {
        service_description             2743servicecontactsadditive
        host_name                       2743localhost1
        check_command                   2743test2
        use                             2743servicetemplatecontacts
        contacts                        +2743testconfig-manager,2743testconfig-operator
}

##############################################
# host and hostgroup with additive inheritance
##############################################

define hostgroup {
        hostgroup_name                  2347hg_additive01
}

define hostgroup {
        hostgroup_name                  2347hg_additive02
}

define hostgroup {
        hostgroup_name                  2347hg_additive03
}

define host {
        name                       	2743additivetemplate_host01
        use                             2743hosttemplate01
	register			0
	hostgroups			2347hg_additive01
}

define host {
	host_name			2743additive_host01
	use				2743additivetemplate_host01
	hostgroups			+2347hg_additive03,2347hg_additive02
}

##############################################
# notification_options 
##############################################

define contact{
        contact_name                    2743testconfig-user-notification-options
        use                             2743testconfig-generic-contact
        alias                           Icinga Test User Notification Options
        service_notification_options    c,f,s,u
        email                           icinga@localhost
}

define host {
        host_name                       2743host_notification_options
        use                             2743hosttemplate01
        notification_options    	    d,u,r
}


define service {
        service_description             2743service_notification_options_all
        host_name                       2743localhost1
        use                             2743servicetemplatecontacts
        notification_options    	    w,c,f,s,u,a,r,a
}

define service {
        service_description             2743service_notification_options_none
        host_name                       2743localhost1
        use                             2743servicetemplatecontacts
        notification_options    	    w,c,f,s,n,u,r,n
}

define service {
        service_description             2743service_notification_options_some
        host_name                       2743localhost1
        use                             2743servicetemplatecontacts
        notification_options    	    c,f,s,u
}

##############################################
# null value (disable)
##############################################

define service {
        service_description             2743service_nulled_contacts
        host_name                       2743localhost1
        use                             2743servicetemplatecontacts
}


##############################################
# custom attr
##############################################

define host {
        host_name                       2743host_custom_attr
        use                             2743hosttemplate01
        notes                           bumsti
        icon_image                      ../../images/logos/Stats2.png
        icon_image_alt                  bumsti alt icon text
        action_url                      http://dev.icinga.org
        notes_url                       http://docs.icinga.org
        statusmap_image                 ../../images/logos/icinga.gif
        2d_coords                       1,2
        _CV                             cv bumsti01
        _PASSWORD                       uraergergeheim
        _DN                             cn=icinga2-dev-host,ou=icinga,ou=main,ou=IcingaConfig,ou=LConf,dc=icinga,dc=org
}


define service {
        service_description             2743service_custom_attr
        host_name                       2743localhost1
	check_command			2743test_with_args!$_SERVICEPASSWORD$!bumstinormal
        use                             2743servicetemplatecontacts
        notes                           bumsti
        icon_image                      ../../images/logos/Stats2.png
        icon_image_alt                  bumsti alt icon text
        action_url                      http://dev.icinga.org
        notes_url                       http://docs.icinga.org
        _CV                             cv bumsti02
        _PASSWORD                       uraergergeheim
        _DN                             cn=icinga2-dev-svc,ou=icinga,ou=main,ou=IcingaConfig,ou=LConf,dc=icinga,dc=org
}

define hostgroup {
        hostgroup_name                  2743hg_custom_attr
        notes                           bumsti
        action_url                      http://dev.icinga.org
        notes_url                       http://docs.icinga.org
}

define servicegroup {
        servicegroup_name               2743sg_custom_attr
        notes                           bumsti
        action_url                      http://dev.icinga.org
        notes_url                       http://docs.icinga.org
}

