Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/naparuba/shinken into cha…
Browse files Browse the repository at this point in the history
…ngelog
  • Loading branch information
olivierHa committed Jan 15, 2016
2 parents efc5f8e + 5cd36d5 commit 2f5e15a
Show file tree
Hide file tree
Showing 17 changed files with 397 additions and 531 deletions.
2 changes: 1 addition & 1 deletion doc/source/01_introduction/about.rst
Expand Up @@ -52,7 +52,7 @@ Shinken has a lot of featuress, we started to list some of them in the last para

* Integration with web user interfaces:

* WebUI (Shinken's own UI)
* WebUI (Shinken own User Interface: https://github.com/shinken-monitoring/mod-webui/wiki)
* Thruk
* Adagios
* Multisite
Expand Down
42 changes: 36 additions & 6 deletions doc/source/06_medium/html-and-detailled-notifications.rst
Expand Up @@ -7,9 +7,9 @@ Tired of brut text email notification, want to add more details to them and even

.. image:: /_static/images/shinken-html-notification.png

Here it is the command you can use to have a basic html notification. You have to specify usual shinken macros in option. If not specified then it will try to get them from environment variable if you have set option ``enable_environment_macros`` in ``shinken.cfg`` if you want to used them. It isn't recommanded to use them for large environment. You better use option ``-c``, ``-o`` and ``-s`` or ``-h`` depend on which object you'll notify. Each macros separated by double comma.
Here it is the command you can use to have a basic html notification. You have to specify usual shinken macros in option. If not specified then it will try to get them from environment variable if you have set option ``enable_environment_macros`` in ``shinken.cfg``. It isn't recommended to use them for large environment. You better use option ``-c``, ``-o`` and ``-s`` or ``-h`` depending upon which object you'll notify. Each macros is separated by double comma.

Here is commands examples ready to use with it :
Here is commands examples ready to use:

::

Expand All @@ -24,11 +24,41 @@ Here is commands examples ready to use with it :
command_line $PLUGINSDIR$/notify_by_email.py -n service -S localhost -r $CONTACTEMAIL$ -f html -c "$NOTIFICATIONTYPE$,,$HOSTNAME$,,$HOSTADDRESS$,,$LONGDATETIME$" -o "$SERVICEDESC$,,$SERVICESTATE$,,$SERVICEOUTPUT$,,$SERVICEDURATION$"
}

Text mail
~~~~~~~~~~~~~~~~~~~~

Despite the nice HTML formatting, you still prefer to use plain old text mail, use the `` -f text`` parameter instead of ``if html``.

Mail sender
~~~~~~~~~~~~~~~~~~~~

Default mail sender is built automatically with current server name and current Shinken user.

If you want to specif the mail sender, use the ``-s (--sender)``. For example: ``-s me@myserver.com``.


Add an header logo
~~~~~~~~~~~~~~~~~~~~

Let's say that you want to deliver mail to a customer and integrate its logo into, you only have to get a logo, named it ``customer_logo.png`` and paste it into ``/var/lib/shinken/share/images/``.
Let's say that you want to deliver mail to a customer and integrate host logo into the mail, you only have to get a logo, name it ``customer_logo.png`` and paste it into ``/var/lib/shinken/share/images/``.

If WebUI2 is installed, then the script will try to find the company logo that can be defined in the WebUI2. The WebUI2 company logo is PNG file located in ``/var/lib/shinken/share/photos/`` and which name is defined in ``/etc/shinken/modules/webui2.cfg``, property ``company_logo``.


Add a WebUI link
~~~~~~~~~~~~~~~~~~~~

The host or service Web UI link can be included in the mail body. Simply use ``-w (--webui)`` option and you will get a direct link to the host or service page in the Web UI.

The link is built using the current server name and the port defined in the Web UI configuration file.

If WebUI2 is installed, the script will try to find the port number defined in ``/etc/shinken/modules/webui2.cfg``, property ``port``.
If WebUI1 is installed, the script will try to find the port number defined in ``/etc/shinken/modules/webui.cfg``, property ``port``.
If both of them are installed, priority is WebUI2.

If neither WebUI2 nor WebUI are installed on your server, there will be no link in the mail even if this option is used.

If you want to define the root part of the URL, use option ``-u (--url)``. For example: ``-u http://webui.myserver:8080/shinken`` will be used as root part instead of ``http://shinken:7767``.

Detailled Notifications
--------------------------
Expand All @@ -39,15 +69,15 @@ Detailled notifications is a way to customize and add useful informations in ema
- **_IMPACT** : Specify what will be the impact
- **_FIXACTIONS** : And what is the recommended actions to do when there is an alert about it.

Example
Example
~~~~~~~~

For example, you can have the below configuration:
our service :

::


define service {
service_description Cpu
use 20min_long,linux-service
Expand Down Expand Up @@ -92,6 +122,6 @@ And now define our notification ways:
host_notification_options d,u,r,f,s
service_notification_commands detailled-service-by-email ; send service notifications via email
host_notification_commands detailled-host-by-email ; send host notifications via email
}
}

Then you'll receive a nice html mail giving all your details in a table.

0 comments on commit 2f5e15a

Please sign in to comment.