CGI Configuration File Options
Prev | Chapter 3. Configuring Icinga | Next

## CGI 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

| Tip
A sample CGI configuration file (cgi.cfg;) is installed for you when you follow the quickstart installation guide.

Config File Location

By default, Icinga expects the CGI configuration file to be named cgi.cfg and located in the config file directory along with the main config file. If you need to change the name of the file or its location, you can configure Apache to pass an environment variable named ICINGA_CGI_CONFIG (which points to the correct location) to the CGIs. See the Apache documentation for information on how to do this.

Configuration File Variables

Below you will find descriptions of each main Icinga configuration file option...

Index

- Main configuration file location

- Physical HTML path

- URL HTML path

- URL Stylesheets path

- Authentication usage

- Default user name

- System/process information access

- System/process command access

- Configuration information access

- Global host information access

- Global host command access

- Global service information access

- Global service command access

- Show all services a host is authorised for

- Deny access to commands and comments

- Lock author names

- Status show long plugin output

- Statusmap CGI background image

- Default statusmap layout method

- Statuswrl CGI include world

- Default statuswrl layout method

- CGI refresh rate

- Audio alerts

- Ping syntax

- Escape HTML tags option

- Notes URL target

- Action URL target

- Tac Show Only Hard State

- Splunk integration option

- Splunk URL

- Persistent Acknowledge Comments

- Show Initial States

- Show Current States

- Show Object Type in Tab Title

- Show Service State and Notifications Number

- HTTP character set

- First Day of Week

- CGI Command Logging

- CGI Log File

- CGI Log Rotation Method

- CGI Log Archive Path

- Enforce comments on Actions

- Show Header with Tactical Information

- Show Header with Pending Counts

- Set default downtime duration

- Suppress objects in maintaince/downtime state

- Show partial hostgroups

- Highlight rows in status.cgi

Main Configuration File Location

Format: | main_config_file=<file_name>
Example: | main_config_file=/usr/local/icinga/etc/icinga.cfg

This specifies the location of your main configuration file. The CGIs need to know where to find this file in order to get information about configuration information, current host and service status, etc.

Physical HTML Path

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

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

URL HTML Path

Format: | url_html_path=<path>
Example: | url_html_path=/icinga

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

URL Stylesheet Path

Format: | url_stylesheet_path=<path>/stylesheets
Example: | url_stylesheet_path=/icinga/stylesheets

This option allows to define an url stylesheet path other than the default. This will be useful when adding custom stylesheets in another location.If not set, the default location will be used (url_stylesheets_path=url_html_path/stylesheets).

Authentication Usage

Format: | use_authentication=[0/1]
Example: | use_authentication=1

This option controls whether or not the CGIs will use the authentication and authorisation functionality when determining what information and commands users have access to. We would strongly suggest that you use the authentication functionality for the CGIs. If you decide not to use authentication, make sure to remove the command CGI to prevent unauthorised users from issuing commands to Icinga. The CGI will not issue commands to Icinga if authentication is disabled, but we would suggest removing it altogether just to be on the safe side. More information on how to setup authentication and configure authorisation for the CGIs can be found here.

- 0 = Don't use authentication functionality

- 1 = Use authentication and authorisation functionality (default)

Default User Name

Format: | default_user_name=<username>
Example: | default_user_name=guest

Setting this variable will define a default username that can access the CGIs. This allows people within a secure domain (i.e., behind a firewall) to access the CGIs without necessarily having to authenticate to the web server. You may want to use this to avoid having to use basic authentication if you are not using a secure server, as basic authentication transmits passwords in clear text over the Internet.

Important: Do not define a default username unless you are running a secure web server and are sure that everyone who has access to the CGIs has been authenticated in some manner! If you define this variable, anyone who has not authenticated to the web server will inherit all rights you assign to this user!

System/Process Information Access

Format: | authorized_for_system_information=<user1>,<user2>,<user3>,...<usern>
Example: | authorized_for_system_information=icingaadmin,theboss

This is a comma-delimited list of names of authenticated users who can view system/process information in the extended information CGI. Users in this list are not automatically authorised to issue system/process commands. If you want users to be able to issue system/process commands as well, you must add them to the authorized_for_system_commands variable. More information on how to setup authentication and configure authorisation for the CGIs can be found here.

| Note
Starting with Icinga 1.5.0 you can alternatively specify `authorized_contactgroup_for_system_information` to authorise a contactgroup instead of a contact.

System/Process Command Access

Format: | authorized_for_system_commands=<user1>,<user2>,<user3>,...<usern>
Example: | authorized_for_system_commands=icingaadmin

This is a comma-delimited list of names of authenticated users who can issue system/process commands via the command CGI. Users in this list are not automatically authorised to view system/process information. If you want users to be able to view system/process information as well, you must add them to the authorized_for_system_information variable. More information on how to setup authentication and configure authorisation for the CGIs can be found here.

| Note
Starting with Icinga 1.5.0 you can alternatively specify `authorized_contactgroup_for_system_commands` to authorise a contactgroup instead of a contact.

Configuration Information Access

Format: | authorized_for_configuration_information=<user1>,<user2>,<user3>,...<usern>
Example: | authorized_for_configuration_information=icingaadmin

This is a comma-delimited list of names of authenticated users who can view configuration information in the configuration CGI. Users in this list can view information on all configured hosts, host groups, services, contacts, contact groups, time periods, and commands. More information on how to setup authentication and configure authorisation for the CGIs can be found here.

| Note
Starting with Icinga 1.5.0 you can alternatively specify `authorized_contactgroup_for_configuration_information` to authorise a contactgroup instead of a contact.

Global Host Information Access

Format: | authorized_for_all_hosts=<user1>,<user2>,<user3>,...<usern>
Example: | authorized_for_all_hosts=icingaadmin,theboss

This is a comma-delimited list of names of authenticated users who can view status and configuration information for all hosts. Users in this list are also automatically authorised to view information for all services. Users in this list are not automatically authorised to issue commands for all hosts or services. If you want users able to issue commands for all hosts and services as well, you must add them to the authorized_for_all_host_commands variable. More information on how to setup authentication and configure authorisation for the CGIs can be found here.

| Note
Starting with Icinga 1.5.0 you can alternatively specify `authorized_contactgroup_for_all_hosts` to authorise a contactgroup instead of a contact.

Global Host Command Access

Format: | authorized_for_all_host_commands=<user1>,<user2>,<user3>,...<usern>
Example: | authorized_for_all_host_commands=icingaadmin

This is a comma-delimited list of names of authenticated users who can issue commands for all hosts via the command CGI. Users in this list are also automatically authorised to issue commands for all services. Users in this list are not automatically authorised to view status or configuration information for all hosts or services. If you want users able to view status and configuration information for all hosts and services as well, you must add them to the authorized_for_all_hosts variable. More information on how to setup authentication and configure authorisation for the CGIs can be found here.

| Note
Starting with Icinga 1.5.0 you can alternatively specify `authorized_contactgroup_for_all_host_commands` to authorise a contactgroup instead of a contact.

Global Service Information Access

Format: | authorized_for_all_services=<user1>,<user2>,<user3>,...<usern>
Example: | authorized_for_all_services=icingaadmin,theboss

This is a comma-delimited list of names of authenticated users who can view status and configuration information for all services. Users in this list are not automatically authorised to view information for all hosts. Users in this list are not automatically authorised to issue commands for all services. If you want users able to issue commands for all services as well, you must add them to the authorized_for_all_service_commands variable. More information on how to setup authentication and configure authorisation for the CGIs can be found here.

| Note
Starting with Icinga 1.5.0 you can alternatively specify `authorized_contactgroup_for_all_services` to authorise a contactgroup instead of a contact.

Global Service Command Access

Format: | authorized_for_all_service_commands=<user1>,<user2>,<user3>,...<usern>
Example: | authorized_for_all_service_commands=icingaadmin

This is a comma-delimited list of names of authenticated users who can issue commands for all services via the command CGI. Users in this list are not automatically authorised to issue commands for all hosts. Users in this list are not automatically authorised to view status or configuration information for all hosts. If you want users able to view status and configuration information for all services as well, you must add them to the authorized_for_all_services variable. More information on how to setup authentication and configure authorisation for the CGIs can be found here.

| Note
Starting with Icinga 1.5.0 you can alternatively specify `authorized_contactgroup_for_all_service_commands` to authorise a contactgroup instead of a contact.

Show All Services A Host Is Authorized For

Format: | show_all_services_host_is_authorized_for=[0|1]
Example: | show_all_services_host_is_authorized_for=1

By default, a user can see all services on a host, if the user is authorised as contact for the host only. By disabling this option, the user must be an authorised contact for the service too in order to view it. Keep in mind that setting the user in authorized_for_all_services obsoletes this option (included starting with Icinga 1.0.2)

Deny access to commands and comments

Format: | authorized_for_read_only=<user1>,<user2>,<user3>,...<usern>
Example: | authorized_for_read_only=icingalook

This is a comma-delimited list of names of authenticated users who have read-only rights in the CGIs. This will block any host or service commands. It will also block comments from being shown to read-only users. Users in this list are not automatically authorised to view status or configuration information for all hosts. If you want users able to view status and configuration information for all services as well, you must add them to the authorized_for_all_services variable. More information on how to setup authentication and configure authorisation for the CGIs can be found here.

| Note
Starting with Icinga 1.5.0 you can alternatively specify `authorized_contactgroup_for_read_only` to authorise a contactgroup instead of a contact.

Lock Author Names

Format: | lock_author_names=[0/1]
Example: | lock_author_names=1

This option allows you to restrict users from changing the author name when submitting comments, acknowledgements, and scheduled downtime from the web interface. If this option is enabled, users will be unable to change the author name associated with the command request.

- 0 = Allow users to change author names when submitting commands

- 1 = Prevent users from changing author names (default)

Status Show Long Plugin Output

Format: | status_show_long_plugin_output=[0/1]
Example: | status_show_long_plugin_output=1

This option allows you to specify the length of status information in output of status.cgi. If you set the value to 1 it shows the full plugin output instead of the first line only. Default value is 0.

- 0 = Display only the first line of plugin output (default)

- 1 = Display the complete plugin output

| Note
This option is available starting with Icinga 1.0.3.

Statusmap CGI Background Image

Format: | statusmap_background_image=<image_file>
Example: | statusmap_background_image=smbackground.gd2

This option allows you to specify an image to be used as a background in the statusmap CGI if you use the user-supplied coordinates layout method. The background image is not be available in any other layout methods. It is assumed that the image resides in the HTML images path (i.e. /usr/local/icinga/share/images). This path is automatically determined by appending "/images" to the path specified by the physical_html_path directive.

| Note
The image file can be in GIF, JPEG, PNG, or GD2 format. However, GD2 format (preferably in uncompressed format) is recommended, as it will reduce the CPU load when the CGI generates the map image.

Default Statusmap Layout Method

Format: | default_statusmap_layout=<layout_number>
Example: | default_statusmap_layout=4

This option allows you to specify the default layout method used by the statusmap CGI. Valid options are:

<layout_number> Value | Layout Method
0 | User-defined coordinates
1 | Depth layers
2 | Collapsed tree
3 | Balanced tree
4 | Circular
5 | Circular (Marked Up)
6 | Circular (Balloon)

Statuswrl CGI Include World

Format: | statuswrl_include=<vrml_file>
Example: | statuswrl_include=myworld.wrl

This option allows you to include your own objects in the generated VRML world. It is assumed that the file resides in the path specified by the physical_html_path directive.

| Note
This file must be a fully qualified VRML world (i.e. you can view it by itself in a VRML browser).

Default Statuswrl Layout Method

Format: | default_statuswrl_layout=<layout_number>
Example: | default_statuswrl_layout=4

This option allows you to specify the default layout method used by the statuswrl CGI. Valid options are:

<layout_number> Value | Layout Method
0 | User-defined coordinates
2 | Collapsed tree
3 | Balanced tree
4 | Circular

CGI Refresh Rate

Format: | refresh_rate=<rate_in_seconds>
Example: | refresh_rate=90

This option allows you to specify the number of seconds between page refreshes for the status, statusmap, and extinfo CGIs.

Audio Alerts

Formats: | host_unreachable_sound=<sound_file> host_down_sound=<sound_file> service_critical_sound=<sound_file> service_warning_sound=<sound_file> service_unknown_sound=<sound_file>
Examples: | host_unreachable_sound=hostu.wav host_down_sound=hostd.wav service_critical_sound=critical.wav service_warning_sound=warning.wav service_unknown_sound=unknown.wav

These options allow you to specify an audio file that should be played in your browser if there are problems when you are viewing the status CGI. If there are problems, the audio file for the most critical type of problem will be played. The most critical type of problem is on or more unreachable hosts, while the least critical is one or more services in an unknown state (see the order in the example above). Audio files are assumed to be in the media/ subdirectory in your HTML directory (i.e. /usr/local/icinga/share/media).

Ping Syntax

Format: | ping_syntax=<command>
Example: | ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$

This option determines what syntax should be used when attempting to ping a host from the WAP interface (using the statuswml CGI. You must include the full path to the ping binary, along with all required options. The $HOSTADDRESS$ macro is substituted with the address of the host before the command is executed.

Escape HTML Tags Option

Format: | escape_html_tags=[0/1]
Example: | escape_html_tags=1

This option determines whether or not HTML tags in host and service (plugin) output is escaped in the CGIs. If you enable this option, your plugin output will not be able to contain clickable hyperlinks.

Notes URL Target

Format: | notes_url_target=[target]
Example: | notes_url_target=_blank

This option determines the name of the frame target that notes URLs should be displayed in. Valid options include _blank, _self, _top, _parent, or any other valid target name.

Action URL Target

Format: | action_url_target=[target]
Example: | action_url_target=_blank

This option determines the name of the frame target that action URLs should be displayed in. Valid options include _blank, _self, _top, _parent, or any other valid target name.

Tac Show Only Hard State

Format: | tac_show_only_hard_state=[0/1]
Example: | tac_show_only_hard_state=1

This option allows you to specify if the tactical overview should only show hard states on hosts and services. If you set this option to 1 the tactical overview shows only states on hosts and services. By default disabled, all states will be shown.

Splunk Integration Option

Format: | enable_splunk_integration=[0/1]
Example: | enable_splunk_integration=1

This option determines whether integration functionality with Splunk is enabled in the web interface. If enabled, you'll be presented with "Splunk It" links in various places in the CGIs (log file, alert history, host/service detail, etc). Useful if you're trying to research why a particular problem occurred. For more information on Splunk, visit http://www.splunk.com/.

Splunk URL

Format: | splunk_url=<path>
Example: | splunk_url=http://127.0.0.1:8000/

This option is used to define the base URL to your Splunk interface. This URL is used by the CGIs when creating links if the enable_splunk_integration option is enabled.

Persistent Acknowledge Comments

Format: | persistent_ack_comments=<0|1>
Example: | persistent_ack_comments=1

This option controls the initial state of the check box "persistent comment" to acknowledge problem hosts or services. It can be used to reinstate the behaviour of Nagios 2. Default is "0" to be compatible with Nagios 3.

- 0 = Leave check box "persistent comment" unchecked (default)

- 1 = Set check box "persistent comment"

| Note
This option is available starting with Icinga 1.0.3.

Show initial states

Format: | showlog_initial_states=<0|1>
Example: | showlog_initial_states=1

This option allows you to specify if initial states of hosts and services should be shown in showlog.cgi.

| Note
This option only works if the option "log_initial_states" in icinga.cfg is set to 1.

- 0 = Don't show initial states in showlog.cgi

- 1 = Show initial states in showlog.cgi (default)

| Note
This option is available starting with Icinga 1.3.

Show current states

Format: | showlog_current_states=<0|1>
Example: | showlog_current_states=1

This option allows you to specify if current states of hosts and services should be shown in showlog.cgi.

| Note
This option only works if the option "log_current_states" in icinga.cfg is set to 1.

- 0 = Don't show current states in showlog.cgi

- 1 = Show current states in showlog.cgi (default)

| Note
This option is available starting with Icinga 1.3.

Show object type in tab title

Format: | tab_friendly_titles=<0|1>
Example: | tab_friendly_titles=1

Activating this option changes the <title> of status.cgi and extinfo.cgi when they refer to a single host, service, or group.

They will then read:

- [Host]

- {HostGroup}

- ServiceDesc @ Host

- (ServiceGroup)

These are easier to read and find if you use (many) tabs in your browser.

- 0 = Don't show object type in tab title

- 1 = Show object type in tab title (default)

| Note
This option is available starting with Icinga 1.3.

Show service state and notification number

Format: | add_notif_num_hard=n
| add_notif_num_soft=n
Example: | add_notif_num_hard=28

Set this to an OR of the service state identifiers for which status.cgi should not only report "attempts" (e.g., "3/3" for a HARD non-OK state with max_check_attempts=3) but also the current notification number ("(#0)" if no problem notification has been sent yet, etc.). This is helpful to identify services which switched between different non-OK states a lot, or services which have a first_notification_delay set and are "not yet officially" considered in trouble.

Relevant values from include/statusdata.h (look them up *there* if you want to be *really* sure):

     #define    SERVICE_PENDING     1
     #define    SERVICE_OK          2
     #define    SERVICE_WARNING     4
     #define    SERVICE_UNKNOWN     8
     #define    SERVICE_CRITICAL   16

You'll likely want to use add_notif_num_hard=0 (default) or add_notif_num_hard=28 (warn+crit+unknown).

There's an add_notif_num_soft affecting services in a SOFT state for sake of completeness, too.

| Note
These options are available starting with Icinga 1.3.

Set HTTP character set

Format: | http_charset=<char-set>
Example: | http_charset=utf-8

This is the character set which is sent with HTTP headers. Default is utf-8.

| Note
This option is available starting with Icinga 1.3.

Set first day of week

Format: | first_day_of_week=<0|1>
Example: | first_day_of_week=1

This sets the first day of the week which is used in several CGI-reports. Default is 0 = sunday. 1 = monday will be suitable for countries adhering to ISO 8601.

| Note
This option is available starting with Icinga 1.4.

Logging of CGI commands

Format: | use_logging=<0|1>
Example: | use_logging=1

This option enables the logging of CGI commands in a separate log file. Default is 0 = logging disabled, 1 = logging enabled.

| Note
This option is available starting with Icinga 1.4.

CGI log file

Format: | cgi_log_file=<file_name>
Example: | cgi_log_file=/usr/local/icinga/share/log/icinga-cgi.log

This option sets the location of the CGI log file.

| Note
This option is available starting with Icinga 1.4.

CGI log file rotation method

Format: | log file rotation method=<d|w|m>
Example: | cgi_log_rotation_method=d

This is the rotation method that you would like Icinga to use for your CGI log file. Values are as follows:

- d = Daily (rotate the log at midnight each day - this is the default)

- w = Weekly (rotate the log at midnight on Saturday)

- m = Monthly (rotate the log at midnight on the last day of the month)

| Note
This option is available starting with Icinga 1.4.

CGI Log Archive Path

Format: | cgi_log_archive_path=<archive directory>
Example: | cgi_log_archive_path=/usr/local/icinga/share/log

This is the directory where Icinga should place CGI log files that have been rotated. This option is ignored if you choose to not use the CGI log rotation functionality.

| Note
This option is available starting with Icinga 1.4.

Enforce comments on actions

Format: | enforce_comments_on_actions=<0|1>
Example: | enforce_comments_on_actions=1

Enforces the need to enter a comment on actions entered via the CGIs. 0 = do not enforce comment (default), 1 = enforce comment.

| Note
The option use_logging has to be enabled, otherwise there will be no logging of comments.

| Note
This option is available starting with Icinga 1.4.

Show header with tactical information

Format: | show_tac_header=<0|1>
Example: | show_tac_header=0

There's a new CGI driven top frame that is enabled by default. The new view has a similar feel to the header that is in Icinga-Web and includes important tactical and monitor performance information so you can always be informed of issues.

If you want to keep the old minimalistic look, the new CGI top view can be disabled with the directive: `show_tac_header=0`

The layout for the display of entries for each type is "X / Y / Z" where:

X = Active unacknowledged
Y = Passive unacknowledged
Z = Acknowledged

The X/Y/Z numbers themselves are click-able and will bring you to a list of all the services or hosts related to the respective entry.

Colouring for these entries has the following logical flow:

     1+ / *  / *  = Full colour, full saturation
     0  / 1+ / *  = Full colour but desaturated, rim coloured
     0  / 0  / 1+ = Rim coloured, text coloured and bold
     0  / 0  / *  = Grey

These colours are located in `html/stylesheets/tacheader.css` for easy customisation. For example, if your setup is distributed and primarily depends upon passive checks then you may prefer to make passive check issues stand out with the same colouring as active checks.

Figure 3.1. Example of new header

| Note
This option is available starting with Icinga 1.4.

Show header including pending counts

Format: | show_tac_header_pending=<0|1>
Example: | show_tac_header_pending=0

This option enables the display of pending counts in the tac header. If your display is less than 1024x768 and this is enabled, the tactical information may not fit well in the top frame. By default it is disabled.

| Note
This option is available starting with Icinga 1.4.1

Set default downtime duration

Format: | default_downtime_duration=n
Example: | default_downtime_duration=7200

This option defines the default duration (in seconds) of fixed and flexible downtimes. Default is 7200 seconds (2 hours).

| Note
This option is available starting with Icinga 1.5

Suppress objects in maintenance/downtime state

Format: | suppress_maintenance_downtime=<0|1>
Example: | suppress_maintenance_downtime=0

The current Classic UI view shows the state of hosts including attention grabbing colours even if the host/service is scheduled for downtime. This tends to distract from discerning which problems really exist between those which were planned or expected. It is disabled by default to maintain the old behaviour, however those wishing to enable it will note that rather than displaying issues in their regular colour, they will be grey (similar to the pending state). The status, however will still display the actual state and this is intended behaviour. This is so the user can use icinga to see what the state is in before the downtime ends. A useful example for this is so it can be seen that a host/service that was being worked on actually came back online. In addition, hosts in scheduled downtime will be grey in the statusmap.cgi.

| Note
This option is available starting with Icinga 1.5

Show partial hostgroups

Format: | show_partial_hostgroups=<0|1>
Example: | show_partial_hostgroups=1

By default (meaning the directive is not present or disabled), a user only sees a hostgroup and the hosts within it if they are an authorised contact for all of the hosts of the group. The behaviour can be changed using the directive `show_partial_hostgroups=1`.

When enabled, the hostgroups overview will show a partial listing of hosts that the user is an authorised contact for within each hostgroup.

It will also add the string "(Partial Hostgroups Enabled)" to the top of the Hostgroup Overview to help prevent any confusion over whether the option is in use or not. However for privacy reasons, hostgroups that are only showing a partial listing are not specifically indicated.

COMPATIBILITY NOTICE: As with any tweak made to the output of the CGIs, enabling this option may adversely impact third party programs that rely on 'screen scraping' to get their information. If you encounter such a problem, turn this option back to its default of off and encourage the developer(s) of the program to use JSON for their data needs instead.

| Note
This option is available starting with Icinga 1.5

Highlight rows in status.cgi

Format: | highlight_table_rows=<0|1>
Example: | highlight_table_rows=0

This option allows you to define if table rows in status.cgi will be highlighted or not. Sometimes with a lot of rows or a large screen resolution it is hard to see which rows you are working on: Values: 0 = disables row highlighting; 1 = enables row highlighting (default).

| Note
This option is available starting with Icinga 1.5

Prev | Up | Next
Custom Object Variables | Home | Authentication And Authorization In The CGIs

© 2009-2011 Icinga Development Team, http://www.icinga.org