Notes
When creating and/or editing configuration files, keep the following in mind:
Sample Configuration
A sample main configuration file can be created by running the 'make config' command. 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
Program mode
Log rotation method
Log archive path
External command check option
External command check interval
External command 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
Global host event handler
Global service event handler
Inter-check sleep time
Inter-check delay method
Service interleave factor
Maximum concurrent service checks
Service reaper frequency
Timing interval length
Agressive host checking option
Generic service notification summary
Administrator email address
Administrator pager
Log File |
Format: | log_file=<file_name> |
Example: | log_file=/usr/local/netsaint/var/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. You can split your configuration information into several files and specify multiple cfg_file= statements to include each of them.
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.
Note: On most systems, the temp file will have to reside on the same filesystem as the status file, the log file, and the log file archive path.
Program Mode |
Format: | program_mode=<a/s> |
Example: | program_mode=a |
This is the intial program mode that NetSaint should use when it starts or restarts. More information on program modes can be found here. Values are as follows:
Log Rotation Method |
Format: | log_rotation_method=<n/h/d/w/m> |
Example: | log_rotation_method=d |
This is the rotation method that you would like NetSaint to use for your log file. Values are as follows:
Log Archive Path |
Format: | log_archive_path=<path> |
Example: | log_archive_path=/usr/local/netsaint/var/archives/ |
This is the directory where NetSaint should place log files that have been rotated. This option is ignored if you choose to not use the log rotation functionality.
External Command Check Option |
Format: | check_external_commands=<0/1> |
Example: | check_external_commands=1 |
This option determines whether or not NetSaint will check the command file for internal commands it should execute. This option must be enabled if you plan on using the command CGI to issue commands via the web interface. Third party programs can also issue commands to NetSaint by writing to the command file, provided proper rights to the file have been granted as outlined in this FAQ. More information on external commands can be found here.
External Command Check Interval |
Format: | command_check_interval=<xxx> |
Example: | command_check_interval=1 |
This is the number of "time units" to wait between external command checks. Unless you've changed the interval_length value (as defined below) from the default value of 60, this number will mean minutes. Each time NetSaint checks for external commands it will read and process all commands present in the command file before continuing on with its other duties. More information on external commands can be found here.
External Command File |
Format: | command_file=<file_name> |
Example: | command_file=/usr/local/netsaint/var/rw/netsaint.cmd |
This is the file that NetSaint will check for external commands to process. The command CGI writes commands to this file. Other third party programs can write to this file if proper file permissions have been granted as outline in this FAQ. More information on external commands can be found here.
Log Severity Level |
Format: | log_level=<1-2> |
Example: | log_level=1 |
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 |
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.
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.
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.
Global Host Event Handler Option |
Format: | global_host_event_handler=<command> |
Example: | global_host_event_handler=log-host-event-to-db |
This option allows you to specify a host event handler command that is to be run for every host state change. The global event handler is executed immediately prior to the event handler that you have optionally specified in each host definition. The command argument is the short name of a command definition that you define in your host configuration file. More information on event handlers can be found here.
Global Service Event Handler Option |
Format: | global_service_event_handler=<command> |
Example: | global_service_event_handler=log-service-event-to-db |
This option allows you to specify a service event handler command that is to be run for every service state change. The global event handler is executed immediately prior to the event handler that you have optionally specified in each service definition. The command argument is the short name of a command definition that you define in your host configuration file. More information on event handlers can be found here.
Inter-Check Sleep Time |
Format: | sleep_time=<seconds> |
Example: | sleep_time=1 |
Inter-Check Delay Method |
Format: | inter_check_delay_method=<n/d/s> |
Example: | inter_check_delay_method=s |
Service Interleave Factor |
Format: | service_interleave_factor=<s|n> |
Example: | service_interleave_factor=s |
Maximum Concurrent Service Checks |
Format: | max_concurrent_checks=<max_checks> |
Example: | max_concurrent_checks=20 |
Service Reaper Frequency |
Format: | service_reaper_frequency=<frequency_in_seconds> |
Example: | service_reaper_frequency=10 |
Timing Interval Length |
Format: | interval_length=<seconds> |
Example: | interval_length=60 |
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 |
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$" |
Administrator Email Address |
Format: | admin_email=<email_address> |
Example: | admin_email=root |
Administrator Pager |
Format: | admin_pager=<pager_number_or_pager_email_gateway> |
Example: | admin_pager=pageroot@pagenet.com |