From 4247c22fc7b84d8b72da9250a056bf82a4ce12ee Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Tue, 1 Dec 2009 13:44:07 -0500 Subject: Correct default definition file source; remove unneeded config files --- files/configs/CentOS/commands.cfg | 255 ------------------------------ files/configs/CentOS/localhost.cfg | 309 ------------------------------------- manifests/default.pp | 2 +- 3 files changed, 1 insertion(+), 565 deletions(-) delete mode 100644 files/configs/CentOS/commands.cfg delete mode 100644 files/configs/CentOS/localhost.cfg diff --git a/files/configs/CentOS/commands.cfg b/files/configs/CentOS/commands.cfg deleted file mode 100644 index 2b1889c..0000000 --- a/files/configs/CentOS/commands.cfg +++ /dev/null @@ -1,255 +0,0 @@ -################################################################################ -# Sample command definitions for Nagios 2.10 -# -# Read the documentation for more information on this configuration file. I've -# provided some comments here, but things may not be so clear without further -# explanation, so make sure to read the HTML documentation! -# -# Last Modified: 11-21-2006 -# -################################################################################ - - -################################################################################ -# COMMAND DEFINITIONS -# -# SYNTAX: -# -# define command{ -# template -# name -# command_name -# command_line -# } -# -# WHERE: -# -# = object name of another command definition that should be -# used as a template for this definition (optional) -# = object name of command definition, referenced by other -# command definitions that use it as a template (optional) -# = name of the command, as recognized/used by Nagios -# = command line -# -################################################################################ - - - - -################################################################################ -# -# SAMPLE SERVICE CHECK COMMANDS -# -# These are some example service check commands. They may or may not work on -# your system, as they must be modified for your plugins. See the HTML -# documentation on the plugins for examples of how to configure command definitions. -# -################################################################################ - - -################################################################################ -# NOTE: The following 'check_local_...' functions are designed to monitor -# various metrics on the host that Nagios is running on (i.e. this one). -################################################################################ - -# 'check_local_disk' command definition -define command{ - command_name check_local_disk - command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$ - } - - -# 'check_local_load' command definition -define command{ - command_name check_local_load - command_line $USER1$/check_load -w $ARG1$ -c $ARG2$ - } - - -# 'check_local_procs' command definition -define command{ - command_name check_local_procs - command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$ - } - - -# 'check_local_users' command definition -define command{ - command_name check_local_users - command_line $USER1$/check_users -w $ARG1$ -c $ARG2$ - } - - - -################################################################################ -# NOTE: The following 'check_...' commands are used to monitor services on -# both local and remote hosts. -################################################################################ - -# 'check_dns' command definition -define command{ - command_name check_dns - command_line $USER1$/check_dns -H www.yahoo.com -s $HOSTADDRESS$ - } - - -# 'check_ftp' command definition -define command{ - command_name check_ftp - command_line $USER1$/check_ftp -H $HOSTADDRESS$ - } - - -# 'check_hpjd' command definition -define command{ - command_name check_hpjd - command_line $USER1$/check_hpjd -H $HOSTADDRESS$ -C public - } - - -# 'check_http' command definition -define command{ - command_name check_http - command_line $USER1$/check_http -H $HOSTADDRESS$ - } - - -# 'check_nntp' command definition -define command{ - command_name check_nntp - command_line $USER1$/check_nntp -H $HOSTADDRESS$ - } - - -# 'check_ping' command definition -define command{ - command_name check_ping - command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5 - } - - -# 'check_pop' command definition -define command{ - command_name check_pop - command_line $USER1$/check_pop -H $HOSTADDRESS$ - } - - -# 'check_smtp' command definition -define command{ - command_name check_smtp - command_line $USER1$/check_smtp -H $HOSTADDRESS$ - } - - -# 'check_tcp' command definition -define command{ - command_name check_tcp - command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ - } - - -# 'check_telnet' command definition -define command{ - command_name check_telnet - command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 23 - } - - -# 'check_udp' command definition -define command{ - command_name check_udp - command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ - } - - - - -################################################################################ -# -# SAMPLE HOST CHECK COMMANDS -# -################################################################################ - - -# This command checks to see if a host is "alive" by pinging it -# The check must result in a 100% packet loss or 5 second (5000ms) round trip -# average time to produce a critical error. -# Note: Only one ICMP echo packet is sent (determined by the '-p 1' argument) - -# 'check-host-alive' command definition -define command{ - command_name check-host-alive - command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1 - } - - - - -################################################################################ -# -# SAMPLE NOTIFICATION COMMANDS -# -# These are some example notification commands. They may or may not work on -# your system without modification. As an example, some systems will require -# you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below. -# -################################################################################ - - -# 'host-notify-by-email' command definition -define command{ - command_name host-notify-by-email - command_line /usr/bin/printf "%b" "***** Nagios 2.10 *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$ - } - - -# 'host-notify-by-epager' command definition -define command{ - command_name host-notify-by-epager - command_line /usr/bin/printf "%b" "Host '$HOSTALIAS$' is $HOSTSTATE$\nInfo: $HOSTOUTPUT$\nTime: $LONGDATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTPAGER$ - } - -# 'notify-by-email' command definition -define command{ - command_name notify-by-email - command_line /usr/bin/printf "%b" "***** Nagios 2.10 *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ - } - - -# 'notify-by-epager' command definition -define command{ - command_name notify-by-epager - command_line /usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $SERVICEOUTPUT$\nDate: $LONGDATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$ - } - - - - - -################################################################################ -# -# SAMPLE PERFORMANCE DATA COMMANDS -# -# These are sample performance data commands that can be used to send performance -# data output to two text files (one for hosts, another for services). If you -# plan on simply writing performance data out to a file, consider using the -# host_perfdata_file and service_perfdata_file options in the main config file. -# -################################################################################ - - -# 'process-host-perfdata' command definition -define command{ - command_name process-host-perfdata - command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /var/log/nagios/host-perfdata.out - } - - -# 'process-service-perfdata' command definition -define command{ - command_name process-service-perfdata - command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /var/log/nagios/service-perfdata.out - } - - diff --git a/files/configs/CentOS/localhost.cfg b/files/configs/CentOS/localhost.cfg deleted file mode 100644 index 25dd23f..0000000 --- a/files/configs/CentOS/localhost.cfg +++ /dev/null @@ -1,309 +0,0 @@ -############################################################################### -# LOCALHOST.CFG - SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE -# -# Last Modified: 11-27-2006 -# -# NOTE: This config file is intended to servce as an *extremely* simple -# example of how you can create your object configuration file(s). -# -############################################################################### - - - -############################################################################### -############################################################################### -# -# TIME PERIODS -# -############################################################################### -############################################################################### - -# This defines a timeperiod where all times are valid for checks, -# notifications, etc. The classic "24x7" support nightmare. :-) - -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 - } - - -# 'workhours' timeperiod definition -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 - } - - -# 'nonworkhours' timeperiod definition -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 - } - - -# 'none' timeperiod definition -define timeperiod{ - timeperiod_name none - alias No Time Is A Good Time - } - - - -############################################################################### -############################################################################### -# -# COMMANDS -# -############################################################################### -############################################################################### - -# NOTE: Sample command definitions can now be found in the sample commands.cfg -# file - - - - -############################################################################### -############################################################################### -# -# CONTACTS -# -############################################################################### -############################################################################### - -# In this simple config file, a single contact will receive all alerts. -# This assumes that you have an account (or email alias) called -# "nagios-admin" on the local host. - -define contact{ - contact_name nagios-admin - alias Nagios Admin - service_notification_period 24x7 - host_notification_period 24x7 - service_notification_options w,u,c,r - host_notification_options d,r - service_notification_commands notify-by-email - host_notification_commands host-notify-by-email - email nagios-admin - } - - - -############################################################################### -############################################################################### -# -# CONTACT GROUPS -# -############################################################################### -############################################################################### - -# We only have one contact in this simple configuration file, so there is -# no need to create more than one contact group. - -define contactgroup{ - contactgroup_name admins - alias Nagios Administrators - members nagios-admin - } - - - -############################################################################### -############################################################################### -# -# HOSTS -# -############################################################################### -############################################################################### - -# Generic host definition template - This is NOT a real host, just a template! - -define host{ - name generic-host ; The name of this host template - notifications_enabled 1 ; Host notifications are enabled - event_handler_enabled 1 ; Host event handler is enabled - flap_detection_enabled 1 ; Flap detection is enabled - failure_prediction_enabled 1 ; Failure prediction is enabled - process_perf_data 1 ; Process performance data - retain_status_information 1 ; Retain status information across program restarts - retain_nonstatus_information 1 ; Retain non-status information across program restarts - notification_period 24x7 ; Send host notifications at any time - register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE! - } - - -# Linux host definition template - This is NOT a real host, just a template! - -define host{ - name linux-server ; The name of this host template - use generic-host ; This template inherits other values from the generic-host template - check_period 24x7 ; By default, Linux hosts are checked round the clock - max_check_attempts 10 ; Check each Linux host 10 times (max) - check_command check-host-alive ; Default command to check Linux hosts - notification_period workhours ; Linux admins hate to be woken up, so we only notify during the day - ; Note that the notification_period variable is being overridden from - ; the value that is inherited from the generic-host template! - notification_interval 120 ; Resend notification every 2 hours - notification_options d,u,r ; Only send notifications for specific host states - contact_groups admins ; Notifications get sent to the admins by default - register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE! - } - - -# Since this is a simple configuration file, we only monitor one host - the -# local host (this machine). - -define host{ - use linux-server ; Name of host template to use - ; This host definition will inherit all variables that are defined - ; in (or inherited by) the linux-server host template definition. - host_name localhost - alias localhost - address 127.0.0.1 - } - - - -############################################################################### -############################################################################### -# -# HOST GROUPS -# -############################################################################### -############################################################################### - -# We only have one host in our simple config file, so there is no need to -# create more than one hostgroup. - -define hostgroup{ - hostgroup_name test - alias Test Servers - members localhost - } - - - -############################################################################### -############################################################################### -# -# SERVICES -# -############################################################################### -############################################################################### - -# Generic service definition template - This is NOT a real service, just a template! - -define service{ - name generic-service ; The 'name' of this service template - active_checks_enabled 1 ; Active service checks are enabled - passive_checks_enabled 1 ; Passive service checks are enabled/accepted - parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems) - obsess_over_service 1 ; We should obsess over this service (if necessary) - check_freshness 0 ; Default is to NOT check service 'freshness' - notifications_enabled 1 ; Service notifications are enabled - event_handler_enabled 1 ; Service event handler is enabled - flap_detection_enabled 1 ; Flap detection is enabled - failure_prediction_enabled 1 ; Failure prediction is enabled - process_perf_data 1 ; Process performance data - retain_status_information 1 ; Retain status information across program restarts - retain_nonstatus_information 1 ; Retain non-status information across program restarts - is_volatile 0 ; The service is not volatile - register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE! - } - - -# Local service definition template - This is NOT a real service, just a template! - -define service{ - name local-service ; The name of this service template - use generic-service ; Inherit default values from the generic-service definition - check_period 24x7 ; The service can be checked at any time of the day - max_check_attempts 4 ; Re-check the service up to 4 times in order to determine its final (hard) state - normal_check_interval 5 ; Check the service every 5 minutes under normal conditions - retry_check_interval 1 ; Re-check the service every minute until a hard state can be determined - contact_groups admins ; Notifications get sent out to everyone in the 'admins' group - notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events - notification_interval 60 ; Re-notify about service problems every hour - notification_period 24x7 ; Notifications can be sent out at any time - register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE! - } - - -# Define a service to "ping" the local machine - -define service{ - use local-service ; Name of service template to use - host_name localhost - service_description PING - check_command check_ping!100.0,20%!500.0,60% - } - - -# Define a service to check the disk space of the root partition -# on the local machine. Warning if < 20% free, critical if -# < 10% free space on partition. - -define service{ - use local-service ; Name of service template to use - host_name localhost - service_description Root Partition - check_command check_local_disk!20%!10%!/ - } - - - -# Define a service to check the number of currently logged in -# users on the local machine. Warning if > 20 users, critical -# if > 50 users. - -define service{ - use local-service ; Name of service template to use - host_name localhost - service_description Current Users - check_command check_local_users!20!50 - } - - -# Define a service to check the number of currently running procs -# on the local machine. Warning if > 250 processes, critical if -# > 400 users. - -define service{ - use local-service ; Name of service template to use - host_name localhost - service_description Total Processes - check_command check_local_procs!250!400!RSZDT - } - - - -# Define a service to check the load on the local machine. - -define service{ - use local-service ; Name of service template to use - host_name localhost - service_description Current Load - check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0 - } - - - diff --git a/manifests/default.pp b/manifests/default.pp index daae94d..d5be090 100644 --- a/manifests/default.pp +++ b/manifests/default.pp @@ -4,7 +4,7 @@ define nagios::default { path => "${nagios_cfg_dir}/defaults/${name}.cfg", source => [ "puppet://$server/files/nagios/configs/${fqdn}/defaults/${name}.cfg", "puppet://$server/files/nagios/configs/${operatingsystem}/defaults/${name}.cfg", - "puppet://$server/files/nagios/configs/${name}.cfg", + "puppet://$server/files/nagios/configs/defaults/${name}.cfg", "puppet://$server/nagios/configs/${operatingsystem}/defaults/${name}.cfg", "puppet://$server/nagios/configs/defaults/${name}.cfg" ], notify => Service['nagios'], -- cgit v1.2.3