2021-03-15 23:08:51 +01:00
|
|
|
|
1. {!create-stream.md!}
|
2017-06-05 19:16:22 +02:00
|
|
|
|
|
2021-03-15 23:08:51 +01:00
|
|
|
|
1. {!download-python-bindings.md!}
|
2017-06-22 05:42:48 +02:00
|
|
|
|
|
2021-03-15 23:08:51 +01:00
|
|
|
|
1. Next, on your {{ settings_html|safe }}, create a bot for
|
|
|
|
|
{{ integration_display_name }}.
|
2017-06-05 19:16:22 +02:00
|
|
|
|
|
2021-03-15 23:08:51 +01:00
|
|
|
|
1. Next, open `integrations/nagios/zuliprc.example` in your favorite
|
|
|
|
|
editor, and change the following lines to specify the email address
|
2022-01-11 00:55:20 +01:00
|
|
|
|
and API key for your Nagios bot, saving it to `/etc/nagios4/zuliprc`
|
2021-03-15 23:08:51 +01:00
|
|
|
|
on your Nagios server:
|
2017-06-05 19:16:22 +02:00
|
|
|
|
|
2021-03-15 23:08:51 +01:00
|
|
|
|
```
|
|
|
|
|
[api]
|
|
|
|
|
email = NAGIOS_BOT_EMAIL_ADDRESS
|
|
|
|
|
key = NAGIOS_BOT_API_KEY
|
|
|
|
|
site = {{ api_url }}
|
|
|
|
|
```
|
2017-06-05 19:16:22 +02:00
|
|
|
|
|
2022-01-11 00:55:20 +01:00
|
|
|
|
1. Copy `integrations/nagios/zulip_nagios.cfg` to `/etc/nagios4/conf.d`
|
2021-03-15 23:08:51 +01:00
|
|
|
|
on your Nagios server.
|
2017-06-05 19:16:22 +02:00
|
|
|
|
|
2021-03-15 23:08:51 +01:00
|
|
|
|
1. Finally, add `zulip` to the `members` list for one or more of the
|
|
|
|
|
contact groups in the `CONTACT GROUPS` section of
|
2022-01-11 00:55:20 +01:00
|
|
|
|
`/etc/nagios4/conf.d/contacts.cfg`, doing something like:
|
2017-06-05 19:16:22 +02:00
|
|
|
|
|
2021-03-15 23:08:51 +01:00
|
|
|
|
```
|
|
|
|
|
define contactgroup {
|
|
|
|
|
contactgroup_name admins
|
|
|
|
|
alias Nagios Administrators
|
|
|
|
|
members monitoring, zulip
|
|
|
|
|
}
|
|
|
|
|
```
|
2017-06-05 19:16:22 +02:00
|
|
|
|
|
2021-03-15 23:08:51 +01:00
|
|
|
|
1. Once you’ve done that, reload your Nagios configuration using
|
2022-01-11 00:55:20 +01:00
|
|
|
|
`/etc/init.d/nagios4 reload`.
|
2017-06-05 19:16:22 +02:00
|
|
|
|
|
2021-03-15 23:08:51 +01:00
|
|
|
|
1. When your Nagios system makes an alert, you’ll see a message like the
|
|
|
|
|
following, to the stream `nagios` (to change this, edit the arguments
|
2022-01-11 00:55:20 +01:00
|
|
|
|
to `nagios-notify-zulip` in `/etc/nagios4/conf.d/zulip_nagios.cfg`)
|
2021-03-15 23:08:51 +01:00
|
|
|
|
with a topic indicating the service with an issue.
|
2017-06-05 19:16:22 +02:00
|
|
|
|
|
2017-06-22 05:42:48 +02:00
|
|
|
|
{!congrats.md!}
|
2017-06-05 19:16:22 +02:00
|
|
|
|
|
2020-08-05 11:50:17 +02:00
|
|
|
|
![Nagios bot message](/static/images/integrations/nagios/001.png)
|
2017-06-05 19:16:22 +02:00
|
|
|
|
|
2021-03-15 23:08:51 +01:00
|
|
|
|
### Testing
|
2017-06-05 19:16:22 +02:00
|
|
|
|
|
2017-06-22 05:42:48 +02:00
|
|
|
|
If you have [external commands enabled in Nagios][1],
|
|
|
|
|
you can generate a test notice from your Nagios instance by
|
|
|
|
|
using the `Send custom service notification` command in the
|
|
|
|
|
`Service Commands` section of any individual service’s page
|
|
|
|
|
on your Nagios instance.
|
|
|
|
|
|
2020-03-27 01:32:21 +01:00
|
|
|
|
[1]: https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/extcommands.html
|
2017-06-05 19:16:22 +02:00
|
|
|
|
|
2021-03-15 23:08:51 +01:00
|
|
|
|
### Troubleshooting
|
2017-06-05 19:16:22 +02:00
|
|
|
|
|
|
|
|
|
You can confirm whether you’ve correctly configured Nagios to run the
|
|
|
|
|
Zulip plugin by looking for `SERVICE NOTIFICATION` lines mentioning
|
2022-01-11 00:55:20 +01:00
|
|
|
|
zulip in `/var/log/nagios4/nagios.log`. You can confirm whether you’ve
|
2017-06-05 19:16:22 +02:00
|
|
|
|
configured the Zulip plugin code correctly by running
|
|
|
|
|
`/usr/local/share/zulip/integrations/nagios/nagios-notify-zulip`
|
|
|
|
|
directly.
|