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

Update documentation #9921

Merged
merged 9 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Alexander A. Klimov <alexander.klimov@icinga.com> <alexander.klimov@icinga.com>
<marius@graylog.com> <marius@torch.sh>
<markus.frosch@icinga.com> <lazyfrosch@icinga.org>
<markus.frosch@icinga.com> <markus@lazyfrosch.de>
<mathias.aerts@delta.blue> <mathiasaerts@users.noreply.github.com>
<michael.friedrich@icinga.com> <michael.friedrich@gmail.com>
<michael.friedrich@icinga.com> <Michael.Friedrich@netways.de>
<nicole.lang@icinga.com> <nicole.lang@netways.de>
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Alexander Fuhr <alexander.fuhr@netways.de>
Alexander Schomburg <script.acc@alex.schomb.org>
Alexander Stoll <astoll@netways.de>
Alexander Wirt <formorer@debian.org>
Alvar Penning <alvar.penning@icinga.com>
Andrea Avancini <andrea.avancini@wuerth-phoenix.com>
Andrea Kao <eirinikos@gmail.com>
Andreas Maus <maus@badphish.ypbind.de>
Expand Down
16 changes: 10 additions & 6 deletions doc/02-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ zypper ar https://download.opensuse.org/repositories/server:/monitoring/15.3/ser
<!-- {% endif %} -->

<!-- {% if amazon_linux %} -->
### Amazon Linux 2 Repository <a id="amazon-linux-2-repository"></a>
### Amazon Linux Repository <a id="amazon-linux-2-repository"></a>

!!! info

Expand All @@ -214,12 +214,14 @@ rpm --import https://packages.icinga.com/icinga.key
wget https://packages.icinga.com/subscription/amazon/ICINGA-release.repo -O /etc/yum.repos.d/ICINGA-release.repo
```

The packages for Amazon Linux 2 depend on other packages which are distributed
The packages for **Amazon Linux 2** depend on other packages which are distributed
as part of the [EPEL repository](https://fedoraproject.org/wiki/EPEL).

```bash
yum install epel-release
```

The packages for newer versions of Amazon Linux don't require additional repositories.
<!-- {% endif %} -->

<!-- {% if windows %} -->
Expand Down Expand Up @@ -307,7 +309,7 @@ zypper install icinga2

<!-- {% if amazon_linux %} -->
<!-- {% if not icingaDocs %} -->
#### Amazon Linux 2
#### Amazon Linux
<!-- {% endif %} -->
```bash
yum install icinga2
Expand Down Expand Up @@ -418,15 +420,17 @@ zypper install --recommends monitoring-plugins-all

<!-- {% if amazon_linux %} -->
<!-- {% if not icingaDocs %} -->
#### Amazon Linux 2
#### Amazon Linux
<!-- {% endif %} -->
The packages for Amazon Linux 2 depend on other packages which are distributed as part of the EPEL repository.
The packages for **Amazon Linux 2** depend on other packages which are distributed as part of the EPEL repository.

```bash
amazon-linux-extras install epel

yum install nagios-plugins-all
```

Unfortunately newer versions of Amazon Linux don't provide those plugins, yet.
<!-- {% endif %} -->

## Set up Icinga 2 API <a id="set-up-icinga2-api"></a>
Expand Down Expand Up @@ -505,7 +509,7 @@ Use your distribution's package manager to install the `icingadb-redis` package

<!-- {% if amazon_linux %} -->
<!-- {% if not icingaDocs %} -->
##### Amazon Linux 2
##### Amazon Linux
<!-- {% endif %} -->
```bash
yum install icingadb-redis
Expand Down
4 changes: 2 additions & 2 deletions doc/05-service-monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ apply Service "db-size-" for (db_name => config in host.vars.databases) {
check_command = "mysql_health"

if (config.mysql_health_username) {
vars.mysql_healt_username = config.mysql_health_username
vars.mysql_health_username = config.mysql_health_username
} else {
vars.mysql_health_username = "root"
}
if (config.mysql_health_password) {
vars.mysql_healt_password = config.mysql_health_password
vars.mysql_health_password = config.mysql_health_password
} else {
vars.mysql_health_password = "icingar0xx"
}
Expand Down
6 changes: 3 additions & 3 deletions doc/09-object-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ the [Icinga 2 API](12-icinga2-api.md#icinga2-api-config-objects).
templates | Array | Templates imported on object compilation.
package | String | [Configuration package name](12-icinga2-api.md#icinga2-api-config-management) this object belongs to. Local configuration is set to `_etc`, runtime created objects use `_api`.
source\_location | Dictionary | Location information where the configuration files are stored.
name | String | Object name. Might be used in [apply rules](03-monitoring-basics.md#using-apply).

## Monitoring Objects <a id="object-types-monitoring"></a>

Expand Down Expand Up @@ -731,7 +732,6 @@ Configuration Attributes:
event\_command | Object name | **Optional.** The name of an event command that should be executed every time the service's state changes or the service is in a `SOFT` state.
volatile | Boolean | **Optional.** Treat all state changes as HARD changes. See [here](08-advanced-topics.md#volatile-services-hosts) for details. Defaults to `false`.
zone | Object name | **Optional.** The zone this object is a member of. Please read the [distributed monitoring](06-distributed-monitoring.md#distributed-monitoring) chapter for details.
name | String | **Required.** The service name. Must be unique on a per-host basis. For advanced usage in [apply rules](03-monitoring-basics.md#using-apply) only.
command\_endpoint | Object name | **Optional.** The endpoint where commands are executed on.
notes | String | **Optional.** Notes for the service.
notes\_url | String | **Optional.** URL for notes for the service (for example, in notification commands).
Expand Down Expand Up @@ -1046,8 +1046,8 @@ Configuration Attributes:

Name | Type | Description
--------------------------|-----------------------|----------------------------------
host\_name | Object name | **Required.** The name of the host this comment belongs to.
service\_name | Object name | **Optional.** The short name of the service this comment belongs to. If omitted, this comment object is treated as host comment.
host\_name | Object name | **Required.** The name of the host this downtime belongs to.
service\_name | Object name | **Optional.** The short name of the service this downtime belongs to. If omitted, this downtime object is treated as host downtime.
author | String | **Required.** The author's name.
comment | String | **Required.** The comment text.
start\_time | Timestamp | **Required.** The start time as UNIX timestamp.
Expand Down
2 changes: 1 addition & 1 deletion doc/10-icinga-template-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Optional custom variables passed as [command parameters](03-monitoring-basics.md
| ifw\_api\_cert | null (Icinga PKI) | TLS client certificate path. |
| ifw\_api\_key | null (Icinga PKI) | TLS client private key path. |
| ifw\_api\_ca | null (Icinga PKI) | Peer TLS CA certificate path. |
| ifw\_api\_crl | null (Icinga PKI) | Path to TLS CRL to check peer against. |
| ifw\_api\_crl | null (none) | Path to TLS CRL to check peer against. |
| ifw\_api\_username | null (none) | Basic auth username. |
| ifw\_api\_password | null (none) | Basic auth password. |

Expand Down
8 changes: 4 additions & 4 deletions doc/12-icinga2-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1850,15 +1850,15 @@ Example for all object events:
--------------|---------------|--------------------------
type | String | Event type `DowntimeAdded`.
timestamp | Timestamp | Unix timestamp when the event happened.
downtime | Dictionary | Serialized [Comment](09-object-types.md#objecttype-downtime) object.
downtime | Dictionary | Serialized [Downtime](09-object-types.md#objecttype-downtime) object.

#### <a id="icinga2-api-event-streams-type-downtimeremoved"></a> Event Stream Type: DowntimeRemoved

Name | Type | Description
--------------|---------------|--------------------------
type | String | Event type `DowntimeRemoved`.
timestamp | Timestamp | Unix timestamp when the event happened.
downtime | Dictionary | Serialized [Comment](09-object-types.md#objecttype-downtime) object.
downtime | Dictionary | Serialized [Downtime](09-object-types.md#objecttype-downtime) object.


#### <a id="icinga2-api-event-streams-type-downtimestarted"></a> Event Stream Type: DowntimeStarted
Expand All @@ -1867,7 +1867,7 @@ Example for all object events:
--------------|---------------|--------------------------
type | String | Event type `DowntimeStarted`.
timestamp | Timestamp | Unix timestamp when the event happened.
downtime | Dictionary | Serialized [Comment](09-object-types.md#objecttype-downtime) object.
downtime | Dictionary | Serialized [Downtime](09-object-types.md#objecttype-downtime) object.


#### <a id="icinga2-api-event-streams-type-downtimetriggered"></a> Event Stream Type: DowntimeTriggered
Expand All @@ -1876,7 +1876,7 @@ Example for all object events:
--------------|---------------|--------------------------
type | String | Event type `DowntimeTriggered`.
timestamp | Timestamp | Unix timestamp when the event happened.
downtime | Dictionary | Serialized [Comment](09-object-types.md#objecttype-downtime) object.
downtime | Dictionary | Serialized [Downtime](09-object-types.md#objecttype-downtime) object.


### Event Stream Filter <a id="icinga2-api-event-streams-filter"></a>
Expand Down
4 changes: 2 additions & 2 deletions doc/14-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ yum install icinga2-ido-mysql
zypper install icinga2-ido-mysql
```

###### Amazon Linux 2
###### Amazon Linux

```bash
yum install icinga2-ido-mysql
Expand Down Expand Up @@ -942,7 +942,7 @@ yum install icinga2-ido-pgsql
zypper install icinga2-ido-pgsql
```

###### Amazon Linux 2
###### Amazon Linux

```bash
yum install icinga2-ido-pgsql
Expand Down
89 changes: 0 additions & 89 deletions doc/15-troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -950,95 +950,6 @@ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localho
```


### Analyze Notification Result <a id="troubleshooting-notifications-result"></a>

> **Note**
>
> This feature is available since v2.11 and requires all endpoints
> being updated.

Notifications inside a HA enabled zone are balanced between the endpoints,
just like checks.

Sometimes notifications may fail, and with looking into the (debug) logs
for both masters, you cannot correlate this correctly.

The `last_notification_result` runtime attribute is stored and synced for Notification
objects and can be queried via REST API.

Example for retrieving the notification object and result from all `disk` services using a
[regex match](18-library-reference.md#global-functions-regex) on the name:

```
$ curl -k -s -u root:icinga -H 'Accept: application/json' -H 'X-HTTP-Method-Override: GET' -X POST 'https://localhost:5665/v1/objects/notifications' \
-d '{ "filter": "regex(pattern, service.name)", "filter_vars": { "pattern": "^disk" }, "attrs": [ "__name", "last_notification_result" ], "pretty": true }'
{
"results": [

{
"attrs": {
"last_notification_result": {
"active": true,
"command": [
"/etc/icinga2/scripts/mail-service-notification.sh",
"-4",
"",
"-6",
"",
"-b",
"",
"-c",
"",
"-d",
"2019-08-02 10:54:16 +0200",
"-e",
"disk",
"-l",
"icinga2-agent1.localdomain",
"-n",
"icinga2-agent1.localdomain",
"-o",
"DISK OK - free space: / 38108 MB (90.84% inode=100%);",
"-r",
"user@localdomain",
"-s",
"OK",
"-t",
"RECOVERY",
"-u",
"disk"
],
"execution_end": 1564736056.186217,
"execution_endpoint": "icinga2-master1.localdomain",
"execution_start": 1564736056.132323,
"exit_status": 0.0,
"output": "",
"type": "NotificationResult"
}
},
"joins": {},
"meta": {},
"name": "icinga2-agent1.localdomain!disk!mail-service-notification",
"type": "Notification"
}

...

]
}
```

Example with the debug console:

```
$ 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

"icinga2-agent1.localdomain"
```

Whenever a notification command failed to execute, you can fetch the output as well.


## Feature Troubleshooting <a id="troubleshooting-features"></a>

### Feature is not working <a id="feature-not-working"></a>
Expand Down
Loading