###########################
# misc commands
###########################
# 'notify-by-email' command definition
define command{
        command_name    notify-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios  *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}

###########################
#check commands
###########################
define command{
        command_name    check_ping
        command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}

###########################
# time periods
###########################
define timeperiod{
        timeperiod_name 24x7
        alias           24 Hours A Day, 7 Days A Week
        sunday          00:00-24:00
        monday          00:00-24:00
        tuesday         00:00-24:00
        wednesday       00:00-24:00
        thursday        00:00-24:00
        friday          00:00-24:00
        saturday        00:00-24:00
}

###########################
#templates
###########################

define host{
        name                            generic-host
        notifications_enabled           0
        event_handler_enabled           0
        flap_detection_enabled          0
        process_perf_data               1
        retain_status_information       1
        retain_nonstatus_information    1
        max_check_attempts              2
        notification_interval           120
        notification_period             24x7
        notification_options            d,u,r
        register                        0
        contact_groups                  systems_team
        }

define service{
        name                            check_router
        active_checks_enabled           1
        passive_checks_enabled          1
        parallelize_check               1
        obsess_over_service             1
        check_freshness                 0
        notifications_enabled           1
        event_handler_enabled           1
        flap_detection_enabled          1
        process_perf_data               1
        retain_status_information       1
        retain_nonstatus_information    1
        register                        0
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              1
        normal_check_interval           1
        retry_check_interval            1
        contact_groups                  systems_team
        notification_interval           120
        notification_period             24x7
        notification_options            c,r
}

###########################
# contacts
###########################

define contact{
        contact_name                    haze
        alias                           Nagios Admin
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    n
        host_notification_options       n
        service_notification_commands   notify-by-email
	host_notification_commands      notify-by-email
        pager                           my@email.com
}

###########################
# contact groups
###########################
define contactgroup{
        contactgroup_name       systems_team
        alias                   da systems team
        members                 haze
}




###########################
# hosts 
###########################
define host {
        use             generic-host
        host_name       router-1
        alias           p0001
        address         127.0.0.1
}

###########################
# services
###########################

define service{
        use                     check_router
        host_name               router-1
        service_description     PING
        check_command           check_ping!100.0,20%!500.0,60%
}

###########################
# host groups
###########################
define hostgroup{
        hostgroup_name  host_group_1
        alias   ahost group 1
        members router-1
} 

