Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update nagios object definitions.

The nagios object definitions have been updated to correlate with Nagios
3.0.6. I have also updated the sample files to use the nagios
sample-configs so we have better test coverage.

I reordered all the attributes so that they are in the same order as
objectdefinitions.html in the nagios docs so it's easier to update in
future.

Signed-off-by: John Ferlito <johnf@inodes.org>
  • Loading branch information...
commit f0584c4134ef41f5ee3fa2fda95e9d2ebdd778d4 1 parent f131fc1
@johnf johnf authored
View
173 lib/nagios/base.rb
@@ -324,119 +324,154 @@ def type
end
# object types
- newtype :command do
- setparameters :command_name, :command_line
- end
-
- newtype :contact do
- setparameters :contact_name, :alias, :host_notification_period,
- :host_notification_commands, :service_notification_period,
- :service_notification_commands, :register, :email, :pager,
- :service_notification_options, :host_notification_options
+ newtype :host do
+ setparameters :host_name, :alias, :display_name, :address, :parents,
+ :hostgroups, :check_command, :initial_state, :max_check_attempts,
+ :check_interval, :retry_interval, :active_checks_enabled,
+ :passive_checks_enabled, :check_period, :obsess_over_host,
+ :check_freshness, :freshness_threshold, :event_handler,
+ :event_handler_enabled, :low_flap_threshold, :high_flap_threshold,
+ :flap_detection_enabled, :flap_detection_options,
+ :failure_prediction_enabled, :process_perf_data,
+ :retain_status_information, :retain_nonstatus_information, :contacts,
+ :contact_groups, :notification_interval, :first_notification_delay,
+ :notification_period, :notification_options, :notifications_enabled,
+ :stalking_options, :notes, :notes_url, :action_url, :icon_image,
+ :icon_image_alt, :vrml_image, :statusmap_image, "2d_coords".intern,
+ "3d_coords".intern,
+ :register, :use
setsuperior "person"
+ map :address => "ipHostNumber"
end
- newtype :contactgroup do
- setparameters :contactgroup_name, :alias, :members
+ newtype :hostgroup do
+ setparameters :hostgroup_name, :alias, :members, :hostgroup_members, :notes,
+ :notes_url, :action_url,
+ :register, :use
end
- newtype :host do
- setparameters :host_name, :notifications_enabled, :event_handler_enabled,
- :flap_detection_enabled, :process_perf_data, :retain_status_information,
- :retain_nonstatus_information, :register, :use, :alias,
- :address, :check_command, :max_check_attempts, :notification_interval,
- :notification_period, :notification_options, :checks_enabled,
- :failure_prediction_enabled, :parents, :contact_groups
+ newtype :service do
+ attach :host => :host_name
+ setparameters :host_name, :hostgroup_name, :service_description,
+ :display_name, :servicegroups, :is_volatile, :check_command,
+ :initial_state, :max_check_attempts, :check_interval, :retry_interval,
+ :normal_check_interval, :retry_check_interval, :active_checks_enabled,
+ :passive_checks_enabled, :parallelize_check, :check_period,
+ :obsess_over_service, :check_freshness, :freshness_threshold,
+ :event_handler, :event_handler_enabled, :low_flap_threshold,
+ :high_flap_threshold, :flap_detection_enabled,:flap_detection_options,
+ :process_perf_data, :failure_prediction_enabled, :retain_status_information,
+ :retain_nonstatus_information, :notification_interval,
+ :first_notification_delay, :notification_period, :notification_options,
+ :notifications_enabled, :contacts, :contact_groups, :stalking_options,
+ :notes, :notes_url, :action_url, :icon_image, :icon_image_alt,
+ :register, :use,
+ :_naginator_name
- setsuperior "person"
- map :address => "ipHostNumber"
+ suppress :host_name
+
+ setnamevar :_naginator_name
end
- newtype :hostextinfo do
- auxiliary = true
- setparameters :host_name, :notes_url, :icon_image, :icon_image_alt, :vrml_image,
- "2d_coords".intern, "3d_coords".intern
+ newtype :servicegroup do
+ setparameters :servicegroup_name, :alias, :members, :servicegroup_members,
+ :notes, :notes_url, :action_url,
+ :register, :use
+ end
- setnamevar :host_name
+ newtype :contact do
+ setparameters :contact_name, :alias, :contactgroups,
+ :host_notifications_enabled, :service_notifications_enabled,
+ :host_notification_period, :service_notification_period,
+ :host_notification_options, :service_notification_options,
+ :host_notification_commands, :service_notification_commands,
+ :email, :pager, :address1, :address2, :address3, :address4,
+ :address5, :address6, :can_submit_commands, :retain_status_information,
+ :retain_nonstatus_information,
+ :register, :use
+
+ setsuperior "person"
end
- newtype :hostgroup do
- setparameters :hostgroup_name, :alias, :contact_groups, :members
+ newtype :contactgroup do
+ setparameters :contactgroup_name, :alias, :members, :contactgroup_members,
+ :register, :use
end
- newtype :hostescalation do
- setparameters :first_notification, :last_notification,
- :notification_interval, :contact_groups,
- :escalation_options, :register, :hostgroup_name,
- :_naginator_name
+ # TODO - We should support generic time periods here eg "day 1 - 15"
+ newtype :timeperiod do
+ setparameters :timeperiod_name, :alias, :sunday, :monday, :tuesday,
+ :wednesday, :thursday, :friday, :saturday, :exclude,
+ :register, :use
+ end
- setnamevar :_naginator_name
- end
+ newtype :command do
+ setparameters :command_name, :command_line
+ end
- newtype :hostgroupescalation do
+ newtype :servicedependency do
auxiliary = true
- setparameters :hostgroup_name, :first_notification, :last_notification,
- :contact_groups, :notification_interval,
+ setparameters :dependent_host_name, :dependent_hostgroup_name,
+ :dependent_service_description, :host_name, :hostgroup_name,
+ :service_description, :inherits_parent, :execution_failure_criteria,
+ :notification_failure_criteria, :dependency_period,
+ :register, :use,
:_naginator_name
setnamevar :_naginator_name
end
- newtype :service do
- attach :host => :host_name
- setparameters :active_checks_enabled, :passive_checks_enabled,
- :parallelize_check, :obsess_over_service, :check_freshness,
- :notifications_enabled, :event_handler_enabled,
- :flap_detection_enabled, :process_perf_data,
- :retain_status_information, :retain_nonstatus_information, :register,
- :is_volatile, :check_period, :max_check_attempts,
- :normal_check_interval, :retry_check_interval, :contact_groups,
- :notification_interval, :notification_period, :notification_options,
- :service_description, :host_name, :freshness_threshold,
- :check_command, :hostgroup_name, :event_handler, :servicegroups, :host,
+ newtype :serviceescalation do
+ setparameters :host_name, :hostgroup_name, :service_description, :contacts,
+ :contact_groups, :first_notification, :last_notification,
+ :notification_interval, :escalation_period, :escalation_options,
+ :register, :use,
:_naginator_name
- suppress :host_name
-
setnamevar :_naginator_name
end
- newtype :servicedependency do
- auxiliary = true
- setparameters :host_name, :service_description, :dependent_host_name,
- :dependent_service_description, :execution_failure_criteria,
- :notification_failure_criteria, :hostgroup_name,
- :dependent_hostgroup_name, :_naginator_name
+ newtype :hostdependency do
+ auxiliary = true
+ setparameters :dependent_host_name, :dependent_hostgroup_name, :host_name,
+ :hostgroup_name, :inherits_parent, :execution_failure_criteria,
+ :notification_failure_criteria, :dependency_period,
+ :register, :use
- setnamevar :_naginator_name
+ setnamevar :_naginator_name
end
- newtype :serviceescalation do
- setparameters :host_name, :service_description, :first_notification,
- :last_notification, :contact_groups, :notification_interval, :hostgroup_name,
+ newtype :hostescalation do
+ setparameters :host_name, :hostgroup_name, :contacts, :contact_groups,
+ :first_notification, :last_notification, :notification_interval,
+ :escalation_period, :escalation_options,
+ :register, :use,
:_naginator_name
setnamevar :_naginator_name
end
- newtype :servicegroup do
- setparameters :servicegroup_name, :alias
+ newtype :hostextinfo do
+ auxiliary = true
+ setparameters :host_name, :notes, :notes_url, :icon_image, :icon_image_alt,
+ :vrml_image, :statusmap_image, "2d_coords".intern, "3d_coords".intern,
+ :register, :use
+
+ setnamevar :host_name
end
newtype :serviceextinfo do
auxiliary = true
- setparameters :host_name, :service_description, :icon_image, :icon_image_alt,
- :_naginator_name
+ setparameters :host_name, :service_description, :notes, :notes_url,
+ :action_url, :icon_image, :icon_image_alt,
+ :register, :use,
+ :_naginator_name
setnamevar :_naginator_name
end
- newtype :timeperiod do
- setparameters :timeperiod_name, :alias, :sunday, :monday, :tuesday,
- :wednesday, :thursday, :friday, :saturday
- end
end
# $Id$
View
203 tests/data/checkcommands.cfg
@@ -1,203 +0,0 @@
-################################################################################
-# Sample object config file for Nagios 1.0
-#
-# 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: 06-09-2002
-#
-################################################################################
-
-
-################################################################################
-# COMMAND DEFINITIONS
-#
-# SYNTAX:
-#
-# define command{
-# template <templatename>
-# name <objectname>
-# command_name <commandname>
-# command_line <commandline>
-# }
-#
-# WHERE:
-#
-# <templatename> = object name of another command definition that should be
-# used as a template for this definition (optional)
-# <objectname> = object name of command definition, referenced by other
-# command definitions that use it as a template (optional)
-# <commandname> = name of the command, as recognized/used by Nagios
-# <commandline> = 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.
-#
-################################################################################
-
-
-# 'check_tcp' command definition
-define command {
- command_name check_tcp
- command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$
- }
-
-
-# 'check_udp' command definition
-define command{
- command_name check_udp
- command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$
- }
-
-
-# 'check_ftp' command definition
-define command{
- command_name check_ftp
- command_line $USER1$/check_ftp -H $HOSTADDRESS$
- }
-
-
-# '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_nntp' command definition
-define command{
- command_name check_nntp
- command_line $USER1$/check_nntp -H $HOSTADDRESS$
- }
-
-
-# 'check_http' command definition
-define command{
- command_name check_http
- command_line $USER1$/check_http -H $HOSTADDRESS$
- }
-
-
-# 'check_telnet' command definition
-define command{
- command_name check_telnet
- command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 23
- }
-
-# 'check_nsca' command definition
-define command{
- command_name check_nsca
- command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 5667
- }
-
-# 'check_ssh' command definition
-define command{
- command_name check_ssh
- command_line $USER1$/check_ssh $HOSTADDRESS$
- }
-
-
-# 'check_ping' command definition
-#command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
-define command{
- command_name check_ping
- command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
- }
-
-
-# 'check_dns' command definition
-define command{
- command_name check_dns
- command_line $USER1$/check_dns -H www.yahoo.com -s $HOSTADDRESS$
- }
-
-
-# 'check_hpjd' command definition
-define command{
- command_name check_hpjd
- command_line $USER1$/check_hpjd -H $HOSTADDRESS$ -C public
- }
-
-
-# 'check_local_disk' command definition
-define command{
- command_name check_local_disk
- command_line $USER1$/check_disk -w 98 -c 95 -p $ARG1$
- }
-
-
-# 'check_local_users' command definition
-define command{
- command_name check_local_users
- command_line $USER1$/check_users -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_load' command definition
-define command{
- command_name check_local_load
- command_line $USER1$/check_load -w $ARG1$ -c $ARG2$
- }
-
-# 'check_ldap' command definition
-define command{
- command_name check_ldap
- command_line $USER1$/check_ldap -H $HOSTADDRESS$ -b dc=madstop,dc=com
- }
-
-
-# for passing information to a remote host
-define command{
- command_name submit_check_result
- command_line /bin/sh /etc/nagios/scripts/submit_check_result $HOSTNAME$ '$SERVICEDESC$' $SERVICESTATE$ '$OUTPUT$'
-}
-
-# what to do when a passive check is stale
-define command{
- command_name stale_passive_check
- command_line /bin/sh /etc/nagios/scripts/stale_passive_check '$SERVICEDESC$' '$HOSTNAME$'
-}
-
-
-################################################################################
-#
-# 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
- }
View
240 tests/data/commands.cfg
@@ -0,0 +1,240 @@
+###############################################################################
+# COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS 3.0.6
+#
+# Last Modified: 05-31-2007
+#
+# NOTES: This config file provides you with some example command definitions
+# that you can reference in host, service, and contact definitions.
+#
+# You don't need to keep commands in a separate file from your other
+# object definitions. This has been done just to make things easier to
+# understand.
+#
+###############################################################################
+
+
+################################################################################
+#
+# 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.
+#
+################################################################################
+
+
+# 'notify-host-by-email' command definition
+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$
+ }
+
+# 'notify-service-by-email' command definition
+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$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
+ }
+
+
+
+
+
+################################################################################
+#
+# 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: Five ICMP echo packets are sent (determined by the '-p 5' 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 5
+ }
+
+
+
+
+################################################################################
+#
+# 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$
+ }
+
+
+# 'check_local_swap' command definition
+define command{
+ command_name check_local_swap
+ command_line $USER1$/check_swap -w $ARG1$ -c $ARG2$
+ }
+
+
+# 'check_local_mrtgtraf' command definition
+define command{
+ command_name check_local_mrtgtraf
+ command_line $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
+ }
+
+
+################################################################################
+# NOTE: The following 'check_...' commands are used to monitor services on
+# both local and remote hosts.
+################################################################################
+
+# 'check_ftp' command definition
+define command{
+ command_name check_ftp
+ command_line $USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$
+ }
+
+
+# 'check_hpjd' command definition
+define command{
+ command_name check_hpjd
+ command_line $USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$
+ }
+
+
+# 'check_snmp' command definition
+define command{
+ command_name check_snmp
+ command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
+ }
+
+
+# 'check_http' command definition
+define command{
+ command_name check_http
+ command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
+ }
+
+
+# 'check_ssh' command definition
+define command{
+ command_name check_ssh
+ command_line $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
+ }
+
+
+# 'check_dhcp' command definition
+define command{
+ command_name check_dhcp
+ command_line $USER1$/check_dhcp $ARG1$
+ }
+
+
+# '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$ $ARG1$
+ }
+
+
+# 'check_imap' command definition
+define command{
+ command_name check_imap
+ command_line $USER1$/check_imap -H $HOSTADDRESS$ $ARG1$
+ }
+
+
+# 'check_smtp' command definition
+define command{
+ command_name check_smtp
+ command_line $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$
+ }
+
+
+# 'check_tcp' command definition
+define command{
+ command_name check_tcp
+ command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
+ }
+
+
+# 'check_udp' command definition
+define command{
+ command_name check_udp
+ command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
+ }
+
+
+# 'check_nt' command definition
+define command{
+ command_name check_nt
+ command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
+ }
+
+
+
+################################################################################
+#
+# 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" >> /usr/local/nagios/var/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" >> /usr/local/nagios/var/service-perfdata.out
+ }
+
+
View
25 tests/data/contactgroups.cfg
@@ -1,25 +0,0 @@
-################################################################################
-# Sample object config file for Nagios 1.0
-#
-# 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: 10-03-2002
-#
-################################################################################
-
-
-################################################################################
-# CONTACT GROUP DEFINITIONS
-#
-# SYNTAX:
-#
-################################################################################
-
-define contactgroup{
- contactgroup_name admin
- alias Administrators
- members luke
-}
-
View
73 tests/data/contacts.cfg
@@ -1,34 +1,55 @@
-################################################################################
-# Sample object config file for Nagios 1.0
+###############################################################################
+# CONTACTS.CFG - SAMPLE CONTACT/CONTACTGROUP DEFINITIONS
#
-# 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: 03-07-2002
+# Last Modified: 05-31-2007
#
-################################################################################
+# 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.
+#
+###############################################################################
+
-################################################################################
-# CONTACT DEFINITIONS
+###############################################################################
+###############################################################################
#
-# SYNTAX:
+# 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.
-# 'nobody' contact definition
-#service_notification_commands notify-by-email,notify-by-epager
-#host_notification_commands host-notify-by-email,host-notify-by-epager
define contact{
- contact_name luke
- alias Nagios Admin
- service_notification_period 24x7
- host_notification_period 24x7
- service_notification_options w,u,c,r
- host_notification_options d,u,r
- service_notification_commands notify-by-email
- host_notification_commands host-notify-by-email
- email fakeuser@domain.com
- pager fakeuser-phone@domain.com
-}
+ 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 nagios@localhost ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
+ }
+
+
+
+###############################################################################
+###############################################################################
+#
+# 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
+ }
View
48 tests/data/dependencies.cfg
@@ -1,48 +0,0 @@
-################################################################################
-# Sample object config file for Nagios 1.0
-#
-# 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: 03-07-2002
-#
-################################################################################
-
-
-################################################################################
-# SERVICE DEPENDENCY DEFINITIONS
-#
-# SYNTAX:
-#
-################################################################################
-
-# Servicedependency definition
-define servicedependency{
- host_name nt1
- service_description IIS Process
- dependent_host_name nt1
- dependent_service_description Website #1
- execution_failure_criteria n ; These are the criteria for which check execution will be supressed
- notification_failure_criteria w,u,c ; These are the criteria for which notifications will be supressed
- }
-
-
-# Servicedependency definition
-define servicedependency{
- host_name nt1
- service_description IIS Process
- dependent_host_name nt1
- dependent_service_description Website #2
- execution_failure_criteria w,u,c ; These are the criteria for which check execution will be supressed
- notification_failure_criteria w,u,c ; These are the criteria for which notifications will be supressed
- }
-
-
-################################################################################
-# HOST DEPENDENCY DEFINITIONS
-#
-# SYNTAX:
-#
-################################################################################
-
View
77 tests/data/escalations.cfg
@@ -1,77 +0,0 @@
-################################################################################
-# Sample object config file for Nagios 1.0
-#
-# 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: 03-07-2002
-#
-################################################################################
-
-
-################################################################################
-# SERVICE ESCALATION DEFINITIONS
-#
-# SYNTAX:
-#
-################################################################################
-
-# Serviceescalation definition
-define serviceescalation{
- host_name linux1
- service_description PING
- first_notification 2
- last_notification 6
- contact_groups admins
- notification_interval 0
- }
-
-
-# Serviceescalation definition
-define serviceescalation{
- host_name linux1
- service_description Current Users
- first_notification 5
- last_notification 0
- contact_groups linux-admins,novell-admins
- notification_interval 0
- }
-
-
-
-################################################################################
-# HOSTGROUP ESCALATION DEFINITIONS
-#
-# SYNTAX:
-#
-################################################################################
-
-# Hostgroup 'novell-servers' escalation definition
-define hostgroupescalation{
- hostgroup_name novell-servers
- first_notification 2
- last_notification 5
- contact_groups novell-admins,nt-admins
- notification_interval 10
- }
-
-
-# Hostgroup 'novell-servers' escalation definition
-define hostgroupescalation{
- hostgroup_name novell-servers
- first_notification 6
- last_notification 0
- contact_groups novell-admins,nt-admins,linux-admins
- notification_interval 5
- }
-
-
-
-################################################################################
-# HOST ESCALATION DEFINITIONS
-#
-# SYNTAX:
-#
-################################################################################
-
View
181 tests/data/generated.cfg
@@ -1,181 +0,0 @@
-define host {
- alias culain
- host_name culain
- use generic-host
- address 192.168.0.3
-}
-define service {
- host_name culain
- service_description disk /
- use passive-service
- check_command check_local_disk!/
-}
-define service {
- host_name culain
- service_description disk /dev/shm
- use passive-service
- check_command check_local_disk!/dev/shm
-}
-define service {
- host_name culain
- service_description disk /boot
- use passive-service
- check_command check_local_disk!/boot
-}
-define service {
- host_name culain
- service_description disk /ubuntu
- use passive-service
- check_command check_local_disk!/ubuntu
-}
-define service {
- host_name culain
- service_description disk /gentoo
- use passive-service
- check_command check_local_disk!/gentoo
-}
-define service {
- host_name culain
- service_description disk /.dev
- use passive-service
- check_command check_local_disk!/.dev
-}
-define service {
- host_name culain
- service_description disk /dev
- use passive-service
- check_command check_local_disk!/dev
-}
-define service {
- host_name culain
- service_description ping
- use generic-service
- check_command check_ping
-}
-define host {
- alias pixie
- host_name pixie
- use generic-host
- address 192.168.0.9
-}
-define service {
- host_name pixie
- service_description disk /
- use passive-service
- check_command check_local_disk!/
-}
-define service {
- host_name pixie
- service_description disk /var
- use passive-service
- check_command check_local_disk!/var
-}
-define service {
- host_name pixie
- service_description disk /var/run
- use passive-service
- check_command check_local_disk!/var/run
-}
-define service {
- host_name pixie
- service_description disk /disksuite
- use passive-service
- check_command check_local_disk!/disksuite
-}
-define service {
- host_name pixie
- service_description disk /export
- use passive-service
- check_command check_local_disk!/export
-}
-define service {
- host_name pixie
- service_description ping
- use generic-service
- check_command check_ping
-}
-define host {
- alias kirby
- host_name kirby
- use generic-host
- address 192.168.0.5
-}
-define service {
- host_name kirby
- service_description disk /
- use passive-service
- check_command check_local_disk!/
-}
-define service {
- host_name kirby
- service_description disk /usr
- use passive-service
- check_command check_local_disk!/usr
-}
-define service {
- host_name kirby
- service_description disk /var
- use passive-service
- check_command check_local_disk!/var
-}
-define service {
- host_name kirby
- service_description disk /var/run
- use passive-service
- check_command check_local_disk!/var/run
-}
-define service {
- host_name kirby
- service_description disk /export
- use passive-service
- check_command check_local_disk!/export
-}
-define service {
- host_name kirby
- service_description ping
- use generic-service
- check_command check_ping
-}
-define service {
- host_name kirby
- service_description dns
- use generic-service
- check_command check_dns
-}
-define service {
- host_name kirby
- service_description smtp
- use generic-service
- check_command check_smtp
-}
-define service {
- host_name kirby
- service_description http
- use generic-service
- check_command check_http
-}
-define service {
- host_name kirby
- service_description nsca
- use generic-service
- check_command check_nsca
-}
-
-define hostgroup {
- alias Linux Servers
- hostgroup_name linux
- members culain
- contact_groups admin
-}
-define hostgroup {
- alias Home Servers
- hostgroup_name home
- members culain,pixie,kirby
- contact_groups admin
-}
-define hostgroup {
- alias Solaris Servers
- hostgroup_name sunos
- members pixie,kirby
- contact_groups admin
-}
View
71 tests/data/generics.cfg
@@ -1,71 +0,0 @@
-# templates
-
-define host{
- name generic-host
- notifications_enabled 1
- event_handler_enabled 1
- flap_detection_enabled 1
- process_perf_data 1
- retain_status_information 1
- retain_nonstatus_information 1
- check_command check-host-alive
- max_check_attempts 10
- checks_enabled 1
- notification_interval 1800
- notification_period 24x7
- notification_options d,u,r
- failure_prediction_enabled 1
- retain_status_information 1
- retain_nonstatus_information 1
- register 0
-}
-
-define service{
- name generic-service
- 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
- max_check_attempts 3
- normal_check_interval 5
- retry_check_interval 1
- check_period 24x7
- notification_interval 1800
- notification_period 24x7
- notification_options c,r
- contact_groups admin
- register 0
-}
-
-define service{
- name passive-service
- passive_checks_enabled 1
- check_freshness 1
- freshness_threshold 900
- check_command "stale_passive_check"
- active_checks_enabled 0
- parallelize_check 1
- obsess_over_service 1
- notifications_enabled 1
- event_handler_enabled 1
- flap_detection_enabled 1
- process_perf_data 1
- retain_status_information 1
- retain_nonstatus_information 1
- max_check_attempts 3
- normal_check_interval 5
- retry_check_interval 1
- check_period 24x7
- notification_interval 1800
- notification_period 24x7
- notification_options c,r
- contact_groups admin
- register 0
-}
View
36 tests/data/hostgroups.cfg
@@ -1,36 +0,0 @@
-
-define hostgroup {
- hostgroup_name linux
- alias Linux Servers
- contact_groups admin
-}
-
-define hostgroup {
- hostgroup_name sunos
- alias Solaris Servers
- contact_groups admin
-}
-
-
-#
-# Begin HostGroup 'Default' (default)
-#
-
-define hostgroup {
- hostgroup_name default
- alias Default
- contact_groups admin
-}
-
-define hostgroup{
- hostgroup_name home
- alias Home Servers
- contact_groups admin
-}
-
-
-define hostgroup{
- hostgroup_name away
- alias Away Servers
- contact_groups admin
-}
View
126 tests/data/hosts.cfg
@@ -1,126 +0,0 @@
-################################################################################
-# Sample object config file for Nagios 1.0
-#
-# 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: 03-10-2002
-#
-################################################################################
-
-
-################################################################################
-# HOST DEFINITIONS
-#
-# SYNTAX:
-#
-################################################################################
-
-# Generic host definition template
-define host{
- name generic-host ; The name of this host template - referenced in other host definitions, used for template recursion/resolution
- 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
- check_command check-host-alive
- max_check_attempts 10
- notification_interval 1800
- notification_period 24x7
- notification_options d,u,r
-
- register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
- }
-
-define host{
- use generic-host ; Name of host template to use
-
- host_name kirby
- alias The Big Guy
- address 192.168.0.5
- }
-
-
-define host{
- use generic-host ; Name of host template to use
-
- host_name culain
- alias Linux Workstation
- address 192.168.0.3
- }
-
-
-define host{
- use generic-host ; Name of host template to use
-
- host_name pixie
- alias madstop.com
- address 207.65.26.13
- }
-
-
-# 'linux1' host definition
-define host{
- use generic-host ; Name of host template to use
-
- host_name lugh
- alias firewall
- address 192.168.0.1
- }
-
-
-# 'linux2' host definition
-define host{
- use generic-host ; Name of host template to use
-
- host_name dslrouter
- alias DSL Router
- address 66.93.249.1
- parents dsl lugh
- }
-
-
-define host{
- use generic-host ; Name of host template to use
-
- host_name wlan
- alias External Interface
- address 192.168.1.1
- check_command check-host-alive
- parents lugh
-}
-
-
-define host{
- use generic-host ; Name of host template to use
-
- host_name dsl
- alias External Interface
- address 66.93.249.120
- check_command check-host-alive
- parents lugh
-}
-
-
-define host{
- use generic-host ; Name of host template to use
-
- host_name airport
- alias My WAP
- address 192.168.1.2
- check_command check-host-alive
- parents lugh wlan
-}
-
-
-# 'switch2' host definition
-define host{
- use generic-host ; Name of host template to use
-
- host_name printer
- alias The printer
- address 192.168.0.6
- }
View
56 tests/data/local.cfg
@@ -1,56 +0,0 @@
-define host {
- host_name kirby
- address 192.168.0.5
- alias kirby
- use generic-host
-}
-
-define service {
- service_description disk /
- host_name kirby
- use generic-service
- check_command check_local_disk!/
-}
-
-define service {
- service_description disk /usr
- host_name kirby
- use generic-service
- check_command check_local_disk!/usr
-}
-
-define service {
- service_description disk /var
- host_name kirby
- use generic-service
- check_command check_local_disk!/var
-}
-
-define service {
- service_description disk /var/run
- host_name kirby
- use generic-service
- check_command check_local_disk!/var/run
-}
-
-define service {
- service_description disk /export
- host_name kirby
- use generic-service
- check_command check_local_disk!/export
-}
-
-define hostgroup {
- hostgroup_name sunos
- alias Solaris Servers
- contact_groups admin
- members kirby
-}
-
-define hostgroup {
- hostgroup_name home
- alias Home Servers
- contact_groups admin
- members kirby
-}
-
View
155 tests/data/localhost.cfg
@@ -0,0 +1,155 @@
+###############################################################################
+# LOCALHOST.CFG - SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE
+#
+# Last Modified: 05-31-2007
+#
+# NOTE: This config file is intended to serve as an *extremely* simple
+# example of how you can create configuration entries to monitor
+# the local (Linux) machine.
+#
+###############################################################################
+
+
+
+
+###############################################################################
+###############################################################################
+#
+# HOST DEFINITION
+#
+###############################################################################
+###############################################################################
+
+# Define a host for the local machine
+
+define host{
+ use linux-server ; Name of host template to use
+ host_name localhost
+ alias localhost
+ address 127.0.0.1
+ }
+
+
+
+###############################################################################
+###############################################################################
+#
+# HOST GROUP DEFINITION
+#
+###############################################################################
+###############################################################################
+
+# Define an optional hostgroup for Linux machines
+
+define hostgroup{
+ hostgroup_name linux-servers ; The name of the hostgroup
+ alias Linux Servers ; Long name of the group
+ members localhost ; Comma separated list of hosts that belong to this group
+ }
+
+
+
+###############################################################################
+###############################################################################
+#
+# SERVICE DEFINITIONS
+#
+###############################################################################
+###############################################################################
+
+
+# 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
+ }
+
+
+
+# Define a service to check the swap usage the local machine.
+# Critical if less than 10% of swap is free, warning if less than 20% is free
+
+define service{
+ use local-service ; Name of service template to use
+ host_name localhost
+ service_description Swap Usage
+ check_command check_local_swap!20!10
+ }
+
+
+
+# Define a service to check SSH on the local machine.
+# Disable notifications for this service by default, as not all users may have SSH enabled.
+
+define service{
+ use local-service ; Name of service template to use
+ host_name localhost
+ service_description SSH
+ check_command check_ssh
+ notifications_enabled 0
+ }
+
+
+
+# Define a service to check HTTP on the local machine.
+# Disable notifications for this service by default, as not all users may have HTTP enabled.
+
+define service{
+ use local-service ; Name of service template to use
+ host_name localhost
+ service_description HTTP
+ check_command check_http
+ notifications_enabled 0
+ }
+
View
13 tests/data/makefile
@@ -1,13 +0,0 @@
-all: config
-
-generate:
- sudo /home/luke/svn/dist/config/apps/cfengine/modules/module\:nagios -g solaris:home -s 'ssh:local_disk!/var/run:local_disk!/' -r /etc/nagios/remote.cfg -l /etc/nagios/local.cfg
-
-collect: generate
- sudo /home/luke/cvs/nagios/generation/bin/nagcollect kirby culain
-
-config: collect
- sudo /home/luke/cvs/nagios/generation/bin/nagconfig -d /tmp/collection --outfile /etc/nagios/generated.cfg
-
-culain:
- sudo /home/luke/svn/dist/config/apps/cfengine/modules/module\:nagios -g linux:home -s 'ssh:local_disk!/data:local_disk!/:local_disk!/dev' -r /etc/nagios/remote.cfg -l /etc/nagios/local.cfg
View
105 tests/data/misccommands.cfg
@@ -1,105 +0,0 @@
-################################################################################
-# Sample object config file for Nagios 1.0
-#
-# 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: 05-27-2002
-#
-################################################################################
-
-
-################################################################################
-# COMMAND DEFINITIONS
-#
-# SYNTAX:
-#
-# define command{
-# template <templatename>
-# name <objectname>
-# command_name <commandname>
-# command_line <commandline>
-# }
-#
-# WHERE:
-#
-# <templatename> = object name of another command definition that should be
-# used as a template for this definition (optional)
-# <objectname> = object name of command definition, referenced by other
-# command definitions that use it as a template (optional)
-# <commandname> = name of the command, as recognized/used by Nagios
-# <commandline> = command line
-#
-################################################################################
-
-
-
-
-################################################################################
-#
-# SAMPLE NOTIFICATION COMMANDS
-#
-# These are some example notification commands. They may or may not work on
-# your system without modification.
-#
-################################################################################
-
-
-# 'notify-by-email' command definition
-define command{
- command_name notify-by-email
- command_line /usr/bin/printf "%b" "Subject: ** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **\n***** Nagios 1.0 *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $DATETIME$\n\nAdditional Info:\n\n$OUTPUT$" | /bin/mail $CONTACTEMAIL$
- }
-
-
-# 'notify-by-epager' command definition
-define command{
- command_name notify-by-epager
- command_line /usr/bin/printf "%b" "Subject: $NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$i\nService: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $OUTPUT$\nDate: $DATETIME$" | /bin/mail $CONTACTEMAIL$
- }
-
-
-# 'host-notify-by-email' command definition
-define command{
- command_name host-notify-by-email
- command_line /usr/bin/printf "%b" "Subject: Host $HOSTSTATE$ alert for $HOSTNAME$!\n***** Nagios 1.0 *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $OUTPUT$\n\nDate/Time: $DATETIME$\n" | /bin/mail $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: $OUTPUT$\nTime: $DATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$" $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 compiling
-# Nagios with native file support for performance data. This is done by
-# supplying the --with-file-perfdata option to the configure script.
-#
-################################################################################
-
-
-# 'process-host-perfdata' command definition
-define command{
- command_name process-host-perfdata
- command_line /usr/bin/printf "%b" "$LASTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$STATETYPE$\t$EXECUTIONTIME$\t$OUTPUT$\t$PERFDATA$" >> /usr/local/var/nagios/host-perfdata.out
- }
-
-
-# 'process-service-perfdata' command definition
-define command{
- command_name process-service-perfdata
- command_line /usr/bin/printf "%b" "$LASTCHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$STATETYPE$\t$EXECUTIONTIME$\t$LATENCY$\t$OUTPUT$\t$PERFDATA$" >> /usr/local/var/nagios/service-perfdata.out
- }
-
-
View
320 tests/data/nmap.cfg
@@ -1,320 +0,0 @@
-
-###############################################################################################
-# hosts.cfg file for Nagios v?.?.? generated by nmap2nagios.pl
-#
-# nmap2nagios information:
-# Version: v0.1.2
-# Args: nmap2nagios.pl -v -r nmap.xml -o newcfg
-# Generated: 11/30/2003 19:58:01
-#
-# nmap information:
-# Version: 3.48
-# Args: nmap -sS -O -oX nmap.xml kirby pixie lugh culain dslrouter
-#
-# Duration: 00:03:19
-# Start: 11/30/2003 19:35:13
-# Finish: 11/30/2003 19:38:32
-#
-# Hosts: 5
-# Up: 5
-# Down: 0
-#
-###############################################################################################
-
-# templates
-
-define host{
- name generic-host
- notifications_enabled 1
- event_handler_enabled 1
- flap_detection_enabled 1
- process_perf_data 1
- retain_status_information 1
- retain_nonstatus_information 1
- check_command check-host-alive
- max_check_attempts 10
- checks_enabled 1
- notification_interval 1800
- notification_period 24x7
- notification_options d,u,r
- failure_prediction_enabled 1
- retain_status_information 1
- retain_nonstatus_information 1
- register 0
-}
-
-define service{
- name generic-service
- 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
- max_check_attempts 3
- normal_check_interval 5
- retry_check_interval 1
- check_period 24x7
- notification_interval 1800
- notification_period 24x7
- notification_options c,r
- contact_groups admin
- register 0
-}
-
-
-
-#
-# Begin HostGroup 'Linux Servers' (linux)
-#
-
-define hostgroup {
- hostgroup_name linux
- alias Linux Servers
- contact_groups admin
- members culain.madstop.com
-}
-
-# culain.madstop.com - Linux Kernel 2.4.0 - 2.5.20
-
-define host {
- use generic-host
- host_name culain.madstop.com
- alias culain
- address 192.168.0.3
-}
-
-define service {
- use generic-service
- host_name culain.madstop.com
- service_description SSH
- check_command check_ssh
-}
-
-#
-# End HostGroup 'Linux Servers' (linux)
-#
-
-#
-# Begin HostGroup 'Solaris Servers' (solaris)
-#
-
-define hostgroup {
- hostgroup_name solaris
- alias Solaris Servers
- contact_groups admin
- members kirby.madstop.com,lugh.madstop.com,pixie
-}
-
-
-# kirby.madstop.com - Sun Solaris 8 early access beta through actual release
-
-define host {
- use generic-host
- host_name kirby.madstop.com
- alias kirby
- address 192.168.0.5
-}
-
-define service {
- use generic-service
- host_name kirby.madstop.com
- service_description FTP
- check_command check_ftp
-}
-
-define service {
- use generic-service
- host_name kirby.madstop.com
- service_description SSH
- check_command check_ssh
-}
-
-define service {
- use generic-service
- host_name kirby.madstop.com
- service_description DNS
- check_command check_dns
-}
-
-define service {
- use generic-service
- host_name kirby.madstop.com
- service_description ldap-tcp-389
- check_command check_ldap
-}
-
-define service {
- use generic-service
- host_name kirby.madstop.com
- service_description nfs-tcp-2049
- check_command check_tcp!2049
-}
-
-define service {
- use generic-service
- host_name kirby.madstop.com
- service_description lockd-tcp-4045
- check_command check_tcp!4045
-}
-
-define service {
- use generic-service
- host_name kirby.madstop.com
- service_description cfengine-tcp-5308
- check_command check_tcp!5308
-}
-
-# lugh.madstop.com - Sun Solaris 8 early access beta through actual release
-
-define host {
- use generic-host
- host_name lugh.madstop.com
- alias lugh
- address 192.168.0.1
-}
-
-define service {
- use generic-service
- host_name lugh.madstop.com
- service_description SSH
- check_command check_ssh
-}
-
-# pixie - Sun Solaris 8 early access beta through actual release
-
-define host {
- use generic-host
- host_name pixie
- alias pixie
- address 192.168.0.9
-}
-
-define service {
- use generic-service
- host_name pixie
- service_description SSH
- check_command check_ssh
-}
-
-define service {
- use generic-service
- host_name pixie
- service_description SMTP
- check_command check_smtp
-}
-
-define service {
- use generic-service
- host_name pixie
- service_description HTTP
- check_command check_http
-}
-
-define service {
- use generic-service
- host_name pixie
- service_description https-tcp-443
- check_command check_tcp!443
-}
-
-define service {
- use generic-service
- host_name pixie
- service_description imaps-tcp-993
- check_command check_tcp!993
-}
-
-#
-# End HostGroup 'Solaris Servers' (solaris)
-#
-
-#
-# Begin HostGroup 'Default' (default)
-#
-
-define hostgroup {
- hostgroup_name default
- alias Default
- contact_groups admin
- members dsl093-249-001.chi3.dsl.speakeasy.net,airport,printer
-}
-
-# dsl093-249-001.chi3.dsl.speakeasy.net - Redback SMS500 Redback Networks router AOS Release 5.0.4.0
-
-define host {
- use generic-host
- host_name dsl093-249-001.chi3.dsl.speakeasy.net
- alias dslrouter
- address 66.93.249.1
-}
-
-define service {
- use generic-service
- host_name dsl093-249-001.chi3.dsl.speakeasy.net
- service_description PING
- check_command check_ping
-}
-
-# airport
-
-define host {
- use generic-host
- host_name airport
- alias airport
- address 192.168.1.2
-}
-
-define service {
- use generic-service
- host_name airport
- service_description PING
- check_command check_ping
-}
-
-#
-# printer
-
-define host {
- use generic-host
- host_name printer
- alias printer
- address 192.168.0.6
-}
-
-define service {
- use generic-service
- host_name printer
- service_description PING
- check_command check_ping
-}
-
-define service {
- use generic-service
- host_name printer
- service_description HTTP
- check_command check_http
-}
-
-define service {
- use generic-service
- host_name printer
- service_description https-tcp-280
- check_command check_tcp!280
-}
-
-define service {
- use generic-service
- host_name printer
- service_description https-tcp-631
- check_command check_tcp!631
-}
-
-#
-# End HostGroup 'Default' (default)
-#
View
85 tests/data/printer.cfg
@@ -0,0 +1,85 @@
+###############################################################################
+# PRINTER.CFG - SAMPLE CONFIG FILE FOR MONITORING A NETWORK PRINTER
+#
+# Last Modified: 10-03-2007
+#
+# 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
+ normal_check_interval 10 ; Check the service every 10 minutes under normal conditions
+ retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
+ }
+
+
+# Create a service for "pinging" the printer occassionally. 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%
+ normal_check_interval 10
+ retry_check_interval 1
+ }
View
91 tests/data/remote.cfg
@@ -1,91 +0,0 @@
-define host {
- host_name kirby
- address 192.168.0.5
- alias kirby
- use generic-host
-}
-
-define service {
- service_description disk /
- host_name kirby
- use passive-service
- check_command check_local_disk!/
-}
-
-define service {
- service_description disk /usr
- host_name kirby
- use passive-service
- check_command check_local_disk!/usr
-}
-
-define service {
- service_description disk /var
- host_name kirby
- use passive-service
- check_command check_local_disk!/var
-}
-
-define service {
- service_description disk /var/run
- host_name kirby
- use passive-service
- check_command check_local_disk!/var/run
-}
-
-define service {
- service_description disk /export
- host_name kirby
- use passive-service
- check_command check_local_disk!/export
-}
-
-define service {
- service_description ping
- host_name kirby
- use generic-service
- check_command check_ping
-}
-
-define service {
- service_description dns
- host_name kirby
- use generic-service
- check_command check_dns
-}
-
-define service {
- service_description smtp
- host_name kirby
- use generic-service
- check_command check_smtp
-}
-
-define service {
- service_description http
- host_name kirby
- use generic-service
- check_command check_http
-}
-
-define service {
- service_description nsca
- host_name kirby
- use generic-service
- check_command check_nsca
-}
-
-define hostgroup {
- hostgroup_name sunos
- alias Solaris Servers
- contact_groups admin
- members kirby
-}
-
-define hostgroup {
- hostgroup_name home
- alias Home Servers
- contact_groups admin
- members kirby
-}
-
View
317 tests/data/services.cfg
@@ -1,317 +0,0 @@
-################################################################################
-# Sample object config file for Nagios 1.0
-#
-# 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: 09-17-2002
-#
-################################################################################
-
-
-################################################################################
-# SERVICE DEFINITIONS
-#
-# SYNTAX:
-#
-################################################################################
-
-# Generic service definition template
-define service{
- name generic-service ; The 'name' of this service template, referenced in other service definitions
- 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
- register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
- }
-
-# Service definition
-define service{
- use generic-service ; Name of service template to use
- host_name pixie
- service_description SMTP
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups admins
- notification_interval 120
- notification_period 24x7
- notification_options w,u,c,r
- check_command check_smtp
- }
-
-
-# Service definition
-define service{
- use generic-service ; Name of service template to use
- host_name pixie
- service_description HTTP
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups admins
- notification_interval 120
- notification_period 24x7
- notification_options w,u,c,r
- check_command check_smtp
- }
-
-
-# Service definition
-define service{
- use generic-service ; Name of service template to use
-
- host_name pixie
- service_description FTP
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups admins
- notification_interval 120
- notification_period 24x7
- notification_options w,u,c,r
- check_command check_smtp
- }
-
-
-# Service definition
-define service{
- use generic-service ; Name of service template to use
-
- host_name crow
- service_description HTTP
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups godesign-admins
- notification_interval 120
- notification_period 24x7
- notification_options w,u,c,r
- check_command check_smtp
- }
-
-
-# Service definition
-define service{
- use generic-service ; Name of service template to use
-
- host_name crow2
- service_description HTTP
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups godesign-admins
- notification_interval 120
- notification_period 24x7
- notification_options w,u,c,r
- check_command check_smtp
- }
-
-
-# Service definition
-define service{
- use generic-service ; Name of service template to use
-
- host_name crow3
- service_description HTTP
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups godesign-admins
- notification_interval 120
- notification_period 24x7
- notification_options w,u,c,r
- check_command check_smtp
- }
-
-
-# Service definition
-define service{
- use generic-service ; Name of service template to use
-
- host_name crow
- service_description POP3
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups godesign-admins
- notification_interval 120
- notification_period 24x7
- notification_options w,u,c,r
- check_command check_smtp
- }
-
-# definition of PING for airport
-define service{
- use generic-service ; Name of service template to use
-
- host_name airport
- service_description PING
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups admins
- notification_interval 120
- notification_period 24x7
- notification_options c,r
- check_command check_ping!100.0,20%!500.0,60%
- }
-
-
-# definition of PING for culain
-define service{
- use generic-service ; Name of service template to use
-
- host_name culain
- service_description PING
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups admins
- notification_interval 120
- notification_period 24x7
- notification_options c,r
- check_command check_ping!100.0,20%!500.0,60%
- }
-
-
-# definition of PING for dsl
-define service{
- use generic-service ; Name of service template to use
-
- host_name dsl
- service_description PING
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups admins
- notification_interval 120
- notification_period 24x7
- notification_options c,r
- check_command check_ping!100.0,20%!500.0,60%
- }
-
-
-# definition of PING for dslrouter
-define service{
- use generic-service ; Name of service template to use
-
- host_name dslrouter
- service_description PING
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups admins
- notification_interval 120
- notification_period 24x7
- notification_options c,r
- check_command check_ping!100.0,20%!500.0,60%
- }
-
-
-# definition of PING for kirby
-define service{
- use generic-service ; Name of service template to use
-
- host_name kirby
- service_description PING
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups admins
- notification_interval 120
- notification_period 24x7
- notification_options c,r
- check_command check_ping!100.0,20%!500.0,60%
- }
-
-
-# definition of PING for lugh
-define service{
- use generic-service ; Name of service template to use
-
- host_name lugh
- service_description PING
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups admins
- notification_interval 120
- notification_period 24x7
- notification_options c,r
- check_command check_ping!100.0,20%!500.0,60%
- }
-
-
-# definition of PING for printer
-define service{
- use generic-service ; Name of service template to use
-
- host_name printer
- service_description PING
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups admins
- notification_interval 120
- notification_period 24x7
- notification_options c,r
- check_command check_ping!100.0,20%!500.0,60%
- }
-
-
-# definition of PING for wlan
-define service{
- use generic-service ; Name of service template to use
-
- host_name wlan
- service_description PING
- is_volatile 0
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 3
- retry_check_interval 1
- contact_groups admins
- notification_interval 120
- notification_period 24x7
- notification_options c,r
- check_command check_ping!100.0,20%!500.0,60%
- }
-
View
113 tests/data/switch.cfg
@@ -0,0 +1,113 @@
+###############################################################################
+# SWITCH.CFG - SAMPLE CONFIG FILE FOR MONITORING A SWITCH
+#
+# Last Modified: 10-03-2007
+#
+# 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
+ normal_check_interval 5 ; Check the service every 5 minutes under normal conditions
+ retry_check_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
+ }
+
+
+
+
+
+
+
+
+
+
+
View
188 tests/data/templates.cfg
@@ -0,0 +1,188 @@
+###############################################################################
+# TEMPLATES.CFG - SAMPLE OBJECT TEMPLATES
+#
+# Last Modified: 10-03-2007
+#
+# NOTES: This config file provides you with some example object definition
+# templates that are refered 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 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
+ }
+
+
+
+
+###############################################################################
+###############################################################################
+#