1 ## <a id="running-icinga2"></a> Running Icinga 2
3 ### <a id="init-script"></a> Init Script
5 Icinga 2's init script is installed in `/etc/init.d/icinga2` by default:
8 Usage: /etc/init.d/icinga2 {start|stop|restart|reload|checkconfig|status}
11 --------------------|------------------------
12 start | The `start` action starts the Icinga 2 daemon.
13 stop | The `stop` action stops the Icinga 2 daemon.
14 restart | The `restart` action is a shortcut for running the `stop` action followed by `start`.
15 reload | The `reload` action sends the `HUP` signal to Icinga 2 which causes it to restart. Unlike the `restart` action `reload` does not wait until Icinga 2 has restarted.
16 checkconfig | The `checkconfig` action checks if the `/etc/icinga2/icinga2.conf` configuration file contains any errors.
17 status | The `status` action checks if Icinga 2 is running.
19 By default the Icinga 2 daemon is running as `icinga` user and group
20 using the init script. Using Debian packages the user and group are set to `nagios`
21 for historical reasons.
23 ### <a id="cmdline"></a> Command-line Options
26 icinga2 - The Icinga 2 network monitoring daemon.
29 --help show this help message
30 -V [ --version ] show version information
31 -l [ --library ] arg load a library
32 -I [ --include ] arg add include search directory
33 -D [ --define] args define a constant
34 -c [ --config ] arg parse a configuration file
35 -C [ --validate ] exit after validating the configuration
36 -Z [ --no-validate ] skip validating the configuration
37 -x [ --debug ] enable debugging
38 -d [ --daemonize ] detach from the controlling terminal
39 -e [ --errorlog ] arg log fatal errors to the specified log file (only works
40 in combination with --daemonize)
41 -u [ --user ] arg user to run Icinga as
42 -g [ --group ] arg group to run Icinga as
44 Report bugs at <https://dev.icinga.org/>
45 Icinga home page: <http://www.icinga.org/>
49 Instead of loading libraries using the [`library` config directive](#library)
50 you can also use the `--library` command-line option.
54 [Global constants](#global-constants) can be set using the `--define` command-line option.
56 #### Config Include Path
58 When including files you can specify that the include search path should be
59 checked. You can do this by putting your configuration file name in angle
64 This would cause Icinga 2 to search its include path for the configuration file
65 `test.conf`. By default the installation path for the Icinga Template Library
66 is the only search directory.
68 Using the `--include` command-line option additional search directories can be
73 Using the `--config` option you can specify one or more configuration files.
74 Config files are processed in the order they're specified on the command-line.
76 #### Config Validation
78 The `--validate` option can be used to check if your configuration files
79 contain errors. If any errors are found the exit status is 1, otherwise 0
82 ### <a id="features"></a> Enabling/Disabling Features
84 Icinga 2 provides configuration files for some commonly used features. These
85 are installed in the `/etc/icinga2/features-available` directory and can be
86 enabled and disabled using the `icinga2-enable-feature` and `icinga2-disable-feature` tools,
89 The `icinga2-enable-feature` tool creates symlinks in the `/etc/icinga2/features-enabled`
90 directory which is included by default in the example configuration file.
92 You can view a list of available feature configuration files:
94 # icinga2-enable-feature
95 Syntax: icinga2-enable-feature <feature>
96 Enables the specified feature.
98 Available features: statusdata
100 Using the `icinga2-enable-feature` command you can enable features:
102 # icinga2-enable-feature statusdata
103 Module 'statusdata' was enabled.
104 Make sure to restart Icinga 2 for these changes to take effect.
106 You can disable features using the `icinga2-disable-feature` command:
108 # icinga2-disable-feature statusdata
109 Module 'statusdata' was disabled.
110 Make sure to restart Icinga 2 for these changes to take effect.
112 The `icinga2-enable-feature` and `icinga2-disable-feature` commands do not
113 restart Icinga 2. You will need to restart Icinga 2 using the init script
114 after enabling or disabling features.