############################################################################### # Sample HOSTS.CFG file for NetSaint # # 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: 01-16-2002 ############################################################################### ############################################################################### # TIME PERIOD CONFIGURATION # # SYNTAX: # timeperiod[]=;; # ;; # ;; # ; # # = A short name used to identify the time period # = A longer name and/or description of the time period # = Time ranges during the day. Ranges are in the # following format (based on a 24 hour clock) and # represent intervals of time (with a start and end # time). Multiple time ranges per day should be # separated with commas. # # Example: 09:00-17:00 (9:00am to 5:00pm) # Example: 00:00-8:00,17:00-24:00 (12:00am to 8:00am AND 5:00pm-12:00am) # # A NULL value for a particular day indicates that no times are valid # during that particular day of the week. # ############################################################################### # timeperiod_name = "24x7" # timeperiod_alias = "Hours A Days, 7 Days A Week" # timeranges = 12:00am to 12:00pm (repeat 7 times to represent everyday) timeperiod[24x7]=24 Hours A Day, 7 Days A Week;00:00-24:00;00:00-24:00;00:00-24:00;00:00-24:00;00:00-24:00;00:00-24:00;00:00-24:00 # timeperiod_name = "workhours" # timeperiod_alias = ""Normal" Working Hours" # timeranges = 9:00am to 5:00pm (Note the extra semicolon after the aliasname # and the extra semicolon at the end (representing an off time # for Sunday and Saturday) timeperiod[workhours]="Normal" Working Hours;;09:00-17:00;09:00-17:00;09:00-17:00;09:00-17:00;09:00-17:00; # timeperiod_name = "nonworkhours" # timeperiod_alias = "Non-Work Hours" # timeranges = 12:00am to 12:00pm Sunday # 12:00am to 9:00am and 5:00pm to 12:00am weekday # (Notice the above time is repeated 5 times to represent # Monday to Friday) # 12:00am to 12:00pm Saturday timeperiod[nonworkhours]=Non-Work Hours;00:00-24:00;00:00-09:00,17:00-24:00;00:00-09:00,17:00-24:00;00:00-09:00,17:00-24:00;00:00-09:00,17:00-24:00;00:00-09:00,17:00-24:00;00:00-24:00 # timeperiod_name = "none" # timeperiod_alias = "No Time Is A Good Time" # timeranges = none timeperiod[none]=No Time Is A Good Time;;;;;;; ############################################################################### # HOST CONFIGURATION # # SYNTAX: # host[]=;
;;; # ;; # ;;;; # # # = A short name used to identify the host # = A longer name and/or description of the host #
= The address of the host (preferably an IP address!) # = This is a list of short name of the "parent" hosts of # this host. Multiple parent hosts are separated by # commas. Read the HTML documentation (particularly the # "theory of operation section") for more information # on this. # = This is the short name for the command that should # be used to check to see if the host is down or up # = Maximum number of times the host will be checked # before it is deemed to be "down" # = Number of minutes to wait before re-notifying # contact that the host is still down. # = The short name of the timeperiod (defined above) # that determines when notifications about this host # may be sent out # = Notify contacts when this host recovers? # 1= yes, 0 =no # = Notify contacts when host is down? # 1 = yes, 0 = no # = Notify contacts when host is unreachable? # 1 = yes, 0 = no # = The short name of the command that should be # executed when change is detected in the status of # host (i.e. when it goes down or recovers. If you # do not want to use an event handlers, leave this # options blanks # ############################################################################### # Note: The host definitions below do not have any event handlers specified # Servers host[localhost]=localhost;127.0.0.1;;check-host-alive;10;120;24x7;1;1;1; ############################################################################### # HOST GROUP CONFIGURATION # # SYNTAX: # hostgroup[]=;; # # = A short name used to identify the host group # (i.e. 'nt-servers') # = A long name and/or description for this host group # (i.e. 'All NT Servers') # = The name of the contact groups (defined later) that are # contacted if there are any problems with the hosts in this # group. Multiple groups are separated by commas. # = The short names of hosts (as defined above) that are # included in this host group. Multiple hosts are separated # by commas. ############################################################################### hostgroup[test]=Test Servers;localhost;localhost ############################################################################### # COMMAND CONFIGURATION # # SYNTAX: # command[]= # # = A short name used to identify the command # = The actual command line. The command line doesn't have to be # surrounded in quotes, but may contain quotes as needed within # the command line. Take care to use single quotes at the # outer edges of commands or you will have command line # expansion problems when the command is executed by the shell. # Any valid shell command can be used. Multiple commands can # be separated with semicolons, piping is allowed. The # command line can contain macros, but not are macros are valid # at all time (notifications, service checks, etc). See the # HTML documentaion for more informationon on using macros in # commands. # # Note: Service check, service notification, host check, host notification, # service event handler, and host event handler functions are all defined # here. ############################################################################### # Service notification command - send email with problem summary command[notify-by-email]=/bin/echo -e '***** NetSaint *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $DATETIME$\n\nAdditional Info:\n\n$OUTPUT$' | /usr/bin/mail -s '** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **' $CONTACTEMAIL$ # Service notification command - send email to alphanumeric pager # gateway The notify-by-epager command assumes that each contact has a # pager email gateway, and that the address has been entered into the # appropriate contact field instead of an actual pager # number. (i.e. 'pagejoe@nowhere.com' routes mail to Joe's # alphanumeric pager) command[notify-by-epager]=/bin/echo -e "Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $OUTPUT$\nDate: $DATETIME$" | /usr/bin/mail -s '$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$' $CONTACTPAGER$ # Host notification commands (one for email, one for alphanumeric # pager with email gateway) command[host-notify-by-email]=/bin/echo -e "***** NetSaint *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $OUTPUT$\n\nDate/Time: $DATETIME$\n" | /usr/bin/mail -s 'Host $HOSTSTATE$ alert for $HOSTNAME$!' $CONTACTEMAIL$ command[host-notify-by-epager]=/bin/echo -e "Host '$HOSTALIAS$' is $HOSTSTATE$\nInfo: $OUTPUT$\nTime: $DATETIME$" | /usr/bin/mail -s '$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$' $CONTACTPAGER$ # 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. command[test1]=/bin/df -lk / command[test2]=/bin/ping -c 1 $HOSTADDRESS$ # This command checks to see if a host is "alive" by pinging it command[check-host-alive]=/bin/check_ping -c 1 $HOSTADDRESS$ ############################################################################### # CONTACT CONFIGURATION # # SYNTAX: # contact[]=;; # ;; # ;; # ;; # ;; # ;; # # = A short name used to identify the contact # (i.e. username) # = Full name and/or description for the contact # = The short name of the timeperiod (as defined # above) that determines when service notifications # may be sent to this contact # = The short name of the timeperiod (as defined # above) that determines when host notifications # may be sent to this contact # = Notify the contact on service recoveries? # 1 = yes, 0 = no # = Notify the contact on critical service states? # 1 = yes, 0 = no # = Notify the contact on warning service states? # 1 = yes, 0 = no # = Notify the contact on host recoveries? # 1 = yes, 0 = no # = Notify the contact when hosts are down? # 1 = yes, 0 = no # = Notify the contact when hosts are unreachable? # 1 = yes, 0 = no # = Short names for commands (defined above) used to # notify the contact of service recoveries and # warning or critical service levels. Multiple # commands are comma delimited. All commands are # executed when the contact needs to be notified. # = Short names for commands (defined above) used to # notify the contact when a host goes down or comes # back up. Multiple commands are comma delimited. # All commands are executed when the contact needs # to be notified. # = Email address for the contact # = Pager number or pager email address for the # contact (see documentation for more information) # # Note: All fields are required, except for the and # fields. However,either the email address *or* the pager must be # specified - both cannot be empty! # ############################################################################### contact[netsaint]=Netsaint User;24x7;24x7;1;1;1;1;1;1;notify-by-email;host-notify-by-email;netsaint; ################################################################################ # CONTACT GROUP CONFIGURATION # # SYNTAX: # contactgroup[]=; # # = The short name used to identify the contact group # = A longer name and/or description for the contact group # = The short names of contacts (as defined above) that are # members of this contact group. Multiple contacts are # separated by commas. ############################################################################### contactgroup[localhost]=Netsaint Administrators;netsaint ############################################################################### # SERVICE CONFIGURATION # # SYNTAX: # service[]=;;;; # ;;; # ;;; # ;;; # # = The short name of the host (as defined above) that # this service is running on # = A description for this service (i.e 'My Website') # = Specifies whether this service is volatile or not. # See the HTML documentation for more information on # what volatile services are and how they work. Most # service are *not* volatile. # 1 = volatile, 0 = not volatile # = The short name of the timeperiod (as defined above) # that determines when this service may be checked # = Number of times to retry the service check before # reporting that it is at a warning or critical level # = Number of minutes to wait between regular checks # of the service # = Number of minutes to wait between retry of the # service # = The short name of the contact group (as defined # above) that should be notified of problems with # this service. # = Number of minutes to wait before *re-notifying* # a contact that the service is *still* at a warning # or critical level (after we notify them about the # problem immediately) # = The short name of the timeperiod (as defined above) # that determines when notifications about this # service may be sent out # = Notify contacts when this service recovers? # 1 = yes, 0 = no # = Notify contacts when service is at a critical level? # 1 = yes, 0 = no # = Notify contacts when service is at a warning level? # 1 = yes, 0 = no # = A command that should be executed whenever a change # is detected in the status of the service. If you do # not want to use an event handler, leave this option # blank. # = The command used to check the status of the service. # This can be in one of three formats (described # below) # # Note: Commands can be in on of three formats... # # 1. The short name of a command defined above (this is the simplest form) # # Example: # # 2. The short name of a command defined above, with arguments delimited # with bang (!) characters. If this format is used, the command must # be defined with $ARGx$ macros in order to actually use the arguments # that are passed to it (read the doc for more information on this) # # Example: !!!...! # # 3. An actual command line enclosed in quotation marks. The outside # quotation marks are stripped off before the command is exected. # Macros can be used in this "raw" command format, but are still # limited to only the macros which are valid during service check # (read the documentation for more information) # # Example: "./check_ping $HOSTADDRESS$ 40 80 5.0 100.0" ############################################################################### # Note: The service definitions below do not have event handlers defined service[localhost]=PING;0;24x7;4;5;1;localhost;960;24x7;0;0;0;;test1 service[localhost]=DISK;0;24x7;4;5;1;localhost;960;24x7;0;0;0;;test2 # service[]=;;;; # ;;; # ;;; # ;;; ################################################################################ # HOST GROUP NOTIFICATION ESCALATION # # SYNTAX: # hostgroupescalation[]=-; # # # = The short name of the host group that this escalation # entry is to be used for. # = The first notification that that this escalation is # valid for. # = The last notification that that this escalation is # valid for. If this value is zero (0), the escalation # entry will be valid for all notification beyond the # first notification you specified. # = A list of the short names of the contact groups that # should be notified of problems when this escalation # is valid. Multiple contact groups should be separated # with commas. ################################################################################ #hostgroupescalation[novell-servers]=2-5;novell-admins,nt-admins #hostgroupescalation[novell-servers]=6-0;novell-admins,nt-admins,linux-admins ################################################################################ # SERVICE NOTIFICATION ESCALATION # # SYNTAX: # serviceescalation[;]=-; # # # = The short name of the host that is associated with # this service. # = The description of the service that this escalation # entry is associated with. # = The first notification that that this escalation is # valid for. # = The last notification that that this escalation is # valid for. If this value is zero (0), the escalation # entry will be valid for all notification beyond the # first notification you specified. # = A list of the short names of the contact groups that # should be notified of problems when this escalation # is valid. Multiple contact groups should be separated # with commas. ################################################################################ #serviceescalation[linux1;PING]=2-6;linux-admins,novell-admins #serviceescalation[linux1;Current Users]=5-0;linux-admins,novell-admins # EOF