diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-03-08 18:34:36 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-03-08 18:34:36 +0000 |
commit | 838ec7cd69a8eb5df3e03997d01a46ee6cfb5f1a (patch) | |
tree | 919cc9799839855a1f07628b9e1f85a52f69954f /nagios/objects | |
parent | Script nolonger required (diff) | |
download | config-838ec7cd69a8eb5df3e03997d01a46ee6cfb5f1a.tar.bz2 config-838ec7cd69a8eb5df3e03997d01a46ee6cfb5f1a.tar.xz config-838ec7cd69a8eb5df3e03997d01a46ee6cfb5f1a.zip |
Add Nagios config
Diffstat (limited to 'nagios/objects')
-rw-r--r-- | nagios/objects/cluster.cfg | 238 | ||||
-rw-r--r-- | nagios/objects/commands.cfg | 127 | ||||
-rw-r--r-- | nagios/objects/contacts.cfg | 51 | ||||
-rw-r--r-- | nagios/objects/printer.cfg | 82 | ||||
-rw-r--r-- | nagios/objects/switch.cfg | 99 | ||||
-rw-r--r-- | nagios/objects/templates.cfg | 204 | ||||
-rw-r--r-- | nagios/objects/timeperiods.cfg | 112 | ||||
-rw-r--r-- | nagios/objects/windows.cfg | 141 |
8 files changed, 1054 insertions, 0 deletions
diff --git a/nagios/objects/cluster.cfg b/nagios/objects/cluster.cfg new file mode 100644 index 0000000..804580d --- /dev/null +++ b/nagios/objects/cluster.cfg @@ -0,0 +1,238 @@ +# +# HOST DEFINITION +# + +define host { + use linux-server + host_name gateway + display_name Gateway + address gateway +} +define host { + use linux-server + host_name internet + display_name Internet edge + address core1-BE1.southbank.ukcore.bt.net + parents gateway +} +define host { + use linux-server + host_name defiant + display_name Defiant + address defiant +} +define host { + use linux-server + host_name firebrand + display_name Firebrand + address firebrand +} +define host { + use linux-server + host_name virtualip + display_name VirtualIP + address virtualip +} + +# +# HOST GROUP DEFINITION +# + +define hostgroup { + hostgroup_name linux-servers + alias Linux Servers + members firebrand,defiant +} + + + +############################################################################### +# +# SERVICE DEFINITIONS +# +############################################################################### + +# +# Machine state checks +# + +define service { + use local-service + host_name gateway,virtualip,internet + hostgroup_name linux-servers + service_description PING + check_command check_ping!100.0,20%!500.0,60% +} +define service { + use remote-service + hostgroup_name linux-servers + service_description Current Load + check_command check_load +} +define service { + use remote-service + hostgroup_name linux-servers + service_description Current Users + check_command check_users +} +define service { + use remote-service + hostgroup_name linux-servers + service_description Total Processes + check_command check_procs +} +define service { + use remote-service + hostgroup_name linux-servers + service_description Swap Usage + check_command check_swap!20 +} +define service { + use remote-service + hostgroup_name linux-servers + service_description Root Volume + check_command check_disk!20%!10%!/ +} +define service { + use remote-service + hostgroup_name linux-servers + service_description PostgreSQL Volume + check_command check_disk!20%!10%!/var/lib/postgresql/ +} +define service { + use remote-service + hostgroup_name linux-servers + service_description MySQL Volume + check_command check_disk!20%!10%!/var/lib/mysql/ +} +define service { + use remote-service + hostgroup_name linux-servers + service_description Portage Volume + check_command check_disk!20%!10%!/usr/portage/ +} +define service { + use remote-service + hostgroup_name linux-servers + service_description Portage Repo + check_command check_file_age!/usr/portage/.git/FETCH_HEAD +} +define service { + use remote-service + host_name defiant + service_description Store Volume + check_command check_disk!20%!10%!/var/store/ +} +define service { + use remote-service + host_name defiant + service_description MythTV Volume + check_command check_disk!20%!10%!/var/store/mythrecordings/ +} +define service { + use remote-service + hostgroup_name linux-servers + service_description Apache Cache Volume + check_command check_disk!20%!10%!/var/cache/apache2/ +} + +# +# Machine service checks +# + +define service { + use local-service + hostgroup_name linux-servers + service_description SSH + check_command check_ssh +} +define service { + use local-service + hostgroup_name linux-servers + service_description PostgreSQL + check_command check_pgsql +} +define service { + use local-service + hostgroup_name linux-servers + service_description MySQL + check_command check_mysql +} +define service { + use local-service + hostgroup_name linux-servers + service_description NetFS + check_command check_ice!4000!Service +} +define service { + use local-service + hostgroup_name linux-servers + service_description GB API + check_command check_ice!9001!portage!users!maintenance +} + + +# +# Cluster state checks +# +define service { + use remote-service + host_name virtualip + service_description DRBD + check_command check_drbd + max_check_attempts 1 + check_interval 1 + retry_interval 1 +} +define service { + use remote-service + host_name virtualip + service_description Git Volume + check_command check_disk!20%!10%!/var/git/ +} +define service { + use remote-service + host_name virtualip + service_description Home Volume + check_command check_disk!20%!10%!/home/ +} +define service { + use remote-service + host_name virtualip + service_description WWW Volume + check_command check_disk!20%!10%!/var/www/shared/ +} + +# +# Cluster services checks +# +define service { + use local-service + host_name virtualip + service_description HA Proxy stats + check_command check_tcp!9000 +} +define service { + use local-service + host_name virtualip + service_description HTTPS + check_command check_tcp!443 +} +define service { + use local-service + host_name virtualip + service_description HTTP + check_command check_http +} +define service { + use local-service + host_name virtualip + service_description SMTP + check_command check_smtp +} +define service { + use local-service + host_name virtualip + service_description IMAPS + check_command check_simap +} diff --git a/nagios/objects/commands.cfg b/nagios/objects/commands.cfg new file mode 100644 index 0000000..0b22568 --- /dev/null +++ b/nagios/objects/commands.cfg @@ -0,0 +1,127 @@ +define command { + command_name notify-host-by-email + command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$ +} + +define command { + command_name notify-service-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$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ +} + +define command { + command_name check-host-alive + command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5 +} + +define command { + command_name check_file_age + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_file_age -a $ARG1$ +} + +define command { + command_name check_disk + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_disk -a $ARG1$ $ARG2$ $ARG3$ +} + +define command { + command_name check_drbd + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_drbd +} + +define command { + command_name check_load + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_load +} + +define command { + command_name check_procs + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_total_procs +} + +define command { + command_name check_users + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_users +} + +define command { + command_name check_swap + command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_swap -a $ARG1$ +} + + +################################################################################ +# NOTE: The following 'check_...' commands are used to monitor services on +# both local and remote hosts. +################################################################################ + +define command { + command_name check_ice + command_line $USER1$/check_ice $HOSTADDRESS$ -p $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ +} + +define command { + command_name check_http + command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$ +} + +define command { + command_name check_ssh + command_line $USER1$/check_ssh $ARG1$ $HOSTADDRESS$ +} + +define command { + command_name check_dhcp + command_line $USER1$/check_dhcp $ARG1$ +} + +define command { + command_name check_ping + command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5 +} + +define command { + command_name check_simap + command_line $USER1$/check_simap -H $HOSTADDRESS$ $ARG1$ +} + +define command { + command_name check_smtp + command_line $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$ +} + +define command { + command_name check_pgsql + command_line $USER1$/check_pgsql -H $HOSTADDRESS$ -l postgres +} + +define command { + command_name check_mysql + command_line $USER1$/check_mysql -H $HOSTADDRESS$ -P 13306 -S -w 10 -c 60 -u nagios -p r3pl +} + +define command { + command_name check_tcp + command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$ +} + +# +# 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. +# +################################################################################ + +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/nagios/host-perfdata.out +} + + + +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/nagios/service-perfdata.out +} diff --git a/nagios/objects/contacts.cfg b/nagios/objects/contacts.cfg new file mode 100644 index 0000000..e505211 --- /dev/null +++ b/nagios/objects/contacts.cfg @@ -0,0 +1,51 @@ +############################################################################### +# CONTACTS.CFG - SAMPLE CONTACT/CONTACTGROUP DEFINITIONS +# +# +# NOTES: This config file provides you with some example contact and contact +# group definitions that you can reference in host and service +# definitions. +# +# You don't need to keep these definitions in a separate file from your +# other object definitions. This has been done just to make things +# easier to understand. +# +############################################################################### + + + +############################################################################### +# +# CONTACTS +# +############################################################################### + +# Just one contact defined by default - the Nagios admin (that's you) +# This contact definition inherits a lot of default values from the +# 'generic-contact' template which is defined elsewhere. + +define contact { + + contact_name nagiosadmin ; Short name of user + use generic-contact ; Inherit default values from generic-contact template (defined above) + alias Nagios Admin ; Full name of user + email dan@randomdan.homeip.net +} + + + +############################################################################### +# +# 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 nagiosadmin +} diff --git a/nagios/objects/printer.cfg b/nagios/objects/printer.cfg new file mode 100644 index 0000000..59b2bfe --- /dev/null +++ b/nagios/objects/printer.cfg @@ -0,0 +1,82 @@ +############################################################################### +# PRINTER.CFG - SAMPLE CONFIG FILE FOR MONITORING A NETWORK PRINTER +# +# +# NOTES: This config file assumes that you are using the sample configuration +# files that get installed with the Nagios quickstart guide. +# +############################################################################### + + + +############################################################################### +# +# HOST DEFINITIONS +# +############################################################################### + +# Define a host for the printer we'll be monitoring +# Change the host_name, alias, and address to fit your situation + +define host { + + use generic-printer ; Inherit default values from a template + host_name hplj2605dn ; The name we're giving to this printer + alias HP LaserJet 2605dn ; A longer name associated with the printer + address 192.168.1.30 ; IP address of the printer + hostgroups network-printers ; Host groups this printer is associated with +} + + + +############################################################################### +# +# HOST GROUP DEFINITIONS +# +############################################################################### + +# A hostgroup for network printers + +define hostgroup { + + hostgroup_name network-printers ; The name of the hostgroup + alias Network Printers ; Long name of the group +} + + + +############################################################################### +# +# SERVICE DEFINITIONS +# +############################################################################### + +# Create a service for monitoring the status of the printer +# Change the host_name to match the name of the host you defined above +# If the printer has an SNMP community string other than "public", +# change the check_command directive to reflect that + +define service { + + use generic-service ; Inherit values from a template + host_name hplj2605dn ; The name of the host the service is associated with + service_description Printer Status ; The service description + check_command check_hpjd!-C public ; The command used to monitor the service + check_interval 10 ; Check the service every 10 minutes under normal conditions + retry_interval 1 ; Re-check the service every minute until its final/hard state is determined +} + + + +# Create a service for "pinging" the printer occasionally. +# Useful for monitoring RTA, packet loss, etc. + +define service { + + use generic-service + host_name hplj2605dn + service_description PING + check_command check_ping!3000.0,80%!5000.0,100% + check_interval 10 + retry_interval 1 +} diff --git a/nagios/objects/switch.cfg b/nagios/objects/switch.cfg new file mode 100644 index 0000000..c43ab75 --- /dev/null +++ b/nagios/objects/switch.cfg @@ -0,0 +1,99 @@ +############################################################################### +# SWITCH.CFG - SAMPLE CONFIG FILE FOR MONITORING A SWITCH +# +# +# NOTES: This config file assumes that you are using the sample configuration +# files that get installed with the Nagios quickstart guide. +# +############################################################################### + + + +############################################################################### +# +# HOST DEFINITIONS +# +############################################################################### + +# Define the switch that we'll be monitoring + +define host { + + use generic-switch ; Inherit default values from a template + host_name linksys-srw224p ; The name we're giving to this switch + alias Linksys SRW224P Switch ; A longer name associated with the switch + address 192.168.1.253 ; IP address of the switch + hostgroups switches ; Host groups this switch is associated with +} + + + +############################################################################### +# +# HOST GROUP DEFINITIONS +# +############################################################################### + +# Create a new hostgroup for switches + +define hostgroup { + + hostgroup_name switches ; The name of the hostgroup + alias Network Switches ; Long name of the group +} + + + +############################################################################### +# +# SERVICE DEFINITIONS +# +############################################################################### + +# Create a service to PING to switch + +define service { + + use generic-service ; Inherit values from a template + host_name linksys-srw224p ; The name of the host the service is associated with + service_description PING ; The service description + check_command check_ping!200.0,20%!600.0,60% ; The command used to monitor the service + check_interval 5 ; Check the service every 5 minutes under normal conditions + retry_interval 1 ; Re-check the service every minute until its final/hard state is determined +} + + + +# Monitor uptime via SNMP + +define service { + + use generic-service ; Inherit values from a template + host_name linksys-srw224p + service_description Uptime + check_command check_snmp!-C public -o sysUpTime.0 +} + + + +# Monitor Port 1 status via SNMP + +define service { + + use generic-service ; Inherit values from a template + host_name linksys-srw224p + service_description Port 1 Link Status + check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB +} + + + +# Monitor bandwidth via MRTG logs + +define service { + + use generic-service ; Inherit values from a template + host_name linksys-srw224p + service_description Port 1 Bandwidth Usage + check_command check_local_mrtgtraf!/var/lib/mrtg/192.168.1.253_1.log!AVG!1000000,1000000!5000000,5000000!10 +} diff --git a/nagios/objects/templates.cfg b/nagios/objects/templates.cfg new file mode 100644 index 0000000..93175a0 --- /dev/null +++ b/nagios/objects/templates.cfg @@ -0,0 +1,204 @@ +############################################################################### +# TEMPLATES.CFG - SAMPLE OBJECT TEMPLATES +# +# +# NOTES: This config file provides you with some example object definition +# templates that are referred by other host, service, contact, etc. +# definitions in other config files. +# +# You don't need to keep these definitions in a separate file from your +# other object definitions. This has been done just to make things +# easier to understand. +# +############################################################################### + + + +############################################################################### +# +# CONTACT TEMPLATES +# +############################################################################### + +# Generic contact definition template +# This is NOT a real contact, just a template! + +define contact { + + name generic-contact ; The name of this contact template + service_notification_period 24x7 ; service notifications can be sent anytime + host_notification_period 24x7 ; host notifications can be sent anytime + service_notification_options w,u,c,r,f,s ; send notifications for all service states, flapping events, and scheduled downtime events + host_notification_options d,u,r,f,s ; send notifications for all host states, flapping events, and scheduled downtime events + service_notification_commands notify-service-by-email ; send service notifications via email + host_notification_commands notify-host-by-email ; send host notifications via email + register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE! +} + + + +############################################################################### +# +# HOST TEMPLATES +# +############################################################################### + +# 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 + 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 ; DON'T 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 + check_interval 5 ; Actively check the host every 5 minutes + retry_interval 1 ; Schedule host check retries at 1 minute intervals + 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 notifications 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 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE! +} + + + + +# Windows host definition template +# This is NOT a real host, just a template! + +define host { + + name windows-server ; The name of this host template + use generic-host ; Inherit default values from the generic-host template + check_period 24x7 ; By default, Windows servers are monitored round the clock + check_interval 5 ; Actively check the server every 5 minutes + retry_interval 1 ; Schedule host check retries at 1 minute intervals + max_check_attempts 10 ; Check each server 10 times (max) + check_command check-host-alive ; Default command to check if servers are "alive" + notification_period 24x7 ; Send notification out at any time - day or night + notification_interval 30 ; Resend notifications every 30 minutes + notification_options d,r ; Only send notifications for specific host states + contact_groups admins ; Notifications get sent to the admins by default + hostgroups windows-servers ; Host groups that Windows servers should be a member of + register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE +} + + + +# We define a generic printer template that can +# be used for most printers we monitor + +define host { + + name generic-printer ; The name of this host template + use generic-host ; Inherit default values from the generic-host template + check_period 24x7 ; By default, printers are monitored round the clock + check_interval 5 ; Actively check the printer every 5 minutes + retry_interval 1 ; Schedule host check retries at 1 minute intervals + max_check_attempts 10 ; Check each printer 10 times (max) + check_command check-host-alive ; Default command to check if printers are "alive" + notification_period workhours ; Printers are only used during the workday + notification_interval 30 ; Resend notifications every 30 minutes + notification_options d,r ; Only send notifications for specific host states + contact_groups admins ; Notifications get sent to the admins by default + register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE +} + + + +# Define a template for switches that we can reuse +define host { + + name generic-switch ; The name of this host template + use generic-host ; Inherit default values from the generic-host template + check_period 24x7 ; By default, switches are monitored round the clock + check_interval 5 ; Switches are checked every 5 minutes + retry_interval 1 ; Schedule host check retries at 1 minute intervals + max_check_attempts 10 ; Check each switch 10 times (max) + check_command check-host-alive ; Default command to check if routers are "alive" + notification_period 24x7 ; Send notifications at any time + notification_interval 30 ; Resend notifications every 30 minutes + notification_options d,r ; Only send notifications for specific host states + contact_groups admins ; Notifications get sent to the admins by default + register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE +} + + + +############################################################################### +# +# SERVICE TEMPLATES +# +############################################################################### + +# 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 + 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 + check_period 24x7 ; The service can be checked at any time of the day + max_check_attempts 3 ; Re-check the service up to 3 times in order to determine its final (hard) state + check_interval 10 ; Check the service every 10 minutes under normal conditions + retry_interval 2 ; Re-check the service every two minutes 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 ; DON'T 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 + max_check_attempts 4 ; Re-check the service up to 4 times in order to determine its final (hard) state + check_interval 5 ; Check the service every 5 minutes under normal conditions + retry_interval 1 ; Re-check the service every minute until a hard state can be determined + register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE! +} + +define service { + name remote-service + use local-service + register 0 +} diff --git a/nagios/objects/timeperiods.cfg b/nagios/objects/timeperiods.cfg new file mode 100644 index 0000000..42fb2bc --- /dev/null +++ b/nagios/objects/timeperiods.cfg @@ -0,0 +1,112 @@ +############################################################################### +# TIMEPERIODS.CFG - SAMPLE TIMEPERIOD DEFINITIONS +# +# +# NOTES: This config file provides you with some example timeperiod definitions +# that you can reference in host, service, contact, and dependency +# definitions. +# +# You don't need to keep timeperiods in a separate file from your other +# object definitions. This has been done just to make things easier to +# understand. +# +############################################################################### + + + +############################################################################### +# +# TIMEPERIOD DEFINITIONS +# +############################################################################### + +# This defines a timeperiod where all times are valid for checks, +# notifications, etc. The classic "24x7" support nightmare. :-) + +define timeperiod { + + name 24x7 + 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 +} + + + +# This defines a timeperiod that is normal workhours for +# those of us monitoring networks and such in the U.S. + +define timeperiod { + + name workhours + timeperiod_name workhours + alias Normal Work 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 +} + + + +# This defines the *perfect* check and notification +# timeperiod + +define timeperiod { + + name none + timeperiod_name none + alias No Time Is A Good Time +} + + + +# Some U.S. holidays +# Note: The timeranges for each holiday are meant to *exclude* the holidays from being +# treated as a valid time for notifications, etc. You probably don't want your pager +# going off on New Year's. Although your employer might... :-) + +define timeperiod { + + name us-holidays + timeperiod_name us-holidays + alias U.S. Holidays + + january 1 00:00-00:00 ; New Years + monday -1 may 00:00-00:00 ; Memorial Day (last Monday in May) + july 4 00:00-00:00 ; Independence Day + monday 1 september 00:00-00:00 ; Labor Day (first Monday in September) + thursday 4 november 00:00-00:00 ; Thanksgiving (4th Thursday in November) + december 25 00:00-00:00 ; Christmas +} + + + +# This defines a modified "24x7" timeperiod that covers every day of the +# year, except for U.S. holidays (defined in the timeperiod above). + +define timeperiod { + + name 24x7_sans_holidays + timeperiod_name 24x7_sans_holidays + alias 24x7 Sans Holidays + + use us-holidays ; Get holiday exceptions from other timeperiod + + 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 +} diff --git a/nagios/objects/windows.cfg b/nagios/objects/windows.cfg new file mode 100644 index 0000000..b7d9305 --- /dev/null +++ b/nagios/objects/windows.cfg @@ -0,0 +1,141 @@ +############################################################################### +# WINDOWS.CFG - SAMPLE CONFIG FILE FOR MONITORING A WINDOWS MACHINE +# +# +# NOTES: This config file assumes that you are using the sample configuration +# files that get installed with the Nagios quickstart guide. +# +############################################################################### + + + +############################################################################### +# +# HOST DEFINITIONS +# +############################################################################### + +# Define a host for the Windows machine we'll be monitoring +# Change the host_name, alias, and address to fit your situation + +define host { + + use windows-server ; Inherit default values from a template + host_name winserver ; The name we're giving to this host + alias My Windows Server ; A longer name associated with the host + address 192.168.1.2 ; IP address of the host +} + + + +############################################################################### +# +# HOST GROUP DEFINITIONS +# +############################################################################### + +# Define a hostgroup for Windows machines +# All hosts that use the windows-server template will automatically be a member of this group + +define hostgroup { + + hostgroup_name windows-servers ; The name of the hostgroup + alias Windows Servers ; Long name of the group +} + + + +############################################################################### +# +# SERVICE DEFINITIONS +# +############################################################################### + +# Create a service for monitoring the version of NSCLient++ that is installed +# Change the host_name to match the name of the host you defined above + +define service { + + use generic-service + host_name winserver + service_description NSClient++ Version + check_command check_nt!CLIENTVERSION +} + + + +# Create a service for monitoring the uptime of the server +# Change the host_name to match the name of the host you defined above + +define service { + + use generic-service + host_name winserver + service_description Uptime + check_command check_nt!UPTIME +} + + + +# Create a service for monitoring CPU load +# Change the host_name to match the name of the host you defined above + +define service { + + use generic-service + host_name winserver + service_description CPU Load + check_command check_nt!CPULOAD!-l 5,80,90 +} + + + +# Create a service for monitoring memory usage +# Change the host_name to match the name of the host you defined above + +define service { + + use generic-service + host_name winserver + service_description Memory Usage + check_command check_nt!MEMUSE!-w 80 -c 90 +} + + + +# Create a service for monitoring C:\ disk usage +# Change the host_name to match the name of the host you defined above + +define service { + + use generic-service + host_name winserver + service_description C:\ Drive Space + check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90 +} + + + +# Create a service for monitoring the W3SVC service +# Change the host_name to match the name of the host you defined above + +define service { + + use generic-service + host_name winserver + service_description W3SVC + check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC +} + + + +# Create a service for monitoring the Explorer.exe process +# Change the host_name to match the name of the host you defined above + +define service { + + use generic-service + host_name winserver + service_description Explorer + check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe +} |