]> granicus.if.org Git - icinga2/blob - doc/15-troubleshooting.md
Docs: Prefer the Powershell commands on Windows
[icinga2] / doc / 15-troubleshooting.md
1 # Icinga 2 Troubleshooting <a id="troubleshooting"></a>
2
3 ## Required Information <a id="troubleshooting-information-required"></a>
4
5 Please ensure to provide any detail which may help reproduce and understand your issue.
6 Whether you ask on the [community channels](https://community.icinga.com) or you
7 create an issue at [GitHub](https://github.com/Icinga), make sure
8 that others can follow your explanations. If necessary, draw a picture and attach it for
9 better illustration. This is especially helpful if you are troubleshooting a distributed
10 setup.
11
12 We've come around many community questions and compiled this list. Add your own
13 findings and details please.
14
15 * Describe the expected behavior in your own words.
16 * Describe the actual behavior in one or two sentences.
17 * Ensure to provide general information such as:
18         * How was Icinga 2 installed (and which repository in case) and which distribution are you using
19         * `icinga2 --version`
20         * `icinga2 feature list`
21         * `icinga2 daemon -C`
22         * [Icinga Web 2](https://icinga.com/products/icinga-web-2/) version (screenshot from System - About)
23         * [Icinga Web 2 modules](https://icinga.com/products/icinga-web-2-modules/) e.g. the Icinga Director (optional)
24 * Configuration insights:
25         * Provide complete configuration snippets explaining your problem in detail
26         * Your [icinga2.conf](04-configuration.md#icinga2-conf) file
27         * If you run multiple Icinga 2 instances, the [zones.conf](04-configuration.md#zones-conf) file (or `icinga2 object list --type Endpoint` and `icinga2 object list --type Zone`) from all affected nodes.
28 * Logs
29         * Relevant output from your main and [debug log](15-troubleshooting.md#troubleshooting-enable-debug-output) in `/var/log/icinga2`. Please add step-by-step explanations with timestamps if required.
30         * The newest Icinga 2 crash log if relevant, located in `/var/log/icinga2/crash`
31 * Additional details
32         * If the check command failed, what's the output of your manual plugin tests?
33         * In case of [debugging](21-development.md#development) Icinga 2, the full back traces and outputs
34
35 ## Analyze your Environment <a id="troubleshooting-analyze-environment"></a>
36
37 There are many components involved on a server running Icinga 2. When you
38 analyze a problem, keep in mind that basic system administration knowledge
39 is also key to identify bottlenecks and issues.
40
41 > **Tip**
42 >
43 > [Monitor Icinga 2](08-advanced-topics.md#monitoring-icinga) and use the hints for further analysis.
44
45 * Analyze the system's performance and dentify bottlenecks and issues.
46 * Collect details about all applications (e.g. Icinga 2, MySQL, Apache, Graphite, Elastic, etc.).
47 * If data is exchanged via network (e.g. central MySQL cluster) ensure to monitor the bandwidth capabilities too.
48 * Add graphs from Grafana or Graphite as screenshots to your issue description
49
50 Install tools which help you to do so. Opinions differ, let us know if you have any additions here!
51
52 ### Analyse your Linux/Unix Environment <a id="troubleshooting-analyze-environment-linux"></a>
53
54 [htop](https://hisham.hm/htop/) is a better replacement for `top` and helps to analyze processes
55 interactively.
56
57 ```
58 yum install htop
59 apt-get install htop
60 ```
61
62 If you are for example experiencing performance issues, open `htop` and take a screenshot.
63 Add it to your question and/or bug report.
64
65 Analyse disk I/O performance in Grafana, take a screenshot and obfuscate any sensitive details.
66 Attach it when posting a question to the community channels.
67
68 The [sysstat](https://github.com/sysstat/sysstat) package provides a number of tools to
69 analyze the performance on Linux. On FreeBSD you could use `systat` for example.
70
71 ```
72 yum install sysstat
73 apt-get install sysstat
74 ```
75
76 Example for `vmstat` (summary of memory, processes, etc.):
77
78 ```
79 // summary
80 vmstat -s
81 // print timestamps, format in MB, stats every 1 second, 5 times
82 vmstat -t -S M 1 5
83 ```
84
85 Example for `iostat`:
86
87 ```
88 watch -n 1 iostat
89 ```
90
91 Example for `sar`:
92 ```
93 sar //cpu
94 sar -r //ram
95 sar -q //load avg
96 sar -b //I/O
97 ```
98
99 `sysstat` also provides the `iostat` binary. On FreeBSD you could use `systat` for example.
100
101 If you are missing checks and metrics found in your analysis, add them to your monitoring!
102
103 ### Analyze your Windows Environment <a id="troubleshooting-analyze-environment-windows"></a>
104
105 A good tip for Windows are the tools found inside the [Sysinternals Suite](https://technet.microsoft.com/en-us/sysinternals/bb842062.aspx).
106
107 You can also start `perfmon` and analyze specific performance counters.
108 Keep notes which could be important for your monitoring, and add service
109 checks later on.
110
111 > **Tip**
112 >
113 > Use an administrative Powershell to gain more insights.
114
115 ```
116 cd C:\ProgramData\icinga2\var\log\icinga2
117
118 Get-Content .\icinga2.log -tail 10 -wait
119 ```
120
121 ## Enable Debug Output <a id="troubleshooting-enable-debug-output"></a>
122
123 ### Enable Debug Output on Linux/Unix <a id="troubleshooting-enable-debug-output-linux"></a>
124
125 Enable the `debuglog` feature:
126
127 ```
128 # icinga2 feature enable debuglog
129 # service icinga2 restart
130 ```
131
132 The debug log file can be found in `/var/log/icinga2/debug.log`.
133
134 You can tail the log files with an administrative shell:
135
136 ```
137 cd /var/log/icinga2
138 tail -f debug.log
139 ```
140
141 Alternatively you may run Icinga 2 in the foreground with debugging enabled. Specify the console
142 log severity as an additional parameter argument to `-x`.
143
144 ```
145 # /usr/sbin/icinga2 daemon -x notice
146 ```
147
148 The [log severity](09-object-types.md#objecttype-filelogger) can be one of `critical`, `warning`, `information`, `notice`
149 and `debug`.
150
151 ### Enable Debug Output on Windows <a id="troubleshooting-enable-debug-output-windows"></a>
152
153 Open a Powershell with administrative privileges and enable the debug log feature.
154
155 ```
156 C:\> cd C:\Program Files\ICINGA2\sbin
157
158 C:\Program Files\ICINGA2\sbin> .\icinga2.exe feature enable debuglog
159 ```
160
161 Ensure that the Icinga 2 service already writes the main log into `C:\ProgramData\icinga2\var\log\icinga2`.
162 Restart the Icinga 2 service in an administrative Powershell and open the newly created `debug.log` file.
163
164 ```
165 C:\> Restart-Service icinga2
166
167 C:\> Get-Service icinga2
168 ```
169
170 You can tail the log files with an administrative Powershell:
171
172 ```
173 C:\> cd C:\ProgramData\icinga2\var\log\icinga2
174
175 C:\ProgramData\icinga2\var\log\icinga2> Get-Content .\debug.log -tail 10 -wait
176 ```
177
178 ## Configuration Troubleshooting <a id="troubleshooting-configuration"></a>
179
180 ### List Configuration Objects <a id="troubleshooting-list-configuration-objects"></a>
181
182 The `icinga2 object list` CLI command can be used to list all configuration objects and their
183 attributes. The tool also shows where each of the attributes was modified.
184
185 > **Tip**
186 >
187 > Use the Icinga 2 API to access [config objects at runtime](12-icinga2-api.md#icinga2-api-config-objects) directly.
188
189 That way you can also identify which objects have been created from your [apply rules](17-language-reference.md#apply).
190
191 ```
192 # icinga2 object list
193
194 Object 'localhost!ssh' of type 'Service':
195   * __name = 'localhost!ssh'
196   * check_command = 'ssh'
197     % = modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 5:3-5:23
198   * check_interval = 60
199     % = modified in '/etc/icinga2/conf.d/templates.conf', lines 24:3-24:21
200   * host_name = 'localhost'
201     % = modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 4:3-4:25
202   * max_check_attempts = 3
203     % = modified in '/etc/icinga2/conf.d/templates.conf', lines 23:3-23:24
204   * name = 'ssh'
205   * retry_interval = 30
206     % = modified in '/etc/icinga2/conf.d/templates.conf', lines 25:3-25:22
207   * templates = [ 'ssh', 'generic-service' ]
208     % += modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 1:0-7:1
209     % += modified in '/etc/icinga2/conf.d/templates.conf', lines 22:1-26:1
210   * type = 'Service'
211   * vars
212     % += modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 6:3-6:19
213     * sla = '24x7'
214       % = modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 6:3-6:19
215
216 [...]
217 ```
218
219 On Windows, use an administrative Powershell:
220
221 ```
222 C:\> cd C:\Program Files\ICINGA2\sbin
223
224 C:\Program Files\ICINGA2\sbin> .\icinga2.exe object list
225 ```
226
227 You can also filter by name and type:
228
229 ```
230 # icinga2 object list --name *ssh* --type Service
231 Object 'localhost!ssh' of type 'Service':
232   * __name = 'localhost!ssh'
233   * check_command = 'ssh'
234     % = modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 5:3-5:23
235   * check_interval = 60
236     % = modified in '/etc/icinga2/conf.d/templates.conf', lines 24:3-24:21
237   * host_name = 'localhost'
238     % = modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 4:3-4:25
239   * max_check_attempts = 3
240     % = modified in '/etc/icinga2/conf.d/templates.conf', lines 23:3-23:24
241   * name = 'ssh'
242   * retry_interval = 30
243     % = modified in '/etc/icinga2/conf.d/templates.conf', lines 25:3-25:22
244   * templates = [ 'ssh', 'generic-service' ]
245     % += modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 1:0-7:1
246     % += modified in '/etc/icinga2/conf.d/templates.conf', lines 22:1-26:1
247   * type = 'Service'
248   * vars
249     % += modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 6:3-6:19
250     * sla = '24x7'
251       % = modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 6:3-6:19
252
253 Found 1 Service objects.
254
255 [2014-10-15 14:27:19 +0200] information/cli: Parsed 175 objects.
256 ```
257
258 Runtime modifications via the [REST API](12-icinga2-api.md#icinga2-api-config-objects)
259 are not immediately updated. Furthermore there is a known issue with
260 [group assign expressions](17-language-reference.md#group-assign) which are not reflected in the host object output.
261 You need to restart Icinga 2 in order to update the `icinga2.debug` cache file.
262
263 ### Apply rules do not match <a id="apply-rules-do-not-match"></a>
264
265 You can analyze apply rules and matching objects by using the [script debugger](20-script-debugger.md#script-debugger).
266
267 ### Where are the check command definitions? <a id="check-command-definitions"></a>
268
269 Icinga 2 features a number of built-in [check command definitions](10-icinga-template-library.md#icinga-template-library) which are
270 included with
271
272 ```
273 include <itl>
274 include <plugins>
275 ```
276
277 in the [icinga2.conf](04-configuration.md#icinga2-conf) configuration file. These files are not considered
278 configuration files and will be overridden on upgrade, so please send modifications as proposed patches upstream.
279 The default include path is set to `/usr/share/icinga2/includes` with the constant `IncludeConfDir`.
280
281 You should add your own command definitions to a new file in `conf.d/` called `commands.conf`
282 or similar.
283
284 ### Configuration is ignored <a id="configuration-ignored"></a>
285
286 * Make sure that the line(s) are not [commented out](17-language-reference.md#comments) (starting with `//` or `#`, or
287 encapsulated by `/* ... */`).
288 * Is the configuration file included in [icinga2.conf](04-configuration.md#icinga2-conf)?
289
290 Run the [configuration validation](11-cli-commands.md#config-validation) and add `notice` as log severity.
291 Search for the file which should be included i.e. using the `grep` CLI command.
292
293 ```
294 # icinga2 daemon -C -x notice | grep command
295 ```
296
297 ### Configuration attributes are inherited from <a id="configuration-attribute-inheritance"></a>
298
299 Icinga 2 allows you to import templates using the [import](17-language-reference.md#template-imports) keyword. If these templates
300 contain additional attributes, your objects will automatically inherit them. You can override
301 or modify these attributes in the current object.
302
303 The [object list](15-troubleshooting.md#troubleshooting-list-configuration-objects) CLI command allows you to verify the attribute origin.
304
305 ### Configuration Value with Single Dollar Sign <a id="configuration-value-dollar-sign"></a>
306
307 In case your configuration validation fails with a missing closing dollar sign error message, you
308 did not properly escape the single dollar sign preventing its usage as [runtime macro](03-monitoring-basics.md#runtime-macros).
309
310 ```
311 critical/config: Error: Validation failed for Object 'ping4' (Type: 'Service') at /etc/icinga2/zones.d/global-templates/windows.conf:24: Closing $ not found in macro format string 'top-syntax=${list}'.
312 ```
313
314 Correct the custom variable value to
315
316 ```
317 "top-syntax=$${list}"
318 ```
319
320
321 ## Checks Troubleshooting <a id="troubleshooting-checks"></a>
322
323 ### Executed Command for Checks <a id="checks-executed-command"></a>
324
325 * Use the Icinga 2 API to [query](12-icinga2-api.md#icinga2-api-config-objects-query) host/service objects
326 for their check result containing the executed shell command.
327 * Use the Icinga 2 [console cli command](11-cli-commands.md#cli-command-console)
328 to fetch the checkable object, its check result and the executed shell command.
329 * Alternatively enable the [debug log](15-troubleshooting.md#troubleshooting-enable-debug-output) and look for the executed command.
330
331 Example for a service object query using a [regex match](18-library-reference.md#global-functions-regex)
332 on the name:
333
334 ```
335 $ curl -k -s -u root:icinga -H 'Accept: application/json' -H 'X-HTTP-Method-Override: GET' -X POST 'https://localhost:5665/v1/objects/services' \
336 -d '{ "filter": "regex(pattern, service.name)", "filter_vars": { "pattern": "^http" }, "attrs": [ "__name", "last_check_result" ], "pretty": true }'
337 {
338     "results": [
339         {
340             "attrs": {
341                 "__name": "example.localdomain!http",
342                 "last_check_result": {
343                     "active": true,
344                     "check_source": "example.localdomain",
345                     "command": [
346                         "/usr/local/sbin/check_http",
347                         "-I",
348                         "127.0.0.1",
349                         "-u",
350                         "/"
351                     ],
352
353   ...
354
355                 }
356             },
357             "joins": {},
358             "meta": {},
359             "name": "example.localdomain!http",
360             "type": "Service"
361         }
362     ]
363 }
364 ```
365
366 Alternatively when using the Director, navigate into the Service Detail View
367 in Icinga Web and pick `Inspect` to query the details.
368
369 Example for using the `icinga2 console` CLI command evaluation functionality:
370
371 ```
372 $ ICINGA2_API_PASSWORD=icinga icinga2 console --connect 'https://root@localhost:5665/' \
373 --eval 'get_service("example.localdomain", "http").last_check_result.command' | python -m json.tool
374 [
375     "/usr/local/sbin/check_http",
376     "-I",
377     "127.0.0.1",
378     "-u",
379     "/"
380 ]
381 ```
382
383 Example for searching the debug log:
384
385 ```
386 # icinga2 feature enable debuglog
387 # systemctl restart icinga2
388 # tail -f /var/log/icinga2/debug.log | grep "notice/Process"
389 ```
390
391
392 ### Checks are not executed <a id="checks-not-executed"></a>
393
394 * First off, decide whether the checks are executed locally, or remote in a distributed setup.
395
396 If the master does not receive check results from the satellite, move your analysis to the satellite
397 and verify why the checks are not executed there.
398
399 * Check the [debug log](15-troubleshooting.md#troubleshooting-enable-debug-output) to see if the check command gets executed.
400 * Verify that failed dependencies do not prevent command execution.
401 * Make sure that the plugin is executable by the Icinga 2 user (run a manual test).
402 * Make sure the [checker](11-cli-commands.md#enable-features) feature is enabled.
403 * Use the Icinga 2 API [event streams](12-icinga2-api.md#icinga2-api-event-streams) to receive live check result streams.
404
405 Test a plugin as icinga user.
406
407 ```
408 # sudo -u icinga /usr/lib/nagios/plugins/check_ping -4 -H 127.0.0.1 -c 5000,100% -w 3000,80%
409 ```
410
411 > **Note**
412 >
413 > **Never test plugins as root, but the icinga daemon user.** The environment and permissions differ.
414 >
415 > Also, the daemon user **does not** spawn a terminal shell (Bash, etc.) so it won't read anything from .bashrc
416 > and variants. The Icinga daemon only relies on sysconfig environment variables being set.
417
418
419 Enable the checker feature.
420
421 ```
422 # icinga2 feature enable checker
423 The feature 'checker' is already enabled.
424 ```
425
426 Fetch all check result events matching the `event.service` name `random`:
427
428 ```
429 $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST \
430  'https://localhost:5665/v1/events?queue=debugchecks&types=CheckResult&filter=match%28%22random*%22,event.service%29'
431 ```
432
433
434 ### Analyze Check Source <a id="checks-check-source"></a>
435
436 Sometimes checks are not executed on the remote host, but on the master and so on.
437 This could lead into unwanted results or NOT-OK states.
438
439 The `check_source` attribute is the best indication where a check command
440 was actually executed. This could be a satellite with synced configuration
441 or a client as remote command bridge -- both will return the check source
442 as where the plugin is called.
443
444 Example for retrieving the check source from all `disk` services using a
445 [regex match](18-library-reference.md#global-functions-regex) on the name:
446
447 ```
448 $ curl -k -s -u root:icinga -H 'Accept: application/json' -H 'X-HTTP-Method-Override: GET' -X POST 'https://localhost:5665/v1/objects/services' \
449 -d '{ "filter": "regex(pattern, service.name)", "filter_vars": { "pattern": "^disk" }, "attrs": [ "__name", "last_check_result" ], "pretty": true }'
450 {
451     "results": [
452         {
453             "attrs": {
454                 "__name": "icinga2-agent1.localdomain!disk",
455                 "last_check_result": {
456                     "active": true,
457                     "check_source": "icinga2-agent1.localdomain",
458
459   ...
460
461                 }
462             },
463             "joins": {},
464             "meta": {},
465             "name": "icinga2-agent1.localdomain!disk",
466             "type": "Service"
467         }
468     ]
469 }
470 ```
471
472 Alternatively when using the Director, navigate into the Service Detail View
473 in Icinga Web and pick `Inspect` to query the details.
474
475 Example with the debug console:
476
477 ```
478 $ ICINGA2_API_PASSWORD=icinga icinga2 console --connect 'https://root@localhost:5665/' \
479 --eval 'get_service("icinga2-agent1.localdomain", "disk").last_check_result.check_source' | python -m json.tool
480
481 "icinga2-agent1.localdomain"
482 ```
483
484
485 ### NSClient++ Check Errors with nscp-local <a id="nsclient-check-errors-nscp-local"></a>
486
487 The [nscp-local](10-icinga-template-library.md#nscp-check-local) CheckCommand object definitions call the local `nscp.exe` command.
488 If a Windows client service check fails to find the `nscp.exe` command, the log output would look like this:
489
490 ```
491 Command ".\nscp.exe" "client" "-a" "drive=d" "-a" "show-all" "-b" "-q" "check_drivesize" failed to execute: 2, "The system cannot find the file specified."
492 ```
493
494 or
495
496 ```
497 Command ".
498 scp.exe" "client" "-a" "drive=d" "-a" "show-all" "-b" "-q" "check_drivesize" failed to execute: 2, "The system cannot find the file specified."
499 ```
500
501 The above actually prints `.\\nscp.exe` where the escaped `\n` character gets interpreted as new line.
502
503 Both errors lead to the assumption that the `NscpPath` constant is empty or set to a `.` character.
504 This could mean the following:
505
506 * The command is **not executed on the Windows client**. Check the [check_source](15-troubleshooting.md#checks-check-source) attribute from the check result.
507 * You are using an outdated NSClient++ version (0.3.x or 0.4.x) which is not compatible with Icinga 2.
508 * You are using a custom NSClient++ installer which does not register the correct GUID for NSClient++
509
510 More troubleshooting:
511
512 Retrieve the `NscpPath` constant on your Windows client:
513
514 ```
515 C:\Program Files\ICINGA2\sbin\icinga2.exe variable get NscpPath
516 ```
517
518 If the variable is returned empty, manually test how Icinga 2 would resolve
519 its path (this can be found inside the ITL):
520
521 ```
522 C:\Program Files\ICINGA2\sbin\icinga2.exe console --eval "dirname(msi_get_component_path(\"{5C45463A-4AE9-4325-96DB-6E239C034F93}\"))"
523 ```
524
525 If this command does not return anything, NSClient++ is not properly installed.
526 Verify that inside the `Programs and Features` (`appwiz.cpl`) control panel.
527
528 You can run the bundled NSClient++ installer from the Icinga 2 Windows package.
529 The msi package is located in `C:\Program Files\ICINGA2\sbin`.
530
531 The bundled NSClient++ version has properly been tested with Icinga 2. Keep that
532 in mind when using a different package.
533
534
535 ### Check Thresholds Not Applied <a id="check-thresholds-not-applied"></a>
536
537 This could happen with [clients as command endpoint execution](06-distributed-monitoring.md#distributed-monitoring-top-down-command-endpoint).
538
539 If you have for example a client host `icinga2-agent1.localdomain`
540 and a service `disk` check defined on the master, the warning and
541 critical thresholds are sometimes to applied and unwanted notification
542 alerts are raised.
543
544 This happens because the client itself includes a host object with
545 its `NodeName` and a basic set of checks in the [conf.d](04-configuration.md#conf-d)
546 directory, i.e. `disk` with the default thresholds.
547
548 Clients which have the `checker` feature enabled will attempt
549 to execute checks for local services and send their results
550 back to the master.
551
552 If you now have the same host and service objects on the
553 master you will receive wrong check results from the client.
554
555 Solution:
556
557 * Disable the `checker` feature on clients: `icinga2 feature disable checker`.
558 * Remove the inclusion of [conf.d](04-configuration.md#conf-d) as suggested in the [client setup docs](06-distributed-monitoring.md#distributed-monitoring-top-down-command-endpoint).
559
560 ### Check Fork Errors <a id="check-fork-errors"></a>
561
562 Newer versions of systemd on Linux limit spawned processes for
563 services.
564
565 * v227 introduces the `TasksMax` setting to units which allows to specify the spawned process limit.
566 * v228 adds `DefaultTasksMax` in the global `systemd-system.conf` with a default setting of 512 processes.
567 * v231 changes the default value to 15%
568
569 This can cause problems with Icinga 2 in large environments with many
570 commands executed in parallel starting with systemd v228. Some distributions
571 also may have changed the defaults.
572
573 The error message could look like this:
574
575 ```
576 2017-01-12T11:55:40.742685+01:00 icinga2-master1 kernel: [65567.582895] cgroup: fork rejected by pids controller in /system.slice/icinga2.service
577 ```
578
579 In order to solve the problem, increase the value for `DefaultTasksMax`
580 or set it to `infinity`.
581
582 ```
583 mkdir /etc/systemd/system/icinga2.service.d
584 cat >/etc/systemd/system/icinga2.service.d/limits.conf <<EOF
585 [Service]
586 DefaultTasksMax=infinity
587 EOF
588
589 systemctl daemon-reload
590 systemctl restart icinga2
591 ```
592
593 An example is available inside the GitHub repository in [etc/initsystem](https://github.com/Icinga/icinga2/tree/master/etc/initsystem).
594
595 External Resources:
596
597 * [Fork limit for cgroups](https://lwn.net/Articles/663873/)
598 * [systemd changelog](https://github.com/systemd/systemd/blob/master/NEWS)
599 * [Icinga 2 upstream issue](https://github.com/Icinga/icinga2/issues/5611)
600 * [systemd upstream discussion](https://github.com/systemd/systemd/issues/3211)
601
602 ### Systemd Watchdog <a id="check-systemd-watchdog"></a>
603
604 Usually Icinga 2 is a mission critical part of infrastructure and should be
605 online at all times. In case of a recoverable crash (e.g. OOM) you may want to
606 restart Icinga 2 automatically. With systemd it is as easy as overriding some
607 settings of the Icinga 2 systemd service by creating
608 `/etc/systemd/system/icinga2.service.d/override.conf` with the following
609 content:
610
611 ```
612 [Service]
613 Restart=always
614 RestartSec=1
615 StartLimitInterval=10
616 StartLimitBurst=3
617 ```
618
619 Using the watchdog can also help with monitoring Icinga 2, to activate and use it add the following to the override:
620
621 ```
622 WatchdogSec=30s
623 ```
624
625 This way systemd will kill Icinga 2 if does not notify for over 30 seconds, a timout of less than 10 seconds is not
626 recommended. When the watchdog is activated, `Restart=` can be set to `watchdog` to restart Icinga 2 in the case of a
627 watchdog timeout.
628
629 Run `systemctl daemon-reload && systemctl restart icinga2` to apply the changes.
630 Now systemd will always try to restart Icinga 2 (except if you run
631 `systemctl stop icinga2`). After three failures in ten seconds it will stop
632 trying because you probably have a problem that requires manual intervention.
633
634 ### Late Check Results <a id="late-check-results"></a>
635
636 [Icinga Web 2](https://icinga.com/products/icinga-web-2/) provides
637 a dashboard overview for `overdue checks`.
638
639 The REST API provides the [status](12-icinga2-api.md#icinga2-api-status) URL endpoint with some generic metrics
640 on Icinga and its features.
641
642 ```
643 # curl -k -s -u root:icinga 'https://localhost:5665/v1/status?pretty=1' | less
644 ```
645
646 You can also calculate late check results via the REST API:
647
648 * Fetch the `last_check` timestamp from each object
649 * Compare the timestamp with the current time and add `check_interval` multiple times (change it to see which results are really late, like five times check_interval)
650
651 You can use the [icinga2 console](11-cli-commands.md#cli-command-console) to connect to the instance, fetch all data
652 and calculate the differences. More infos can be found in [this blogpost](https://icinga.com/2016/08/11/analyse-icinga-2-problems-using-the-console-api/).
653
654 ```
655 # ICINGA2_API_USERNAME=root ICINGA2_API_PASSWORD=icinga icinga2 console --connect 'https://localhost:5665/'
656
657 <1> => var res = []; for (s in get_objects(Service).filter(s => s.last_check < get_time() - 2 * s.check_interval)) { res.add([s.__name, DateTime(s.last_check).to_string()]) }; res
658
659 [ [ "10807-host!10807-service", "2016-06-10 15:54:55 +0200" ], [ "mbmif.int.netways.de!disk /", "2016-01-26 16:32:29 +0100" ] ]
660 ```
661
662 Or if you are just interested in numbers, call [len](18-library-reference.md#array-len) on the result array `res`:
663
664 ```
665 <2> => var res = []; for (s in get_objects(Service).filter(s => s.last_check < get_time() - 2 * s.check_interval)) { res.add([s.__name, DateTime(s.last_check).to_string()]) }; res.len()
666
667 2.000000
668 ```
669
670 If you need to analyze that problem multiple times, just add the current formatted timestamp
671 and repeat the commands.
672
673 ```
674 <23> => DateTime(get_time()).to_string()
675
676 "2017-04-04 16:09:39 +0200"
677
678 <24> => var res = []; for (s in get_objects(Service).filter(s => s.last_check < get_time() - 2 * s.check_interval)) { res.add([s.__name, DateTime(s.last_check).to_string()]) }; res.len()
679
680 8287.000000
681 ```
682
683 More details about the Icinga 2 DSL and its possibilities can be
684 found in the [language](17-language-reference.md#language-reference) and [library](18-library-reference.md#library-reference) reference chapters.
685
686 ### Late Check Results in Distributed Environments <a id="late-check-results-distributed"></a>
687
688 When it comes to a distributed HA setup, each node is responsible for a load-balanced amount of checks.
689 Host and Service objects provide the attribute `paused`. If this is set to `false`, the current node
690 actively attempts to schedule and execute checks. Otherwise the node does not feel responsible.
691
692 ```
693 <3> => var res = {}; for (s in get_objects(Service).filter(s => s.last_check < get_time() - 2 * s.check_interval)) { res[s.paused] += 1 }; res
694 {
695   @false = 2.000000
696   @true = 1.000000
697 }
698 ```
699
700 You may ask why this analysis is important? Fair enough - if the numbers are not inverted in a HA zone
701 with two members, this may give a hint that the cluster nodes are in a split-brain scenario, or you've
702 found a bug in the cluster.
703
704
705 If you are running a cluster setup where the master/satellite executes checks on the client via
706 [top down command endpoint](06-distributed-monitoring.md#distributed-monitoring-top-down-command-endpoint) mode,
707 you might want to know which zones are affected.
708
709 This analysis assumes that clients which are not connected, have the string `connected` in their
710 service check result output and their state is `UNKNOWN`.
711
712 ```
713 <4> => var res = {}; for (s in get_objects(Service)) { if (s.state==3) { if (match("*connected*", s.last_check_result.output)) { res[s.zone] += [s.host_name] } } };  for (k => v in res) { res[k] = len(v.unique()) }; res
714
715 {
716   Asia = 31.000000
717   Europe = 214.000000
718   USA = 207.000000
719 }
720 ```
721
722 The result set shows the configured zones and their affected hosts in a unique list. The output also just prints the numbers
723 but you can adjust this by omitting the `len()` call inside the for loop.
724
725 ## Notifications Troubleshooting <a id="troubleshooting-notifications"></a>
726
727 ### Notifications are not sent <a id="troubleshooting-notifications-not-sent"></a>
728
729 * Check the [debug log](15-troubleshooting.md#troubleshooting-enable-debug-output) to see if a notification is triggered.
730 * If yes, verify that all conditions are satisfied.
731 * Are any errors on the notification command execution logged?
732
733 Please ensure to add these details with your own description
734 to any question or issue posted to the community channels.
735
736 Verify the following configuration:
737
738 * Is the host/service `enable_notifications` attribute set, and if so, to which value?
739 * Do the [notification](09-object-types.md#objecttype-notification) attributes `states`, `types`, `period` match the notification conditions?
740 * Do the [user](09-object-types.md#objecttype-user) attributes `states`, `types`, `period` match the notification conditions?
741 * Are there any notification `begin` and `end` times configured?
742 * Make sure the [notification](11-cli-commands.md#enable-features) feature is enabled.
743 * Does the referenced NotificationCommand work when executed as Icinga user on the shell?
744
745 If notifications are to be sent via mail, make sure that the mail program specified inside the
746 [NotificationCommand object](09-object-types.md#objecttype-notificationcommand) exists.
747 The name and location depends on the distribution so the preconfigured setting might have to be
748 changed on your system.
749
750
751 Examples:
752
753 ```
754 # icinga2 feature enable notification
755 The feature 'notification' is already enabled.
756 ```
757
758 ```
759 # icinga2 feature enable debuglog
760 # systemctl restart icinga2
761
762 # grep Notification /var/log/icinga2/debug.log > /root/analyze_notification_problem.log
763 ```
764
765 You can use the Icinga 2 API [event streams](12-icinga2-api.md#icinga2-api-event-streams) to receive live notification streams:
766
767 ```
768 $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/events?queue=debugnotifications&types=Notification'
769 ```
770
771
772 ### Analyze Notification Result <a id="troubleshooting-notifications-result"></a>
773
774 > **Note**
775 >
776 > This feature is available since v2.11 and requires all endpoints
777 > being updated.
778
779 Notifications inside a HA enabled zone are balanced between the endpoints,
780 just like checks.
781
782 Sometimes notifications may fail, and with looking into the (debug) logs
783 for both masters, you cannot correlate this correctly.
784
785 The `last_notification_result` runtime attribute is stored and synced for Notification
786 objects and can be queried via REST API.
787
788 Example for retrieving the notification object and result from all `disk` services using a
789 [regex match](18-library-reference.md#global-functions-regex) on the name:
790
791 ```
792 $ curl -k -s -u root:icinga -H 'Accept: application/json' -H 'X-HTTP-Method-Override: GET' -X POST 'https://localhost:5665/v1/objects/notifications' \
793 -d '{ "filter": "regex(pattern, service.name)", "filter_vars": { "pattern": "^disk" }, "attrs": [ "__name", "last_notification_result" ], "pretty": true }'
794 {
795     "results": [
796
797         {
798             "attrs": {
799                 "last_notification_result": {
800                     "active": true,
801                     "command": [
802                         "/etc/icinga2/scripts/mail-service-notification.sh",
803                         "-4",
804                         "",
805                         "-6",
806                         "",
807                         "-b",
808                         "",
809                         "-c",
810                         "",
811                         "-d",
812                         "2019-08-02 10:54:16 +0200",
813                         "-e",
814                         "disk",
815                         "-l",
816                         "icinga2-agent1.localdomain",
817                         "-n",
818                         "icinga2-agent1.localdomain",
819                         "-o",
820                         "DISK OK - free space: / 38108 MB (90.84% inode=100%);",
821                         "-r",
822                         "user@localdomain",
823                         "-s",
824                         "OK",
825                         "-t",
826                         "RECOVERY",
827                         "-u",
828                         "disk"
829                     ],
830                     "execution_end": 1564736056.186217,
831                     "execution_endpoint": "icinga2-master1.localdomain",
832                     "execution_start": 1564736056.132323,
833                     "exit_status": 0.0,
834                     "output": "",
835                     "type": "NotificationResult"
836                 }
837             },
838             "joins": {},
839             "meta": {},
840             "name": "icinga2-agent1.localdomain!disk!mail-service-notification",
841             "type": "Notification"
842         }
843
844 ...
845
846     ]
847 }
848 ```
849
850 Example with the debug console:
851
852 ```
853 $ ICINGA2_API_PASSWORD=icinga icinga2 console --connect 'https://root@localhost:5665/' --eval 'get_object(Notification, "icinga2-agent1.localdomain!disk!mail-service-notification").last_notification_result.execution_endpoint' | jq
854
855 "icinga2-agent1.localdomain"
856 ```
857
858 Whenever a notification command failed to execute, you can fetch the output as well. 
859
860
861 ## Feature Troubleshooting <a id="troubleshooting-features"></a>
862
863 ### Feature is not working <a id="feature-not-working"></a>
864
865 * Make sure that the feature configuration is enabled by symlinking from `features-available/`
866 to `features-enabled` and that the latter is included in [icinga2.conf](04-configuration.md#icinga2-conf).
867 * Are the feature attributes set correctly according to the documentation?
868 * Any errors on the logs?
869
870 Look up the [object type](09-object-types.md#object-types) for the required feature and verify it is enabled:
871
872 ```
873 # icinga2 object list --type <feature object type>
874 ```
875
876 Example for the `graphite` feature:
877
878 ```
879 # icinga2 object list --type GraphiteWriter
880 ```
881
882 Look into the log and check whether the feature logs anything specific for this matter.
883
884 ```
885 grep GraphiteWriter /var/log/icinga2/icinga2.log
886 ```
887
888 ## REST API Troubleshooting <a id="troubleshooting-api"></a>
889
890 In order to analyse errors on API requests, you can explicitly enable the [verbose parameter](12-icinga2-api.md#icinga2-api-parameters-global).
891
892 ```
893 $ curl -k -s -u root:icinga -H 'Accept: application/json' -X DELETE 'https://localhost:5665/v1/objects/hosts/example-cmdb?pretty=1&verbose=1'
894 {
895     "diagnostic_information": "Error: Object does not exist.\n\n ....",
896     "error": 404.0,
897     "status": "No objects found."
898 }
899 ```
900
901 ### REST API Troubleshooting: No Objects Found <a id="troubleshooting-api-no-objects-found"></a>
902
903 Please note that the `404` status with no objects being found can also originate
904 from missing or too strict object permissions for the authenticated user.
905
906 This is a security feature to disable object name guessing. If this would not be the
907 case, restricted users would be able to get a list of names of your objects just by
908 trying every character combination.
909
910 In order to analyse and fix the problem, please check the following:
911
912 - use an administrative account with full permissions to check whether the objects are actually there.
913 - verify the permissions on the affected ApiUser object and fix them.
914
915 ### Missing Runtime Objects (Hosts, Downtimes, etc.) <a id="troubleshooting-api-missing-runtime-objects"></a>
916
917 Runtime objects consume the internal config packages shared with
918 the REST API config packages. Each host, downtime, comment, service, etc. created
919 via the REST API is stored in the `_api` package.
920
921 This includes downtimes and comments, which where sometimes stored in the wrong
922 directory path, because the active-stage file was empty/truncated/unreadable at
923 this point.
924
925 Wrong:
926
927 ```
928 /var/lib/icinga2/api/packages/_api//conf.d/downtimes/1234-5678-9012-3456.conf
929 ```
930
931 Correct:
932
933 ```
934 /var/lib/icinga2/api/packages/_api/dbe0bef8-c72c-4cc9-9779-da7c4527c5b2/conf.d/downtimes/1234-5678-9012-3456.conf
935 ```
936
937 At creation time, the object lives in memory but its storage is broken. Upon restart,
938 it is missing and e.g. a missing downtime will re-enable unwanted notifications.
939
940 `abcd-ef12-3456-7890` is the active stage name which wasn't correctly
941 read by the Icinga daemon. This information is stored in `/var/lib/icinga2/api/packages/_api/active-stage`.
942
943 2.11 now limits the direct active-stage file access (this is hidden from the user),
944 and caches active stages for packages in-memory.
945
946 It also tries to repair the broken package, and logs a new message:
947
948 ```
949 systemctl restart icinga2
950
951 tail -f /var/log/icinga2/icinga2.log
952
953 [2019-05-10 12:27:15 +0200] information/ConfigObjectUtility: Repairing config package '_api' with stage 'dbe0bef8-c72c-4cc9-9779-da7c4527c5b2'.
954 ```
955
956 If this does not happen, you can manually fix the broken config package, and mark a deployed stage as active
957 again, carefully do the following steps with creating a backup before:
958
959 Navigate into the API package prefix.
960
961 ```
962 cd /var/lib/icinga2/api/packages
963 ```
964
965 Change into the broken package directory and list all directories and files
966 ordered by latest changes.
967
968 ```
969 cd _api
970 ls -lahtr
971
972 drwx------  4 michi  wheel   128B Mar 27 14:39 ..
973 -rw-r--r--  1 michi  wheel    25B Mar 27 14:39 include.conf
974 -rw-r--r--  1 michi  wheel   405B Mar 27 14:39 active.conf
975 drwx------  7 michi  wheel   224B Mar 27 15:01 dbe0bef8-c72c-4cc9-9779-da7c4527c5b2
976 drwx------  5 michi  wheel   160B Apr 26 12:47 .
977 ```
978
979 As you can see, the `active-stage` file is missing. When it is there, verify that its content
980 is set to the stage directory as follows.
981
982 If you have more than one stage directory here, pick the latest modified
983 directory. Copy the directory name `abcd-ef12-3456-7890` and
984 add it into a new file `active-stage`. This can be done like this:
985
986 ```
987 echo "dbe0bef8-c72c-4cc9-9779-da7c4527c5b2" > active-stage
988 ```
989
990 `active.conf` needs to have the correct active stage too, add it again
991 like this. Note: This is deep down in the code, use with care!
992
993 ```
994 sed -i 's/ActiveStages\["_api"\] = .*/ActiveStages\["_api"\] = "dbe0bef8-c72c-4cc9-9779-da7c4527c5b2"/g' /var/lib/icinga2/api/packages/_api/active.conf
995 ```
996
997 Restart Icinga 2.
998
999 ```
1000 systemctl restart icinga2
1001 ```
1002
1003
1004 > **Note**
1005 >
1006 > The internal `_api` config package structure may change in the future. Do not modify
1007 > things in there manually or with scripts unless guided here or asked by a developer.
1008
1009
1010 ## Certificate Troubleshooting <a id="troubleshooting-certificate"></a>
1011
1012 Tools for analysing certificates and TLS connections:
1013
1014 - `openssl` binary on Linux/Unix, `openssl.exe` on Windows ([download](https://slproweb.com/products/Win32OpenSSL.html))
1015 - `sslscan` tool, available [here](https://github.com/rbsec/sslscan) (Linux/Windows)
1016
1017 Note: You can also execute sslscan on Windows using Powershell.
1018
1019
1020 ### Certificate Verification <a id="troubleshooting-certificate-verification"></a>
1021
1022 Whenever the TLS handshake fails when a client connects to the cluster or the REST API,
1023 ensure to verify the used certificates.
1024
1025 Print the CA and client certificate and ensure that the following attributes are set:
1026
1027 * Version must be 3.
1028 * Serial number is a hex-encoded string.
1029 * Issuer should be your certificate authority (defaults to `Icinga CA` for all certificates generated by CLI commands and automated signing requests).
1030 * Validity: The certificate must not be expired.
1031 * Subject with the common name (CN) matches the client endpoint name and its FQDN.
1032 * v3 extensions must set the basic constraint for `CA:TRUE` (ca.crt) or `CA:FALSE` (client certificate).
1033 * Subject Alternative Name is set to the resolvable DNS name (required for REST API and browsers).
1034
1035
1036 Navigate into the local certificate store:
1037
1038 ```
1039 $ cd /var/lib/icinga2/certs/
1040 ```
1041
1042 Print the CA certificate:
1043
1044 ```
1045 $ openssl x509 -in ca.crt -text
1046
1047 Certificate:
1048     Data:
1049         Version: 3 (0x2)
1050         Serial Number: 1 (0x1)
1051     Signature Algorithm: sha256WithRSAEncryption
1052         Issuer: CN=Icinga CA
1053         Validity
1054             Not Before: Feb 23 14:45:32 2016 GMT
1055             Not After : Feb 19 14:45:32 2031 GMT
1056         Subject: CN=Icinga CA
1057         Subject Public Key Info:
1058             Public Key Algorithm: rsaEncryption
1059                 Public-Key: (4096 bit)
1060                 Modulus:
1061 ...
1062                 Exponent: 65537 (0x10001)
1063         X509v3 extensions:
1064             X509v3 Basic Constraints: critical
1065                 CA:TRUE
1066     Signature Algorithm: sha256WithRSAEncryption
1067 ...
1068 ```
1069
1070 Print the client public certificate:
1071
1072 ```
1073 $ openssl x509 -in icinga2-agent1.localdomain.crt -text
1074
1075 Certificate:
1076     Data:
1077         Version: 3 (0x2)
1078         Serial Number:
1079             86:47:44:65:49:c6:65:6b:5e:6d:4f:a5:fe:6c:76:05:0b:1a:cf:34
1080     Signature Algorithm: sha256WithRSAEncryption
1081         Issuer: CN=Icinga CA
1082         Validity
1083             Not Before: Aug 20 16:20:05 2016 GMT
1084             Not After : Aug 17 16:20:05 2031 GMT
1085         Subject: CN=icinga2-agent1.localdomain
1086         Subject Public Key Info:
1087             Public Key Algorithm: rsaEncryption
1088                 Public-Key: (4096 bit)
1089                 Modulus:
1090 ...
1091                 Exponent: 65537 (0x10001)
1092         X509v3 extensions:
1093             X509v3 Basic Constraints: critical
1094                 CA:FALSE
1095             X509v3 Subject Alternative Name:
1096                 DNS:icinga2-agent1.localdomain
1097     Signature Algorithm: sha256WithRSAEncryption
1098 ...
1099 ```
1100
1101 Make sure to verify the client's certificate and its received `ca.crt` in `/var/lib/icinga2/certs` and ensure that
1102 both instances are signed by the **same CA**.
1103
1104 ```
1105 $ openssl verify -verbose -CAfile /var/lib/icinga2/certs/ca.crt /var/lib/icinga2/certs/icinga2-master1.localdomain.crt
1106
1107 icinga2-master1.localdomain.crt: OK
1108 ```
1109
1110 ```
1111 $ openssl verify -verbose -CAfile /var/lib/icinga2/certs/ca.crt /var/lib/icinga2/certs/icinga2-agent1.localdomain.crt
1112
1113 icinga2-agent1.localdomain.crt: OK
1114 ```
1115
1116 Fetch the `ca.crt` file from the client node and compare it to your master's `ca.crt` file:
1117
1118 ```
1119 $ scp icinga2-agent1:/var/lib/icinga2/certs/ca.crt test-client-ca.crt
1120 $ diff -ur /var/lib/icinga2/certs/ca.crt test-client-ca.crt
1121 ```
1122
1123 ### Certificate Signing <a id="troubleshooting-certificate-signing"></a>
1124
1125 Icinga offers two methods:
1126
1127 * [CSR Auto-Signing](06-distributed-monitoring.md#distributed-monitoring-setup-csr-auto-signing) which uses a client (an agent or a satellite) ticket generated on the master as trust identifier.
1128 * [On-Demand CSR Signing](06-distributed-monitoring.md#distributed-monitoring-setup-on-demand-csr-signing) which allows to sign pending certificate requests on the master.
1129
1130 Whenever a signed certificate is not received on the requesting clients, ensure to check the following:
1131
1132 * The ticket was valid and the master's log shows nothing different (CSR Auto-Signing only)
1133 * If the agent/satellite is directly connected to the CA master, check whether the master actually has performance problems to process the request. If the connection is closed without certificate response, analyse the master's health. It is also advised to upgrade to v2.11 where network stack problems have been fixed.
1134 * If you're using a 3+ level cluster, check whether the satellite really forwarded the CSR signing request and the master processed it.
1135
1136 Other common errors:
1137
1138 * The generated ticket is invalid. The client receives this error message, as well as the master logs a warning message.
1139 * The [api](09-object-types.md#objecttype-apilistener) feature does not have the `ticket_salt` attribute set to the generated `TicketSalt` constant by the CLI wizards.
1140
1141 In case you are using On-Demand CSR Signing, `icinga2 ca list` on the master only lists
1142 pending requests since v2.11. Add `--all` to also see signed requests. Keep in mind that
1143 old requests are purged after 1 week automatically.
1144
1145
1146 ### TLS Handshake: Ciphers <a id="troubleshooting-certificate-handshake-ciphers"></a>
1147
1148 Starting with v2.11, the default configured ciphers have been hardened to modern
1149 standards. This includes TLS v1.2 as minimum protocol version too.
1150
1151 In case the TLS handshake fails with `no shared cipher`, first analyse whether both
1152 instances support the same ciphers.
1153
1154 #### Client connects to Server <a id="troubleshooting-certificate-handshake-ciphers-client"></a>
1155
1156 Connect using `openssl s_client` and try to reproduce the connection problem.
1157
1158 > **Important**
1159 >
1160 > The endpoint with the server role **accepting** the connection picks the preferred
1161 > cipher. E.g. when a satellite connects to the master, the master chooses the cipher.
1162 >
1163 > Keep this in mind where to simulate the client role connecting to a server with
1164 > CLI tools such as `openssl s_client`.
1165
1166
1167 `openssl s_client` tells you about the supported and shared cipher suites
1168 on the remote server. `openssl ciphers` lists locally available ciphers.
1169
1170 ```
1171 $ openssl s_client -connect 192.168.33.5:5665
1172 ...
1173
1174 ---
1175 SSL handshake has read 2899 bytes and written 786 bytes
1176 ---
1177 New, TLSv1/SSLv3, Cipher is AES256-GCM-SHA384
1178 Server public key is 4096 bit
1179 Secure Renegotiation IS supported
1180 Compression: NONE
1181 Expansion: NONE
1182 No ALPN negotiated
1183 SSL-Session:
1184     Protocol  : TLSv1.2
1185     Cipher    : AES256-GCM-SHA384
1186
1187 ...
1188 ```
1189
1190 You can specifically use one cipher or a list with the `-cipher` parameter:
1191
1192 ```
1193 openssl s_client -connect 192.168.33.5:5665 -cipher 'ECDHE-RSA-AES256-GCM-SHA384'
1194 ```
1195
1196 In order to fully simulate a connecting client, provide the certificates too:
1197
1198 ```
1199 CERTPATH='/var/lib/icinga2/certs'
1200 HOSTNAME='icinga2.vagrant.demo.icinga.com'
1201 openssl s_client -connect 192.168.33.5:5665 -cert "${CERTPATH}/${HOSTNAME}.crt" -key "${CERTPATH}/${HOSTNAME}.key" -CAfile "${CERTPATH}/ca.crt" -cipher 'ECDHE-RSA-AES256-GCM-SHA384'
1202 ```
1203
1204 In case to need to change the default cipher list,
1205 set the [cipher_list](09-object-types.md#objecttype-apilistener) attribute
1206 in the `api` feature configuration accordingly.
1207
1208 Beware of using insecure ciphers, this may become a
1209 security risk in your organisation.
1210
1211 #### Server Accepts Client <a id="troubleshooting-certificate-handshake-ciphers-server"></a>
1212
1213 If the master node does not actively connect to the satellite/agent node(s), but instead
1214 the child node actively connectsm, you can still simulate a TLS handshake.
1215
1216 Use `openssl s_server` instead of `openssl s_client` on the master during the connection
1217 attempt.
1218
1219 ```
1220 $ openssl s_server -connect 192.168.56.101:5665
1221 ```
1222
1223 Since the server role chooses the preferred cipher suite in Icinga,
1224 you can test-drive the "agent connects to master" mode here, granted that
1225 the TCP connection is not blocked by the firewall.
1226
1227
1228 #### Cipher Scan Tools <a id="troubleshooting-certificate-handshake-ciphers-scantools"></a>
1229
1230 You can also use different tools to test the available cipher suites, this is what SSL Labs, etc.
1231 provide for TLS enabled websites as well. [This post](https://superuser.com/questions/109213/how-do-i-list-the-ssl-tls-cipher-suites-a-particular-website-offers)
1232 highlights some tools and scripts such as [sslscan](https://github.com/rbsec/sslscan) or [testssl.sh](https://github.com/drwetter/testssl.sh/)
1233
1234 Example for sslscan on macOS against a Debian 10 Buster instance
1235 running v2.11:
1236
1237 ```
1238 $ brew install sslscan
1239
1240 $ sslscan 192.168.33.22:5665
1241 Version: 1.11.13-static
1242 OpenSSL 1.0.2f  28 Jan 2016
1243
1244 Connected to 192.168.33.22
1245
1246 Testing SSL server 192.168.33.22 on port 5665 using SNI name 192.168.33.22
1247
1248   TLS Fallback SCSV:
1249 Server supports TLS Fallback SCSV
1250
1251   TLS renegotiation:
1252 Session renegotiation not supported
1253
1254   TLS Compression:
1255 Compression disabled
1256
1257   Heartbleed:
1258 TLS 1.2 not vulnerable to heartbleed
1259 TLS 1.1 not vulnerable to heartbleed
1260 TLS 1.0 not vulnerable to heartbleed
1261
1262   Supported Server Cipher(s):
1263 Preferred TLSv1.2  256 bits  ECDHE-RSA-AES256-GCM-SHA384   Curve P-256 DHE 256
1264 Accepted  TLSv1.2  128 bits  ECDHE-RSA-AES128-GCM-SHA256   Curve P-256 DHE 256
1265 Accepted  TLSv1.2  256 bits  ECDHE-RSA-AES256-SHA384       Curve P-256 DHE 256
1266 Accepted  TLSv1.2  128 bits  ECDHE-RSA-AES128-SHA256       Curve P-256 DHE 256
1267
1268   SSL Certificate:
1269 Signature Algorithm: sha256WithRSAEncryption
1270 RSA Key Strength:    4096
1271
1272 Subject:  icinga2-debian10.vagrant.demo.icinga.com
1273 Altnames: DNS:icinga2-debian10.vagrant.demo.icinga.com
1274 Issuer:   Icinga CA
1275
1276 Not valid before: Jul 12 07:39:55 2019 GMT
1277 Not valid after:  Jul  8 07:39:55 2034 GMT
1278 ```
1279
1280 ## Distributed Troubleshooting <a id="troubleshooting-cluster"></a>
1281
1282 This applies to any Icinga 2 node in a [distributed monitoring setup](06-distributed-monitoring.md#distributed-monitoring-scenarios).
1283
1284 You should configure the [cluster health checks](06-distributed-monitoring.md#distributed-monitoring-health-checks) if you haven't
1285 done so already.
1286
1287 > **Note**
1288 >
1289 > Some problems just exist due to wrong file permissions or applied packet filters. Make
1290 > sure to check these in the first place.
1291
1292 ### Cluster Troubleshooting Connection Errors <a id="troubleshooting-cluster-connection-errors"></a>
1293
1294 General connection errors could be one of the following problems:
1295
1296 * Incorrect network configuration
1297 * Packet loss
1298 * Firewall rules preventing traffic
1299
1300 Use tools like `netstat`, `tcpdump`, `nmap`, etc. to make sure that the cluster communication
1301 works (default port is `5665`).
1302
1303 ```
1304 # tcpdump -n port 5665 -i any
1305
1306 # netstat -tulpen | grep icinga
1307
1308 # nmap icinga2-agent1.localdomain
1309 ```
1310
1311 ### Cluster Troubleshooting TLS Errors <a id="troubleshooting-cluster-tls-errors"></a>
1312
1313 If the cluster communication fails with TLS/SSL error messages, make sure to check
1314 the following
1315
1316 * File permissions on the TLS certificate files
1317 * Does the used CA match for all cluster endpoints?
1318   * Verify the `Issuer` being your trusted CA
1319   * Verify the `Subject` containing your endpoint's common name (CN)
1320   * Check the validity of the certificate itself
1321
1322 Try to manually connect from `icinga2-agent1.localdomain` to the master node `icinga2-master1.localdomain`:
1323
1324 ```
1325 $ openssl s_client -CAfile /var/lib/icinga2/certs/ca.crt -cert /var/lib/icinga2/certs/icinga2-agent1.localdomain.crt -key /var/lib/icinga2/certs/icinga2-agent1.localdomain.key -connect icinga2-master1.localdomain:5665
1326
1327 CONNECTED(00000003)
1328 ---
1329 ...
1330 ```
1331
1332 If the connection attempt fails or your CA does not match, [verify the certificates](15-troubleshooting.md#troubleshooting-certificate-verification).
1333
1334
1335 #### Cluster Troubleshooting Unauthenticated Clients <a id="troubleshooting-cluster-unauthenticated-clients"></a>
1336
1337 Unauthenticated nodes are able to connect. This is required for agent/satellite setups.
1338
1339 Master:
1340
1341 ```
1342 [2015-07-13 18:29:25 +0200] information/ApiListener: New client connection for identity 'icinga2-agent1.localdomain' (unauthenticated)
1343 ```
1344
1345 Agent as command execution bridge:
1346
1347 ```
1348 [2015-07-13 18:29:26 +1000] notice/ClusterEvents: Discarding 'execute command' message from 'icinga2-master1.localdomain': Invalid endpoint origin (client not allowed).
1349 ```
1350
1351 If these messages do not go away, make sure to [verify the master and agent certificates](15-troubleshooting.md#troubleshooting-certificate-verification).
1352
1353
1354 ### Cluster Troubleshooting Message Errors <a id="troubleshooting-cluster-message-errors"></a>
1355
1356 When the network connection is broken or gone, the Icinga 2 instances will be disconnected.
1357 If the connection can't be re-established between endpoints in the same HA zone,
1358 they remain in a Split-Brain-mode and history may differ.
1359
1360 Although the Icinga 2 cluster protocol stores historical events in a [replay log](15-troubleshooting.md#troubleshooting-cluster-replay-log)
1361 for later synchronisation, you should make sure to check why the network connection failed.
1362
1363 Ensure to setup [cluster health checks](06-distributed-monitoring.md#distributed-monitoring-health-checks)
1364 to monitor all endpoints and zones connectivity.
1365
1366
1367 ### Cluster Troubleshooting Command Endpoint Errors <a id="troubleshooting-cluster-command-endpoint-errors"></a>
1368
1369 Command endpoints can be used [for agents](06-distributed-monitoring.md#distributed-monitoring-top-down-command-endpoint)
1370 as well as inside an [High-Availability cluster](06-distributed-monitoring.md#distributed-monitoring-scenarios).
1371
1372 There is no CLI command for manually executing the check, but you can verify
1373 the following (e.g. by invoking a forced check from the web interface):
1374
1375 * `/var/log/icinga2/icinga2.log` shows connection and execution errors.
1376  * The ApiListener is not enabled to [accept commands](06-distributed-monitoring.md#distributed-monitoring-top-down-command-endpoint). This is visible as `UNKNOWN` check result output.
1377  * `CheckCommand` definition not found on the remote client. This is visible as `UNKNWON` check result output.
1378  * Referenced check plugin not found on the remote agent.
1379  * Runtime warnings and errors, e.g. unresolved runtime macros or configuration problems.
1380 * Specific error messages are also populated into `UNKNOWN` check results including a detailed error message in their output.
1381 * Verify the [check source](15-troubleshooting.md#checks-check-source). This is populated by the node executing the check. You can see that in Icinga Web's detail view or by querying the REST API for this checkable object.
1382
1383 Additional tasks:
1384
1385 * More verbose logs are found inside the [debug log](15-troubleshooting.md#troubleshooting-enable-debug-output).
1386
1387 * Use the Icinga 2 API [event streams](12-icinga2-api.md#icinga2-api-event-streams) to receive live check result streams.
1388
1389 Fetch all check result events matching the `event.service` name `remote-client`:
1390
1391 ```
1392 $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/events?queue=debugcommandendpoint&types=CheckResult&filter=match%28%22remote-client*%22,event.service%29'
1393 ```
1394
1395
1396
1397 ### Cluster Troubleshooting Config Sync <a id="troubleshooting-cluster-config-sync"></a>
1398
1399 In order to troubleshoot this, remember the key things with the config sync:
1400
1401 * Within a config master zone, only one configuration master is allowed to have its config in `/etc/icinga2/zones.d`.
1402     * The config master copies the zone configuration from `/etc/icinga2/zones.d` to `/var/lib/icinga2/api/zones`. This storage is the same for all cluster endpoints, and the source for all config syncs.
1403     * The config master puts the `.authoritative` marker on these zone files locally. This is to ensure that it doesn't receive config updates from other endpoints. If you have copied the content from `/var/lib/icinga2/api/zones` to another node, ensure to remove them.
1404 * During startup, the master validates the entire configuration and only syncs valid configuration to other zone endpoints.
1405
1406 Satellites/Agents < 2.11 store the received configuration directly in `/var/lib/icinga2/api/zones`, validating it and reloading the daemon.
1407 Satellites/Agents >= 2.11 put the received configuration into the staging directory `/var/lib/icinga2/api/zones-stage` first, and will only copy this to the production directory `/var/lib/icinga2/api/zones` once the validation was successful.
1408
1409 The configuration sync logs the operations during startup with the `information` severity level. Received zone configuration is also logged.
1410
1411 Typical errors are:
1412
1413 * The api feature doesn't [accept config](06-distributed-monitoring.md#distributed-monitoring-top-down-config-sync). This is logged into `/var/lib/icinga2/icinga2.log`.
1414 * The received configuration zone is not configured in [zones.conf](04-configuration.md#zones-conf) and Icinga denies it. This is logged into `/var/lib/icinga2/icinga2.log`.
1415 * The satellite/agent has local configuration in `/etc/icinga2/zones.d` and thinks it is authoritive for this zone. It then denies the received update. Purge the content from `/etc/icinga2/zones.d`, `/var/lib/icinga2/api/zones/*` and restart Icinga to fix this.
1416
1417 #### New configuration does not trigger a reload <a id="troubleshooting-cluster-config-sync-no-reload"></a>
1418
1419 The debug/notice log dumps the calculated checksums for all files and the comparison. Analyse this to troubleshoot further.
1420
1421 A complete sync for the `director-global` global zone can look like this:
1422
1423 ```
1424 [2019-08-01 09:20:25 +0200] notice/JsonRpcConnection: Received 'config::Update' message from 'icinga2-master1.localdomain'
1425 [2019-08-01 09:20:25 +0200] information/ApiListener: Applying config update from endpoint 'icinga2-master1.localdomain' of zone 'master'.
1426 [2019-08-01 09:20:25 +0200] notice/ApiListener: Creating config update for file '/var/lib/icinga2/api/zones/director-global/.checksums'.
1427 [2019-08-01 09:20:25 +0200] notice/ApiListener: Creating config update for file '/var/lib/icinga2/api/zones/director-global/.timestamp'.
1428 [2019-08-01 09:20:25 +0200] notice/ApiListener: Creating config update for file '/var/lib/icinga2/api/zones/director-global/director/001-director-basics.conf'.
1429 [2019-08-01 09:20:25 +0200] notice/ApiListener: Creating config update for file '/var/lib/icinga2/api/zones/director-global/director/host_templates.conf'.
1430 [2019-08-01 09:20:25 +0200] information/ApiListener: Received configuration for zone 'director-global' from endpoint 'icinga2-master1.localdomain'. Comparing the checksums.
1431 [2019-08-01 09:20:25 +0200] debug/ApiListener: Checking for config change between stage and production. Old (4): '{"/.checksums":"c4dd1237e36dcad9142f4d9a81324a7cae7d01543a672299
1432 b8c1bb08b629b7d1","/.timestamp":"f21c0e6551328812d9f5176e5e31f390de0d431d09800a85385630727b404d83","/director/001-director-basics.conf":"f86583eec81c9bf3a1823a761991fb53d640bd0dc
1433 6cd12bf8c5e6a275359970f","/director/host_templates.conf":"831e9b7e3ec1e33288e56a51e63c688da1d6316155349382a101f7fce6229ecc"}' vs. new (4): '{"/.checksums":"c4dd1237e36dcad9142f4d
1434 9a81324a7cae7d01543a672299b8c1bb08b629b7d1","/.timestamp":"f21c0e6551328812d9f5176e5e31f390de0d431d09800a85385630727b404d83","/director/001-director-basics.conf":"f86583eec81c9bf
1435 3a1823a761991fb53d640bd0dc6cd12bf8c5e6a275359970f","/director/host_templates.conf":"831e9b7e3ec1e33288e56a51e63c688da1d6316155349382a101f7fce6229ecc"}'.
1436 [2019-08-01 09:20:25 +0200] debug/ApiListener: Ignoring old internal file '/.checksums'.
1437 [2019-08-01 09:20:25 +0200] debug/ApiListener: Ignoring old internal file '/.timestamp'.
1438 [2019-08-01 09:20:25 +0200] debug/ApiListener: Checking /director/001-director-basics.conf for old checksum: f86583eec81c9bf3a1823a761991fb53d640bd0dc6cd12bf8c5e6a275359970f.
1439 [2019-08-01 09:20:25 +0200] debug/ApiListener: Checking /director/host_templates.conf for old checksum: 831e9b7e3ec1e33288e56a51e63c688da1d6316155349382a101f7fce6229ecc.
1440 [2019-08-01 09:20:25 +0200] debug/ApiListener: Ignoring new internal file '/.checksums'.
1441 [2019-08-01 09:20:25 +0200] debug/ApiListener: Ignoring new internal file '/.timestamp'.
1442 [2019-08-01 09:20:25 +0200] debug/ApiListener: Checking /director/001-director-basics.conf for new checksum: f86583eec81c9bf3a1823a761991fb53d640bd0dc6cd12bf8c5e6a275359970f.
1443 [2019-08-01 09:20:25 +0200] debug/ApiListener: Checking /director/host_templates.conf for new checksum: 831e9b7e3ec1e33288e56a51e63c688da1d6316155349382a101f7fce6229ecc.
1444 [2019-08-01 09:20:25 +0200] information/ApiListener: Stage: Updating received configuration file '/var/lib/icinga2/api/zones-stage/director-global//director/001-director-basics.c
1445 onf' for zone 'director-global'.
1446 [2019-08-01 09:20:25 +0200] information/ApiListener: Stage: Updating received configuration file '/var/lib/icinga2/api/zones-stage/director-global//director/host_templates.conf'
1447 for zone 'director-global'.
1448 [2019-08-01 09:20:25 +0200] information/ApiListener: Applying configuration file update for path '/var/lib/icinga2/api/zones-stage/director-global' (2209 Bytes).
1449
1450 ...
1451
1452 [2019-08-01 09:20:25 +0200] information/ApiListener: Received configuration updates (4) from endpoint 'icinga2-master1.localdomain' are different to production, triggering validation and reload.
1453 [2019-08-01 09:20:25 +0200] notice/Process: Running command '/usr/lib/x86_64-linux-gnu/icinga2/sbin/icinga2' '--no-stack-rlimit' 'daemon' '--close-stdio' '-e' '/var/log/icinga2/e
1454 rror.log' '--validate' '--define' 'System.ZonesStageVarDir=/var/lib/icinga2/api/zones-stage/': PID 4532
1455 [2019-08-01 09:20:25 +0200] notice/Process: PID 4532 ('/usr/lib/x86_64-linux-gnu/icinga2/sbin/icinga2' '--no-stack-rlimit' 'daemon' '--close-stdio' '-e' '/var/log/icinga2/error.l
1456 og' '--validate' '--define' 'System.ZonesStageVarDir=/var/lib/icinga2/api/zones-stage/') terminated with exit code 0
1457 [2019-08-01 09:20:25 +0200] information/ApiListener: Config validation for stage '/var/lib/icinga2/api/zones-stage/' was OK, replacing into '/var/lib/icinga2/api/zones/' and trig
1458 gering reload.
1459 [2019-08-01 09:20:26 +0200] information/ApiListener: Copying file 'director-global//.checksums' from config sync staging to production zones directory.
1460 [2019-08-01 09:20:26 +0200] information/ApiListener: Copying file 'director-global//.timestamp' from config sync staging to production zones directory.
1461 [2019-08-01 09:20:26 +0200] information/ApiListener: Copying file 'director-global//director/001-director-basics.conf' from config sync staging to production zones directory.
1462 [2019-08-01 09:20:26 +0200] information/ApiListener: Copying file 'director-global//director/host_templates.conf' from config sync staging to production zones directory.
1463
1464 ...
1465
1466 [2019-08-01 09:20:26 +0200] notice/Application: Got reload command, forwarding to umbrella process (PID 4236)
1467 ```
1468
1469 #### Syncing Binary Files is Denied <a id="troubleshooting-cluster-config-sync-binary-denied"></a>
1470
1471 The config sync is built for syncing text configuration files, wrapped into JSON-RPC messages.
1472 Some users have started to use this as binary file sync instead of using tools built for this:
1473 rsync, git, Puppet, Ansible, etc.
1474
1475 Starting with 2.11, this attempt is now prohibited and logged.
1476
1477 ```
1478 [2019-08-02 16:03:19 +0200] critical/ApiListener: Ignoring file '/etc/icinga2/zones.d/global-templates/forbidden.exe' for cluster config sync: Does not contain valid UTF8. Binary files are not supported.
1479 Context:
1480         (0) Creating config update for file '/etc/icinga2/zones.d/global-templates/forbidden.exe'
1481         (1) Activating object 'api' of type 'ApiListener'
1482 ```
1483
1484 In order to solve this problem, remove the mentioned files from `zones.d` and use an alternate way
1485 of syncing plugin binaries to your satellites and agents.
1486
1487
1488 ### Cluster Troubleshooting Overdue Check Results <a id="troubleshooting-cluster-check-results"></a>
1489
1490 If your master does not receive check results (or any other events) from the child zones
1491 (satellite, clients, etc.), make sure to check whether the client sending in events
1492 is allowed to do so.
1493
1494 > **Tip**
1495 >
1496 > General troubleshooting hints on late check results are documented [here](15-troubleshooting.md#late-check-results).
1497
1498 The [distributed monitoring conventions](06-distributed-monitoring.md#distributed-monitoring-conventions)
1499 apply. So, if there's a mismatch between your client node's endpoint name and its provided
1500 certificate's CN, the master will deny all events.
1501
1502 > **Tip**
1503 >
1504 > [Icinga Web 2](02-installation.md#setting-up-icingaweb2) provides a dashboard view
1505 > for overdue check results.
1506
1507 Enable the [debug log](15-troubleshooting.md#troubleshooting-enable-debug-output) on the master
1508 for more verbose insights.
1509
1510 If the client cannot authenticate, it's a more general [problem](15-troubleshooting.md#troubleshooting-cluster-unauthenticated-clients).
1511
1512 The client's endpoint is not configured on nor trusted by the master node:
1513
1514 ```
1515 Discarding 'check result' message from 'icinga2-agent1.localdomain': Invalid endpoint origin (client not allowed).
1516 ```
1517
1518 The check result message sent by the client does not belong to the zone the checkable object is
1519 in on the master:
1520
1521 ```
1522 Discarding 'check result' message from 'icinga2-agent1.localdomain': Unauthorized access.
1523 ```
1524
1525
1526 ### Cluster Troubleshooting Replay Log <a id="troubleshooting-cluster-replay-log"></a>
1527
1528 If your `/var/lib/icinga2/api/log` directory grows, it generally means that your cluster
1529 cannot replay the log on connection loss and re-establishment. A master node for example
1530 will store all events for not connected endpoints in the same and child zones.
1531
1532 Check the following:
1533
1534 * All clients are connected? (e.g. [cluster health check](06-distributed-monitoring.md#distributed-monitoring-health-checks)).
1535 * Check your [connection](15-troubleshooting.md#troubleshooting-cluster-connection-errors) in general.
1536 * Does the log replay work, e.g. are all events processed and the directory gets cleared up over time?
1537 * Decrease the `log_duration` attribute value for that specific [endpoint](09-object-types.md#objecttype-endpoint).
1538
1539 The cluster health checks also measure the `slave_lag` metric. Use this data to correlate
1540 graphs with other events (e.g. disk I/O, network problems, etc).
1541
1542
1543 ### Cluster Troubleshooting: Windows Agents <a id="troubleshooting-cluster-windows-agents"></a>
1544
1545
1546 #### Windows Service Exe Path <a id="troubleshooting-cluster-windows-agents-service-exe-path"></a>
1547
1548 Icinga agents can be installed either as x86 or x64 package. If you enable features, or wonder why
1549 logs are not written, the first step is to analyse which path the Windows service `icinga2` is using.
1550
1551 Start a new administrative Powershell and ensure that the `icinga2` service is running.
1552
1553 ```
1554 C:\Program Files\ICINGA2\sbin> net start icinga2
1555 ```
1556
1557 Use the `Get-WmiObject` function to extract the windows service and its path name.
1558
1559 ```
1560 C:\Program Files\ICINGA2\sbin> Get-WmiObject win32_service | ?{$_.Name -like '*icinga*'} | select Name, DisplayName, State, PathName
1561
1562 Name    DisplayName State   PathName
1563 ----    ----------- -----   --------
1564 icinga2 Icinga 2    Running "C:\Program Files\ICINGA2\sbin\icinga2.exe" --scm "daemon"
1565 ```
1566
1567 If you have used the `icinga2.exe` from a different path to enable e.g. the `debuglog` feature,
1568 navigate into `C:\Program Files\ICINGA2\sbin\` and use the correct exe to control the feature set.
1569
1570
1571 #### Windows Agents consuming 100% CPU <a id="troubleshooting-cluster-windows-agents-cpu"></a>
1572
1573 > **Note**
1574 >
1575 > The network stack was rewritten in 2.11. This fixes several hanging connections and threads
1576 > on older Windows agents and master/satellite nodes. Prior to testing the below, plan an upgrade.
1577
1578 Icinga 2 requires the `NodeName` [constant](17-language-reference.md#constants) in various places to run.
1579 This includes loading the TLS certificates, setting the proper check source,
1580 and so on.
1581
1582 Typically the Windows setup wizard and also the CLI commands populate the [constants.conf](04-configuration.md#constants-conf)
1583 file with the auto-detected or user-provided FQDN/Common Name.
1584
1585 If this constant is not set during startup, Icinga will try to resolve the
1586 FQDN, if that fails, fetch the hostname. If everything fails, it logs
1587 an error and sets this to `localhost`. This results in undefined behaviour
1588 if ignored by the admin.
1589
1590 Querying the DNS when not reachable is CPU consuming, and may look like Icinga
1591 is doing lots of checks, etc. but actually really is just starting up.
1592
1593 In order to fix this, edit the `constants.conf` file and populate
1594 the `NodeName` constant with the FQDN. Ensure this is the same value
1595 as the local endpoint object name.
1596
1597 ```
1598 const NodeName = "windows-agent1.domain.com"
1599 ```
1600
1601
1602
1603 #### Windows blocking Icinga 2 with ephemeral port range <a id="troubleshooting-cluster-windows-agents-ephemeral-port-range"></a>
1604
1605 When you see a message like this in your Windows agent logs:
1606
1607 ```
1608 critical/TcpSocket: Invalid socket: 10055, "An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full."
1609 ```
1610
1611 Windows is blocking Icinga 2 and as such, no more TCP connection handling is possible.
1612
1613 Depending on the version, patch level and installed applications, Windows is changing its
1614 range of [ephemeral ports](https://en.wikipedia.org/wiki/Ephemeral_port#Range).
1615
1616 In order to solve this, raise the the `MaxUserPort` value in the registry.
1617
1618 ```
1619 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
1620
1621 Value Name: MaxUserPort Value
1622 Type: DWORD
1623 Value data: 65534
1624 ```
1625
1626 More details in [this blogpost](https://www.netways.de/blog/2019/01/24/windows-blocking-icinga-2-with-ephemeral-port-range/)
1627 and this [MS help entry](https://support.microsoft.com/en-us/help/196271/when-you-try-to-connect-from-tcp-ports-greater-than-5000-you-receive-t).