Install Shinken 3.0 on CentOS 7 in 10 steps [Quick Guide]

9:36 pm March 21, 201710415

I. introduction

the supervision is now anchored in the habits of businesses. This allows to keep an eye on the systems, applications and possibly anticipate the incidents. Among the tools to do the oversight, was at the top the famous Nagios.

For some years now a newcomer appeared in the landscape of supervision tools: Shinken. Coming from a model (or Proof Of Concept also called POC), Shinken for been completely redesigned based on the features of Nagios to allow a more complete evolution. The author of Shinken: Jean Gabes, wanted to completely rewrite the application using Python (for flexibility of use and programming).

In fact, each function for its role and, in fact, its underlying service. There are thus five large families of services :

Arbiter : the conductor that drives everything.
Scheduler (s) : the (Planner (s) allowing to schedule treatment.
Reactionner (s) : query the schedulers to the list of tasks to be performed.
Poller (s) : also wondering the schedulers for controls to achieve.
(s) Broker: in charge of the storage of the data sent.

In addition to its services, Shinken relies on many modules (also called plugins) to complete the features of the tool and can be cut into Kingdom (usually divided according to a logical network cutting: DMZ, LAN, networks private). This allows to oversee all of the equipment and infrastructure applications, from the smallest workstation up to the suite the more complex.

The discovery of the equipment of the company program and are approximately the same way as with Nagios. However, as the tool is developed in Python, the installation is not as simple as previously.

Personally, I prefer to spend my time in something other than a facility. Also, I propose to go through the ten steps making up a complete installation of Shinken 3.0 on a CentOS7 distribution.

II. Creation of the environment and requirements

in the first place, as any application, to isolate the environment in which we will install and configure the software. To do this, so let’s create a Shinken user and associate it with a password:

 # useradd shinken # passwd shinken Password: * Re - type Password: * 

then, Shinken requires many software layers including the Python environment. But to achieve this, we must also install the package from the official repository EPEL:

 # yum install - y epel-release 

III. Installation of additional tool

now you can install the packages required for initialization of Shinken, are the following packages:

– python-pycurl
– python-setuptools
– pymongo python
– mongodb
– git

 # yum install - y python-pycurl python-setuptools python-pymongo mongodb git 

to install Shinken, there are three main methods:

via the pip utility : to add to the Python environment modules necessary and downloadable from the EPEL package. This method is by far the simplest and can also use the easy_install program in order to activate the pyro utility that allows you to interact directly with Python.

via the installation of the package : to date, there is a package shinken. But it contains only the tools to administer modules of the tool. According to the official site, the package should quickly be available for Debian/Ubuntu distributions, Fedora/RedHat/CentOS. But, in the meantime, this solution is not feasible.

via Shinken sources : If you want to have a server managed by package manager, make a compilation of sources isn’t necessarily the best solution.

As you can see, it is preferable to the first method. But, then install pyro:

 # easy_install pyro 

IV. Cloning of the Shinken project Git Branch

now we’re ready to retrieve the Shinken content. So, we will clone the active branch of the project via github. It is better to do it right now under the future owner account:

 # su - shinken $ git clone https://github.com/naparuba/shinken.git 

this will then create a shinken subdirectory which contains the entire project. If one is connected to the shinken account previously created, you must move in/home/shinken/shinken.

Note: this may take some time and depends strongly on your belt speed bandwidth on Internet .

V. Shinken application Installation

must then install all the environment of the future application Shinken: binaries, scripts, libraries… We will therefore be placed on the root of the machine account and run the following command:

 # cd/home/shinken/shinken # python setup.py install 

VI. Set up utilities and rights

at this stage of the configuration, you can install the shinken package, containing, as I mentioned earlier, only a tool able to administer and install the different modules, allowing to expand the capabilities of Shinken.

 # yum install - y shinken 

before initializing the application environment, it is advisable to change the rights of the following directories so that they belong to the shinken account, as well as my group:

– directory/var/lib/shinken
– directory/var/log/shinken
– directory/var/run/shinken

therefore, run the following commands while logged in as root :

 # chown - R shinken:shinken/var/lib/shinken # chown - R shinken:shinken/var/llog/shinken # chown - R shinken:shinken/var/run/shinken 

then, he must not forget to activate the different service Shinken in the initialization /etc/init.d directory:

 # systemctl enable shinken # systemctl enable shinken-arbiter # systemctl enable shinken-borker # systemctl enable shinken-poller # systemctl enable shinken-reactionner # systemctl enable shinken-receiver # systemctl enable shinken-scheduler 

VII. Shinken boot

in order to generate the configuration file and the application environment, we must now initialize Shinken. So we will run the command below, connecting under the shinken account:

 # su - shinken $ shinken - init 

this command will create the .ini file in the home directory of the account shinken.

VIII. Installation of the modules (plugins)

now, we should be able to install our first Shinken modules and allow then to initialize the default GUI WebUI. You must install the following modules:

– webui
– auth-cfg-password

so let’s start with the installation of the first:

 $ shinken install webui 

you must then modify the broker – master.cfg located in the directory/etc/shinken in order to add to the level of the line modules the name than just to install:

... modules webui 

same , we install the second module in the same way:

 $ shinken install auth-cfg-password 

but, there, this time editing the file /etc/shinken/modules/webui.cfg to tell him that we will use the module auth-cfg-password as a means of authentication. The latter allows to match as a password for the administrative account Shinken: admin, one who is specified in the file admin.cfg directory / etc/shinken/contacts .

Note : the other existing authentication means can, if it so wishes, to use a file .htpasswd (as in web applications), or to connect to an LDAP or Active Directory. These methods may be the subject of other tutorials.

IX. Start services

If you follow the order of the above steps, we should then be able to start services Shinken: [1945900[8]

# systemctl start shinken

Note: the /etc/init.sh/shinken script allows to fly other scripts. This allows to maintain flexibility for servers where it is not necessarily useful to start all services, such as backup servers or some load balancers.

Error at startup, Shinken registered all of the start-up process in a temporary file, in / tmp as bad_ _shinken.log .

X. connection to Shinken

after all these actions, by way of audit, we are able to open, since any browser, the url http://:7767 to view the sights of the Shinken application (where is the name of your server Shinken):

that is, we can now focus on the essential task of supervision : set up its infrastructure and declare its equipment, its applications, its PKI…