Main Configuration File Options


Notes

When creating and/or editing configuration files, keep the following in mind:

  1. Lines that start with a '#' character are taken to be comments and are not processed
  2. Variables names must begin at the start of the line - no white space is allowed before the name
  3. Variable names are case-sensitive

Sample Configuration

A sample main configuration file is provided with the NetSaint distribution and should automatically be created when you run the configure script before compiling the binaries. The default name of the main configuration file is netsaint.cfg - look for it in the NetSaint distribution directory or in the etc/ subdirectory of your installation.

Index

Log file
Host configuration file
Status file
Temp file
Log severity level
Syslog logging option
Syslog severity level
Notification logging option
Service check retry logging option
Host retry logging option
Event handler logging option
Inter-check sleep time
Timing interval length
Agressive host checking option
Automatic HTML generation option
Physical HTML path
URL HTML path
URL CGI-BIN path
Generic service notification summary
Administrator email address
Administrator pager

Log File

Format: log_file=<file_name>
Example: log_file=/usr/local/netsaint/netsaint.log

This variable specifies where NetSaint should create its main log file. This should be the first variable that you define in your configuration file, as NetSaint will try to write errors that it finds in the rest of your configuration data to this file. This file is never deleted, pruned or rotated by NetSaint. I suggest adding a cron job to do log rotations every month or so (more often if you have a lot of alarms).

Host Configuration File

Format: cfg_file=<file_name>
Example: cfg_file=/usr/local/netsaint/etc/hosts.cfg

This specifies the host configuration file that NetSaint should use for monitoring. Host configuration files contain configuration data for hosts, host groups, contacts, contact groups, services, commands, etc.

Status File

Format: status_file=<file_name>
Example: status_file=/usr/local/netsaint/var/status.log

This is the file that NetSaint uses to store the current status of all monitored services. The status of all hosts associated with the service you monitor are also recorded here. This file is used by the "status" CGI so that current monitoring status can be reported via a web interface. The CGIs must have read access to this file in order to function properly. This file is deleted every time NetSaint stops and recreated when it starts.

Temp File

Format: temp_file=<file_name>
Example: temp_file=/usr/local/netsaint/var/netsaint.tmp

This is the temporary file into which NetSaint redirects the standard output and error from the execution of plugins. The output from the plugins is scooped from the temp file and used for both display in the "status" CGI output and use in notification macros. This file is deleted after the plugin has been executed. This file is also used as a scratch file when NetSaint updates the status log.

Log Severity Level

Format: log_level=<1-2>
Example: log_level=1

This is the level of severity needed for service messages to be logged to the main log file. Values are as follows:

Notes:

Syslog Logging Option

Format: use_syslog=<0/1>
Example: use_syslog=1

This variable determines whether messages are logged to the syslog facility on your local host. Values are as follows:

Syslog Severity Level

Format: syslog_level=<1-2>
Example: syslog_level=1

This is the level of severity needed for service messages to be logged to the syslog facility. Values are as follows:

Notes:

Notification Logging Option

Format: log_notifications=<0/1>
Example: log_notifications=1

This variable determines whether or not notification messages are logged. If you have a lot of contacts or regular service failures your log file will grow relatively quickly. Use this option to keep contact notifications from being logged.

Service Check Retry Logging Option

Format: log_service_retries=<0/1>
Example: log_service_retries=1

This variable determines whether or not service check retries are logged. Service check retries occur when a service check results in a non-OK state, but you have configured NetSaint to retry the service more than once before responding to the error. Services in this situation are considered to be in "soft" states. Logging service check retries is mostly useful when attempting to debug NetSaint or test out service event handlers.

Event Handler Logging Option

Format: log_event_handlers=<0/1>
Example: log_event_handlers=1

This variable determines whether or not service and host event handlers are logged. Event handlers are optional commands that can be run whenever a service or hosts changes state. Logging event handlers is most useful when debuggin NetSaint or first trying out your event handler scripts.

Host Check Retry Logging Option

Format: log_host_retries=<0/1>
Example: log_host_retries=1

This variable determines whether or not host check retries are logged. Logging host check retries is mostly useful when attempting to debug NetSaint or test out host event handlers.

Inter-Check Sleep Time

Format: sleep_time=<seconds>
Example: sleep_time=1

This is the number of seconds that NetSaint will sleep before checking to see if the next service check in the scheduling queue should be executed. Note that NetSaint will only sleep after it "catches up" with queued service checks that have fallen behind.

Timing Interval Length

Format: interval_length=<seconds>
Example: interval_length=60

This is the number of seconds per "unit interval" used for timing in the scheduling queue, re-notifications, etc. "Units intervals" are used in the host configuration file to determine how often to run a service check, how often of re-notify a contact, etc.

Important: The default value for this is set to 60, which means that a "unit value" of 1 in the host configuration file will mean 60 seconds (1 minute). I have not really tested other values for this variable, so proceed at your own risk if you decide to do so!

Agressive Host Checking Option

Format: use_agressive_host_checking=<0/1>
Example: use_agressive_host_checking=0

Beginning with release 0.0.4, NetSaint tries to be a little smarter about how and when it checks the status of hosts. In general, disabling this option will allow NetSaint to make some smarter decisions and check hosts a bit faster. Enabling this option will increase the amount of time required to check hosts, but may improve reliability a bit. If you want to know more about exactly what this option does, search the source code in the netsaint.c file for the string "use_agressive_host_checking" and read some of the comments I've added. Unless you have problems with NetSaint not recognizing that a host recovered, I would suggest not enabling this option.

Automatic HTML Generation Option

Format: auto_generate_html=<0/1>
Example: auto_generate_html=1

This variable determines whether or not NetSaint will automatically generate the "static" HTML pages containing configuration information. If this option is enabled, NetSaint will regenerate the pages at startup and restart and put them in the directory specified by the physical_html_path option.

Physical HTML Path

Format: physical_html_path=<path>
Example: physical_html_path=/usr/local/netsaint/share

This is the physical path where the HTML files for NetSaint are kept on your workstation or server. NetSaint assumes that the documentation and images files are stored in subdirectories called docs/ and images/, respectively.

URL HTML Path

Format: url_html_path=<path>
Example: url_html_path=/netsaint

If, when accessing NetSaint via a web browser, you point to an URL like http://www.myhost.com/netsaint, this value should be /netsaint. Basically, its the path portion of the URL that is used to access the NetSaint HTML pages.

URL CGI-BIN Path

Format: url_cgibin_path=<path>
Example: url_cgibin_path=/cgi-bin/netsaint

If, when accessing NetSaint's CGI programs via a web browser, you point to an URL like http://www.myhost.com/cgi-bin/netsaint, this value should be /cgi-bin/netsaint. Basically, its the path portion of the URL that is used to access the NetSaint CGI-BIN programs.

Generic Service Notification Summary

Format: generic_summary=<notification_string_with_macros>
Example: generic_summary="***** NetSaint *****\n\n$SERVICESTATE$ alert/notification\n\nDate/Time: $DATETIME$\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\n\nAdditional Info:\n\n$OUTPUT$"

This is an optional generic service alert summary for use in service notification commands. If you define this variable you are able to use the $SUMMARY$ macro in notification messages. This is intended to ease the administrators wrist by not having to type a long, similiar message for each service notification command that is defined. Macros are allowed in the generic summary message. See the documentation on macros for information on what types of macros are "valid". Basically, any macro that is valid during a service notification can be used.

Administrator Email Address

Format: admin_email=<email_address>
Example: admin_email=root

This is the email address for the administrator of the local machine (i.e. the one that NetSaint is running on). This value can be used in notification commands by using the $ADMINEMAIL$ macro.

Administrator Pager

Format: admin_pager=<pager_number_or_pager_email_gateway>
Example: admin_pager=pageroot@pagenet.com

This is the pager number (or pager email gateway) for the administrator of the local machine (i.e. the one that NetSaint is running on). The pager number/address can be used in notification commands by using the $ADMINPAGER$ macro.