integrations doc: Move nagios doc to separate file.

This commit is contained in:
Tomasz Kolek
2017-04-05 07:42:03 +02:00
committed by Tim Abbott
parent 489a7d1784
commit 484fef059b
4 changed files with 83 additions and 76 deletions

View File

@@ -116,81 +116,6 @@
{% include 'zerver/integrations/email.html' %} {% include 'zerver/integrations/email.html' %}
{% endif %} {% endif %}
<div id="nagios" class="integration-instructions">
<p>First, create the stream you'd like to use for Nagios notifications,
and subscribe all interested parties to this stream. The integration will
use the default stream <code>nagios</code> if no stream is supplied in the
configuration; you still need to create the stream even if you are using
this default.</p>
<p>Next, download and install our <a href="/api">Python
bindings and example scripts</a> on your Nagios server.</p>
<p>Next, open <code>integrations/nagios/zuliprc.example</code>
in your favorite editor, and change the following lines to
specify the email address and API key for your Nagios bot,
saving it to <code>/etc/nagios3/zuliprc</code> on your Nagios
server:</p>
<div class="codehilite"><pre>[api]
email = NAGIOS_BOT_EMAIL_ADDRESS
key = NAGIOS_BOT_API_KEY
{% if api_site_required %}site = {{ external_api_uri_subdomain }}{% endif %}</pre></div>
<p>Copy <code>integrations/nagios/zulip_nagios.cfg</code>
to <code>/etc/nagios3/conf.d</code> on your Nagios server.</p>
<p>Finally, add <code>zulip</code> to the <code>members</code>
list for one or more of the contact groups in the
<code>CONTACT GROUPS</code> section
of <code>/etc/nagios3/conf.d/contacts.cfg</code>, doing
something like:
</p>
<div class="codehilite"><pre>define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members monitoring<span class="na">, zulip</span>
}
</pre></div>
Once you've done that, reload your Nagios configuration
using <code>/etc/init.d/nagios3 reload</code>.
<p><b>Congratulations! You're done!</b><br /> When your Nagios
system makes an alert, you'll see a message like the following,
to the stream <code>nagios</code> (to change this, edit the
arguments to <code>nagios-notify-zulip</code>
in <code>/etc/nagios3/conf.d/zulip_nagios.cfg</code>) with a
topic indicating the service with an issue:</p>
<img class="screenshot" src="/static/images/integrations/nagios/001.png" />
<p><b>Testing</b><br />If you
have <a href="http://nagios.sourceforge.net/docs/3_0/extcommands.html">external
commands enabled in Nagios</a>, you can generate a test notice
from your Nagios instance by visiting using the
<code>Send custom service notification</code> command in
the <code>Service Commands</code> section of any individual
service's page on your Nagios instance.</p>
<p><b>Troubleshooting</b><br />You can confirm whether you've
correctly configured Nagios to run the Zulip plugin by looking
for <code>SERVICE NOTIFICATION</code> lines mentioning zulip
in <code>/var/log/nagios3/nagios.log</code>. You can confirm
whether you've configured the Zulip plugin code correctly by
running <code>/usr/local/share/zulip/integrations/nagios/nagios-notify-zulip</code>
directly.</p>
<p style="font-size:11px; font-style:italic;">
Logos are trademarks of their respective owners.
None of the integrations on this page are created by,
affiliated with, or supported by the companies
represented by the logos.
</p>
</div>
<div id="openshift" class="integration-instructions"> <div id="openshift" class="integration-instructions">
<p>Ths integration sends a notification every time a deployment is <p>Ths integration sends a notification every time a deployment is

View File

@@ -0,0 +1,80 @@
<p>
First, create the stream you'd like to use for Nagios notifications,
and subscribe all interested parties to this stream. The integration will
use the default stream <code>nagios</code> if no stream is supplied in the
configuration; you still need to create the stream even if you are using
this default.
</p>
<p>
Next, download and install our
<a href="/api">Python bindings and example scripts</a>
on your Nagios server.
</p>
<p>
Next, open <code>integrations/nagios/zuliprc.example</code>
in your favorite editor, and change the following lines to
specify the email address and API key for your Nagios bot,
saving it to <code>/etc/nagios3/zuliprc</code> on your Nagios
server:
</p>
<div class="codehilite"><pre>[api]
email = NAGIOS_BOT_EMAIL_ADDRESS
key = NAGIOS_BOT_API_KEY
{% if api_site_required %}site = {{ external_api_uri_subdomain }}{% endif %}</pre>
</div>
<p>
Copy <code>integrations/nagios/zulip_nagios.cfg</code>
to <code>/etc/nagios3/conf.d</code> on your Nagios server.
</p>
<p>
Finally, add <code>zulip</code> to the <code>members</code>
list for one or more of the contact groups in the
<code>CONTACT GROUPS</code> section
of <code>/etc/nagios3/conf.d/contacts.cfg</code>, doing
something like:
</p>
<div class="codehilite"><pre>define contactgroup {
contactgroup_name admins
alias Nagios Administrators
members monitoring<span class="na">, zulip</span>
}
</pre>
</div>
Once you've done that, reload your Nagios configuration
using <code>/etc/init.d/nagios3 reload</code>.
<p>
<b>Congratulations! You're done!</b><br/> When your Nagios
system makes an alert, you'll see a message like the following,
to the stream <code>nagios</code> (to change this, edit the
arguments to <code>nagios-notify-zulip</code>
in <code>/etc/nagios3/conf.d/zulip_nagios.cfg</code>) with a
topic indicating the service with an issue:
</p>
<img class="screenshot" src="/static/images/integrations/nagios/001.png"/>
<p>
<b>Testing</b><br/>If you have
<a href="http://nagios.sourceforge.net/docs/3_0/extcommands.html">external commands enabled in Nagios</a>,
you can generate a test notice from your Nagios instance by visiting using the
<code>Send custom service notification</code> command in
the <code>Service Commands</code> section of any individual
service's page on your Nagios instance.
</p>
<p>
<b>Troubleshooting</b><br/>You can confirm whether you've
correctly configured Nagios to run the Zulip plugin by looking
for <code>SERVICE NOTIFICATION</code> lines mentioning zulip
in <code>/var/log/nagios3/nagios.log</code>. You can confirm
whether you've configured the Zulip plugin code correctly by
running <code>/usr/local/share/zulip/integrations/nagios/nagios-notify-zulip</code>
directly.
</p>

View File

@@ -131,6 +131,7 @@ def check_html_templates(templates, all_dups):
'templates/zerver/integrations/git.html', 'templates/zerver/integrations/git.html',
'templates/zerver/integrations/jira-plugin.html', 'templates/zerver/integrations/jira-plugin.html',
'templates/zerver/integrations/mercurial.html', 'templates/zerver/integrations/mercurial.html',
'templates/zerver/integrations/nagios.html',
] ]
validate(fn=fn, check_indent=(fn not in bad_files)) validate(fn=fn, check_indent=(fn not in bad_files))
@@ -190,6 +191,7 @@ def check_html_templates(templates, all_dups):
'templates/zerver/integrations/google-calendar.html', 'templates/zerver/integrations/google-calendar.html',
'templates/zerver/integrations/jira-plugin.html', 'templates/zerver/integrations/jira-plugin.html',
'templates/zerver/integrations/mercurial.html', 'templates/zerver/integrations/mercurial.html',
'templates/zerver/integrations/nagios.html',
] ]
# TODO: Clean these files # TODO: Clean these files
for fn in templates: for fn in templates:

View File

@@ -215,7 +215,7 @@ INTEGRATIONS = {
display_name='Mercurial (hg)', display_name='Mercurial (hg)',
doc='zerver/integrations/mercurial.html' doc='zerver/integrations/mercurial.html'
), ),
'nagios': Integration('nagios', 'nagios'), 'nagios': Integration('nagios', 'nagios', doc='zerver/integrations/nagios.html'),
'openshift': Integration('openshift', 'openshift', display_name='OpenShift'), 'openshift': Integration('openshift', 'openshift', display_name='OpenShift'),
'perforce': Integration('perforce', 'perforce'), 'perforce': Integration('perforce', 'perforce'),
'phabricator': Integration('phabricator', 'phabricator'), 'phabricator': Integration('phabricator', 'phabricator'),