<file name="apache.conf">
##
##  apache.conf -- Nagios Apache Virtual Host Configuration
##

ScriptAlias /nagios/cgi @l_prefix@/cgi/nagios
Alias       /nagios     @l_prefix@/share/nagios

<Directory "@l_prefix@/cgi/nagios">
    Options       ExecCGI
    AllowOverride None
    Order         allow,deny
    Allow         from all
    AuthName      "Nagios Access"
    AuthType      Basic
    AuthUserFile  @l_prefix@/etc/nagios/apache.passwd
    Require       valid-user
</Directory>

<Directory "@l_prefix@/share/nagios">
    Options       None
    AllowOverride None
    Order         allow,deny
    Allow         from all
    AuthName      "Nagios Access"
    AuthType      Basic
    AuthUserFile  @l_prefix@/etc/nagios/apache.passwd
    Require       valid-user
</Directory>

</file>
<file name="apache.passwd">
nagios:4EFwh7XjC40.k
</file>
<file name="cgi.cfg">
##
##  cgi.cfg -- Nagios CGI Configuration
##

#
#   Nagios Master
#
main_config_file=@l_prefix@/etc/nagios/nagios.cfg
nagios_check_command=@l_prefix@/libexec/nagios/check_nagios @l_prefix@/var/nagios/run/nagios.status 5 '@l_prefix@/bin/nagios'

#
#   Interface
#
physical_html_path=@l_prefix@/web/nagios
url_html_path=/nagios
show_context_help=1
refresh_rate=90

#
#   Authentication
#
use_authentication=1
#default_user_name=guest
#authorized_for_system_information=nagios
#authorized_for_configuration_information=nagios
#authorized_for_system_commands=nagios
#authorized_for_all_services=nagios,guest
#authorized_for_all_hosts=nagios,guest
#authorized_for_all_service_commands=nagios
#authorized_for_all_host_commands=nagios

#
#   Status Map Rendering
#
default_statusmap_layout=5
default_statuswrl_layout=4
#statusmap_background_image=smbackground.gd2
#statuswrl_include=myworld.wrl
#host_unreachable_sound=hostdown.wav
#host_down_sound=hostdown.wav
#service_critical_sound=critical.wav
#service_warning_sound=warning.wav
#service_unknown_sound=warning.wav
ping_syntax=@l_prefix@/bin/gping -n -c 5 $HOSTADDRESS$

</file>
<file name="nagios.cfg">
##
##  nagios.cfg -- Nagios Master Configuration
##

#
#   Global
#
nagios_user=@l_rusr@
nagios_group=@l_ngrp@
use_syslog=0
daemon_dumps_core=0
status_file=@l_prefix@/var/nagios/run/nagios.status
object_cache_file=@l_prefix@/var/nagios/run/nagios.cache
temp_file=@l_prefix@/var/nagios/log/nagios.tmp
lock_file=@l_prefix@/var/nagios/run/nagios.pid
admin_email=@l_musr@
admin_pager=@l_musr@
p1_file=@l_prefix@/libexec/nagios/p1.pl

#
#   Logging
#
state_retention_file=@l_prefix@/var/nagios/log/retention.log
log_file=@l_prefix@/var/nagios/log/nagios.log
log_rotation_method=d
log_archive_path=@l_prefix@/var/nagios/log
log_notifications=1
log_service_retries=1
log_host_retries=1
log_event_handlers=1
log_initial_states=0
log_external_commands=1
log_passive_checks=1

#
#   Resource Configuration
#
resource_file=@l_prefix@/etc/nagios/resource.cfg

#
#   Object Configurations
#
cfg_file=@l_prefix@/etc/nagios/commands.cfg
cfg_file=@l_prefix@/etc/nagios/contacts.cfg
cfg_file=@l_prefix@/etc/nagios/timeperiods.cfg
cfg_file=@l_prefix@/etc/nagios/hosts.cfg
cfg_file=@l_prefix@/etc/nagios/services.cfg

#
#   External Command Queue
#
check_external_commands=1
command_check_interval=1s
command_file=@l_prefix@/var/nagios/cmd/nagios.cmd

#
#   Event Brokers
#
event_broker_options=-1
#broker_module=/somewhere/module1.o
#broker_module=/somewhere/module2.o arg1 arg2=3 debug=0

#
#  Global Host and Service Event Handlers
#
#global_host_event_handler=somecommand
#global_service_event_handler=somecommand

#
#   State Retention
#
retain_state_information=1
state_retention_file=@l_prefix@/var/nagios/run/nagios.state
retention_update_interval=60
use_retained_program_state=1
use_retained_scheduling_info=0

#
#   Performance Logging
#
process_performance_data=0
#host_perfdata_command=process-host-perfdata
#service_perfdata_command=process-service-perfdata
#host_perfdata_file=/tmp/host-perfdata
#service_perfdata_file=/tmp/service-perfdata
#host_perfdata_file_template=[HOSTPERFDATA]\t$TIMET$\t$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$
#service_perfdata_file_template=[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$
#host_perfdata_file_mode=a
#service_perfdata_file_mode=a
#host_perfdata_file_processing_interval=0
#service_perfdata_file_processing_interval=0
#host_perfdata_file_processing_command=process-host-perfdata-file
#service_perfdata_file_processing_command=process-service-perfdata-file

#
#  Operation Options
#
service_inter_check_delay_method=s
max_service_check_spread=30
service_interleave_factor=s
host_inter_check_delay_method=s
max_host_check_spread=30
max_concurrent_checks=0
check_result_reaper_frequency=10
auto_reschedule_checks=0
auto_rescheduling_interval=30
auto_rescheduling_window=180
sleep_time=0.25
service_check_timeout=60
host_check_timeout=30
event_handler_timeout=30
notification_timeout=30
ocsp_timeout=5
perfdata_timeout=5
interval_length=60
use_aggressive_host_checking=0
execute_service_checks=1
accept_passive_service_checks=1
execute_host_checks=1
accept_passive_host_checks=1
enable_notifications=1
enable_event_handlers=1
obsess_over_services=0
#ocsp_command=somecommand
check_for_orphaned_services=0
check_service_freshness=1
service_freshness_check_interval=60
check_host_freshness=0
host_freshness_check_interval=60
status_update_interval=15
enable_flap_detection=0
low_service_flap_threshold=5.0
high_service_flap_threshold=20.0
low_host_flap_threshold=5.0
high_host_flap_threshold=20.0
date_format=iso8601
illegal_object_name_chars=`~!$%^&*|'"<>?,()=
illegal_macro_output_chars=`~$&|'"<>
use_regexp_matching=0
use_true_regexp_matching=0

</file>
<file name="contacts.cfg">
##
##  contacts.cfg -- Nagios Contact Definitions
##

define contactgroup {
    contactgroup_name               unix-admins
    alias                           Unix Administrators
    members                         nagios
}

define contact {
    contact_name                    nagios
    alias                           Nagios Administrator
    service_notification_period     24x7
    host_notification_period        24x7
    service_notification_options    w,u,c,r
    host_notification_options       d,u,r
    service_notification_commands   serv-notify-by-email,serv-notify-by-epager
    host_notification_commands      host-notify-by-email,host-notify-by-epager
    email                           nagios-admin@example.com
    pager                           nagios-admin+sms@example.com
}

define command {
    command_name                    serv-notify-by-email
    command_line                    @l_prefix@/bin/gprintf "%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$" | @l_prefix@/bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}

define command {
    command_name                    serv-notify-by-epager
    command_line                    @l_prefix@/bin/gprintf "%b" "Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $SERVICEOUTPUT$\nDate: $LONGDATETIME$" | @l_prefix@/bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$
}

define command {
    command_name                    host-notify-by-email
    command_line                    @l_prefix@/bin/gprintf "%b" "***** Nagios  *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | @l_prefix@/bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
}

define command {
    command_name                    host-notify-by-epager
    command_line                    @l_prefix@/bin/gprintf "%b" "Host '$HOSTALIAS$' is $HOSTSTATE$\nInfo: $HOSTOUTPUT$\nTime: $LONGDATETIME$" | @l_prefix@/bin/mail -s "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTPAGER$
}

</file>
<file name="commands.cfg">
##
##  commands.cfg -- Nagios Command Definitions
##

#
#   Special Checks
#

define command {
    command_name    check_host_alive
    command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1
}

#
#   Local System Checks
#

define command {
    command_name    check_local_disk
    command_line    $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
}

define command {
    command_name    check_local_load
    command_line    $USER1$/check_load -w $ARG1$ -c $ARG2$
}

define command {
    command_name    check_local_users
    command_line    $USER1$/check_users -w $ARG1$ -c $ARG2$
}

define command {
    command_name    check_local_procs
    command_line    $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
}

#
#   Remote System Checks
#

define command {
    command_name    check_snmp_disk
    command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o UCD-SNMP-MIB::dskAvail.$ARG1$,UCD-SNMP-MIB::dskPercent.$ARG1$ -w $ARG2$:,:$ARG3$ -c $ARG4$:,:$ARG5$ -u 'kB free (','% used)' -l 'disk space'
}

define command {
    command_name    check_snmp_load
    command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o UCD-SNMP-MIB::laLoadInt.1,UCD-SNMP-MIB::laLoadInt.2,UCD-SNMP-MIB::laLoadInt.3 -w :$ARG2$,:$ARG3$,:$ARG4$ -w :$ARG5$,:$ARG6$,:$ARG7$ -l load
}

define command {
    command_name    check_snmp_users
    command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrSystem.hrSystemNumUsers -w :$ARG2$ -c :$ARG3$ -l users
}

define command {
    command_name    check_snmp_procs
    command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrSystem.hrSystemProcesses -w :$ARG2$ -c :$ARG3$ -l processes
}

#
#   Remote Network Service Checks
#

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

define command {
    command_name    check_net_ping_fast
    command_line    $USER1$/check_fping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}

define command {
    command_name    check_net_tcp
    command_line    $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$
}

define command {
    command_name    check_net_udp
    command_line    $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$
}

define command {
    command_name    check_net_dns
    command_line    $USER1$/check_dns -H $ARG1$ -s $HOSTADDRESS$
}

define command {
    command_name    check_net_http
    command_line    $USER1$/check_http -H $HOSTADDRESS$ -I $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
}

</file>
<file name="hosts.cfg">
##
##  hosts.cfg -- Nagios Hosts Definitions
##

#
#   Host Groups
#

define hostgroup {
    hostgroup_name                  unix-servers
    alias                           Unix Servers
    members                         localhost
}

#
#   Host Template
#

define host {
    name                            generic-host
    register                        0
    notifications_enabled           1
    event_handler_enabled           1
    flap_detection_enabled          1
    process_perf_data               1
    retain_status_information       1
    retain_nonstatus_information    1
}

#
#   Host Definitions
#

define host {
    use                             generic-host
    host_name                       localhost
    alias                           Local Unix Host
    address                         127.0.0.1
    check_command                   check_host_alive
    max_check_attempts              10
    notification_interval           480
    notification_period             24x7
    notification_options            d,u,r
    contact_groups                  unix-admins
}

</file>
<file name="resource.cfg">
##
##  resource.cfg -- Nagios Resource Definitions
##

#   You can define $USERx$ macros in this file, which can in turn be
#   used in command definitions in your host config file(s). $USERx$
#   macros are useful for storing sensitive information such as
#   usernames, passwords, etc. They are also handy for specifying the
#   path to plugins and event handlers - if you decide to move the
#   plugins or event handlers to a different directory in the future,
#   you can just update one or two $USERx$ macros, instead of modifying
#   a lot of command definitions. The CGIs will not attempt to read the
#   contents of resource files, so you can set restrictive permissions
#   (600 or 660) on them. Nagios supports up to 32 $USERx$ macros
#   ($USER1$ through $USER32$)

$USER1$=@l_prefix@/libexec/nagios
# $USER2$=@l_prefix@/libexec/nagios/eventhandlers
# $USER3$=myusername
# $USER4$=mypassword

</file>
<file name="services.cfg">
##
##  services.cfg -- Nagios Services Definitions
##

#
#   Service Template
#

define service {
    name                            generic-service
    register                        0
    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
}

#
#   Service Definitions
#

define service {
    use                             generic-service
    host_name                       localhost
    service_description             Root Filesystem Partition
    is_volatile                     0
    check_period                    24x7
    max_check_attempts              3
    normal_check_interval           5
    retry_check_interval            1
    contact_groups                  unix-admins
    notification_interval           120
    notification_period             24x7
    notification_options            w,u,c,r
    check_command                   check_local_disk!20%!10%!/
}

define service {
    use                             generic-service
    host_name                       localhost
    service_description             System Load
    is_volatile                     0
    check_period                    24x7
    max_check_attempts              3
    normal_check_interval           5
    retry_check_interval            1
    contact_groups                  unix-admins
    notification_interval           120
    notification_period             24x7
    notification_options            w,u,c,r
    check_command                   check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}


define service {
    use                             generic-service
    host_name                       localhost
    service_description             System Users
    is_volatile                     0
    check_period                    24x7
    max_check_attempts              3
    normal_check_interval           5
    retry_check_interval            1
    contact_groups                  unix-admins
    notification_interval           240
    notification_period             24x7
    notification_options            w,u,c,r
    check_command                   check_local_users!20!50
}

define service {
    use                             generic-service
    host_name                       localhost
    service_description             System Processes
    is_volatile                     0
    check_period                    24x7
    max_check_attempts              3
    normal_check_interval           5
    retry_check_interval            1
    contact_groups                  unix-admins
    notification_interval           240
    notification_period             24x7
    notification_options            w,u,c,r
    check_command                   check_local_procs!200!400!RSZDT
}

define service {
    use                             generic-service
    host_name                       localhost
    service_description             System Reachability
    is_volatile                     0
    check_period                    24x7
    max_check_attempts              3
    normal_check_interval           5
    retry_check_interval            1
    contact_groups                  unix-admins
    notification_interval           240
    notification_period             24x7
    notification_options            c,r
    check_command                   check_net_ping!100.0,20%!500.0,60%
}

</file>
<file name="timeperiods.cfg">
##
##  timeperiods.cfg -- Nagios Time Periods Definitions
##

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
}

define timeperiod {
    timeperiod_name workhours
    alias           "Normal" Working Hours
    monday          09:00-17:00
    tuesday         09:00-17:00
    wednesday       09:00-17:00
    thursday        09:00-17:00
    friday          09:00-17:00
}

define timeperiod {
    timeperiod_name nonworkhours
    alias           Non-Work Hours
    sunday          00:00-24:00
    monday          00:00-09:00,17:00-24:00
    tuesday         00:00-09:00,17:00-24:00
    wednesday       00:00-09:00,17:00-24:00
    thursday        00:00-09:00,17:00-24:00
    friday          00:00-09:00,17:00-24:00
    saturday        00:00-24:00
}

define timeperiod {
    timeperiod_name none
    alias           No Time Is A Good Time
}

</file>
