Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to enable/disable Debug Output on the fly #9981

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
56 changes: 56 additions & 0 deletions doc/15-troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,62 @@ C:\> cd C:\ProgramData\icinga2\var\log\icinga2
C:\ProgramData\icinga2\var\log\icinga2> Get-Content .\debug.log -tail 10 -wait
```

### Enable/Disable Debug Output on the fly <a id="troubleshooting-enable-disable-debug-output-api"></a>

Every feature is just an Icinga 2 config object similar to Host and Service, e.g.
the `debuglog` feature is a [FileLogger](09-object-types.md#objecttype-filelogger).
Those can also be [managed via API](12-icinga2-api.md#icinga2-api-config-objects)
at runtime. This is a good alternative to `icinga2 feature enable debuglog`:

* Object creation/deletion via API happens immediately and requires no restart
* Hence, the debug log is enabled exactly as long as desired

!!! info

In case of [a HA zone](06-distributed-monitoring.md#distributed-monitoring-scenarios-ha-master-agents)
the following API examples toggle the feature on both nodes.

#### Enable Debug Output on the fly <a id="troubleshooting-enable-debug-output-api"></a>

```bash
curl -k -s -S -i -u root:icinga -H 'Accept: application/json' \
-X PUT 'https://localhost:5665/v1/objects/fileloggers/on-the-fly-debug-file' \
-d '{ "attrs": { "severity": "debug", "path": "/var/log/icinga2/on-the-fly-debug.log" }, "pretty": true }'
```

```json
{
"results": [
{
"code": 200.0,
"status": "Object was created."
}
]
}
```

#### Disable Debug Output on the fly <a id="troubleshooting-disable-debug-output-api"></a>

This works only for debug loggers enabled on the fly as above!

```bash
curl -k -s -S -i -u root:icinga -H 'Accept: application/json' \
-X DELETE 'https://localhost:5665/v1/objects/fileloggers/on-the-fly-debug-file?pretty=1'
```

```json
{
"results": [
{
"code": 200.0,
"name": "on-the-fly-debug-file",
"status": "Object was deleted.",
"type": "FileLogger"
}
]
}
```

## Icinga starts/restarts/reloads very slowly

### Try swapping out the allocator
Expand Down