Installing Shinken 2.0 on Debian Wheezy
Web agency » Digital news » Installing Shinken 2.0 on Debian Wheezy

Installing Shinken 2.0 on Debian Wheezy

Until now, I had always used the famous Nagios / Centreon couple for my supervision. Only today the two projects do not get along too much. Nagios devs no longer bother to make their tool compatible with the Centreon historical overlay since version 4. And conversely, the Centreon team no longer seeks to add this to Nagios from the stable version of their engine named Centreon Engine. I tried to give the latter a chance. But after a few hours spent on Tibetan forums looking for a fix for an SQL error, I decided to start from scratch and find myself a new monitoring tool.

Shinken installation

Shinken needs a user to function.

We move on to the installation of the python dependencies necessary for the installation

Shinken installation is done via pip

This installation gives us the following tree structure

  • / etc / shinken : all the configuration of the program
  • / usr / bin / shinken- * : the daemon launch scripts
  • / var / lib / shinken : shinken modules and monitoring plugins (we will come back to this)
  • / var / log / shinken : top secret

We launch the tool with its init script

By default, Shinken only supervises itself. Even more, this supervision is very light. If you take a look at the host configuration side under /etc/shinken/hosts/localhost.cfg, you can see that the latter uses a “template” named “generic-host” which just checks that the host is up.

We are going to add some more basic checks on our host. For this we will use a specialized pack. The packs are script boxes to supervise a particular device and are available on this page.

We go under the Shinken user to install the pack

The Shinken CLI needs to be initialized in order to generate the ini file containing the paths to the various tool configuration directories.

Now we can look for our Linux pack

Which gives the following result

We will choose the linux-ssh package which is an agent mode. The script opens an ssh connection to run a command on the remote server and retrieve the information. You should know that this mode is not the most recommended because it consumes more resources than a classic SNMP request.

The pack is installed with all its plugins in the / var / lib / shinken / libexec / folder.

These plugins need a library named python-paramiko. We go back to root to perform this installation.

These plugins launch an ssh connection on the remote server, in this case the local server in our case. We will therefore generate a pair of ssh keys and give the public key to the shinken user.

Do not enter a passphrase otherwise the script would wait for human intervention to enter it at each execution.

Deployment of the public key

We will test a plugin to see that everything works perfectly

What must give

We will therefore add the linux-ssh tag to the definition of our host. For that we edit /etc/shinken/hosts/localhost.cfg

For more details on the configuration of a host I refer you to the official documentation.

We relaunch shinken to take into account

Alerts can be viewed in the log file

Well, a console is not great for displaying the status of our machines. We are going to install the Shinken web interface to make it more pleasant.

Installation of the web interface

The web interface is a module of the daemon broker which will read, interpret and display the results obtained in the log files.

The installation is done from the prompt of the user shinken

The configuration is in the file /etc/shinken/modules/webui.cfg

This module must be added to the main broker in the /etc/shinken/brokers/broker-master.cfg file

We relaunch shinken

And you connect to the web page via your browser at the address of the machine on the port defined in the configuration file of the webui module.

We log in using the admin identifiers found in the configuration file /etc/shinken/contacts/admin.cfg

And the… .. fail!

fail_login_shinken

It's normal, I reassure you. Authentication is managed by a module. It must be added. Let's take a look at the available authentication modules

Who gives:

  • cfg-password: simple authentication based on the password saved in the contact's conf.
  • htpassword: based on an apache htaccess file
  • active-directory: authentication based on AD or LDAP

We install the first

There is nothing to declare in the module's conf file (/etc/shinken/modules/auth_cfg_password.cfg) but you still have to declare the latter as for the others in the webui module under / etc / shinken / modules / webui.cfg

And the restart that goes with it

This time the login passes. In the “all” view you should see your host as well as all the services of the linux-ssh package.

shinken_localhost

It is normal to get a type error

The CPU information recovery plugin is based on the sysstat program. It must be installed on the system.

If we go to the “/ dashboard” view, we get a huge error message

shinken_dashboard_error

This is also normal. The dashboard is specific to each user. The WebUI module needs to save the preferences of each user in a flat file or a database. Here we will use sqlite.

Installation via shinken user

And we add the module to the Webui module under /etc/shinken/modules/webui.cfg

The famous restart

You can now add widgets on the page / dashboard

widget_shinken

Here it is finished for the installation. In the next article I will talk about adding hosts and services. In the meantime there is still the official documentation.

 

 

★ ★ ★ ★ ★