Learn how to – Installation of Bloonix On Centos 7 with MariaDB and Letsencrypt.
Introduction
Be brave enough to live life creatively. The creative place where no one else has ever been.
–Alan Alda
So what is Bloonix?
Bloonix is a plugin-based monitoring system that offers robust solution for businesses who are seeking to ensure high availability and performance of their servers and applications. The software, licensed under the GPLv3, is developed in Perl and Javascript. JavaScript is only used at the client side in a browser. Since Bloonix is plugin-based, the deveices to be monitored can take advantage of the available plugins for Bloonix. What is more, Nagios plugins are compatible and can be used with Bloonix! Let us dive in and get this tool alive and kicking..
Pre-requisite Setup
Create a hostname for your Server and Disable SELinux.
[tech@nix ~]$ sudo hostnamectl set-hostname nix.example.com
Open /etc/selinux/config
and edit the SELINUX=enforcing
part to SELINUX=Disabled
as shown below:
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
Step One
Install EPEL (Extra Packages for Enterprise Linux) Release to get needed software packages
[tech@nix ~]$ sudo yum install epel-release Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.aptus.co.tz * epel: mirror.netweaver.uk * extras: mirror.liquidtelecom.com * updates: mirror.aptus.co.tz
Step Two
In order to get Bloonix packages from their repositories, install Bloonix’s repository to your Centos box. In addition to that, bloonix uses Elasticsearch which is an open-source, RESTful, distributed search and analytics engine built on Apache Lucene (amazon.com).
1. Bloonix Repo
[tech@nix ~]$ sudo rpm -ivh https://download.bloonix.de/repos/centos/7/noarch/bloonix-release-0.7-1.noarch.rpm Retrieving https://download.bloonix.de/repos/centos/7/noarch/bloonix-release-0.7-1.noarch.rpm Preparing... ################################# [100%]
2. Elasticsearch repo
[tech@nix ~]$ sudo rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
Do, sudo vim /etc/yum.repos.d/elasticsearch.repo
and paste the below in the file
[elasticsearch-2.x] name=Elasticsearch repository for 2.x packages baseurl=https://packages.elastic.co/elasticsearch/2.x/centos gpgcheck=1 gpgkey=https://packages.elastic.co/GPG-KEY-elasticsearch enabled=1
Step Three
Installation of Bloonix and Elasticsearch packages
sudo yum install elasticsearch nginx mariadb-server java-1.7.0-openjdk bloonix-server bloonix-agent bloonix-webgui bloonix-plugins-basic bloonix-plugins-linux Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.aptus.co.tz * epel: mirrors.ircam.fr * extras: mirror.liquidtelecom.com * updates: mirror.aptus.co.tz elasticsearch-2.x | 2.9 kB 00:00:00 elasticsearch-2.x/primary_db | 9.3 kB 00:00:02 Resolving Dependencies --> Running transaction check ---> Package bloonix-agent.noarch 0:0.80-1.el7.centos will be installed --> Processing Dependency: bloonix-core >= 0.29 for package: bloonix-agent-0.80-1.el7.centos.noarch --> Processing Dependency: perl(JSON) for package: bloonix-agent-0.80-1.el7.centos.noarch --> Processing Dependency: perl(Params::Validate) for package: bloonix-agent-0.80-1.el7.centos.noarch --> Processing Dependency: perl(Term::ReadKey) for package: bloonix-agent-0.80-1.el7.centos.noarch --> Processing Dependency: mtr for package: bloonix-agent-0.80-1.el7.centos.noarch --> Processing Dependency: perl(Log::Handler) for package: bloonix-agent-0.80-1.el7.centos.noarch ---> Package bloonix-plugins-basic.noarch 0:0.68-1.el7.centos will be installed --> Processing Dependency: perl(Authen::SASL) for package: bloonix-plugins-basic-0.68-1.el7.centos.noarch ---> Package bloonix-plugins-linux.noarch 0:0.69-1.el7.centos will be installed ---> Package bloonix-server.noarch 0:0.66-1.el7.centos will be installed --> Processing Dependency: bloonix-dbi >= 0.13 for package: bloonix-server-0.66-1.el7.centos.noarch --> Processing Dependency: perl(DBI) for package: bloonix-server-0.66-1.el7.centos.noarch --> Processing Dependency: perl(MIME::Lite) for package: bloonix-server-0.66-1.el7.centos.noarch --> Processing Dependency: perl(Net::OpenSSH) for package: bloonix-server-0.66-1.el7.centos.noarch --> Processing Dependency: perl(URI::Escape) for package: bloonix-server-0.66-1.el7.centos.noarch --> Processing Dependency: perl(DBD::Pg) for package: bloonix-server-0.66-1.el7.centos.noarch --> Processing Dependency: perl(Time::ParseDate) for package: bloonix-server-0.66-1.el7.centos.noarch --> Processing Dependency: perl-JSON-XS for package: bloonix-server-0.66-1.el7.centos.noarch ---> Package bloonix-webgui.noarch 0:0.134-1.el7.centos will be installed --> Processing Dependency: bloonix-webgui-core >= 0.16 for package: bloonix-webgui-0.134-1.el7.centos.noarch ---> Package elasticsearch.noarch 0:2.4.6-1 will be installed
Step Four
After the packages have finished getting installed, start MariaDB and get it up by accomplishing the basic configurations such as adding root password and deleting its test tables.
[tech@nix ~]$ mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: Re-enter new password: Estimated strength of the password: 100 Do you wish to continue with the password provided?: Yes Remove anonymous users?: Yes Success. Disallow root login remotely? : Yes Success. Remove test database and access to it? : Yes - Dropping test database... Success. - Removing privileges on test database... Success. Reload privilege tables now? (Press y|Y for Yes) : Yes Success. All done!
Step Five
Configure nginx in this section.The Bloonix-WebGUI runs as a external FastCGI application and needs Nginx as its reverse proxy. After the bloonix-webgui is installed, a configuration file is created for Nginx at /etc/bloonix/webgui/nginx.conf
. For it to be served by Nginx, inlude the file as a new Nginx configuration file as follows. Create a file for example /etc/nginx/conf.d/001_bloonix.conf
and include the created file by bloonix in it.
First, open the file and edit it as follows:
server { listen 443; #Add your fqdn for the server here as shown server_name nix.example.com; access_log /var/log/nginx/bloonix-webgui.access.log; error_log /var/log/nginx/bloonix-webgui.error.log; location ~ /public { root /srv/bloonix/webgui; } location /favicon.ico { root /srv/bloonix/webgui/public/img; } location / { expires off; include /etc/nginx/fastcgi_params; root /srv/bloonix/webgui/public; fastcgi_pass 127.0.0.1:9000; } ssl on; ssl_certificate /etc/bloonix/webgui/pki/server.cert; ssl_certificate_key /etc/bloonix/webgui/pki/server.key; }
After editing it, create the new file and include the below line to it.
[tech@nix ~]$ sudo vim /etc/nginx/conf.d/001_bloonix.conf
Add the line include /etc/bloonix/webgui/nginx.conf;
to the file and restart nginx(sudo systemctl restart nginx
).
Step Six
In this step, we are going to add MySQL schema and an Elasticsearch template. Invoke the following command to create a MySQL schema:
[tech@nix ~]$ /srv/bloonix/webgui/schema/init-database --mysql
After that, create an Elaticsearch template by invoking the following:
[tech@nix ~]$ /srv/bloonix/webgui/schema/init-elasticsearch localhost:9200
Step Seven
At this point, the services and packages should be all installed and ready. In this step, we are going to allow services and ports on firewalld to ensure everything runs smoothly:
[tech@nix ~]$ sudo firewall-cmd --zone public --permanent --add-port=443/tcp [tech@nix ~]$ sudo firewall-cmd --zone=public --permanent --add-service=http [tech@nix ~]$ sudo firewall-cmd --zone=public --permanent --add-service=https [tech@nix ~]$ sudo firewall-cmd --reload
You can try accessing the tool from your browser by typing your fqdn e.g https://nix.example.com
Step Eight- Letsencrypt
Install Certbot, the most renown Letsencrypt Client:
[tech@nix ~]$ sudo yum install certbot-nginx
Since we had already added our hostname to /etc/bloonix/webgui/nginx.conf
file in the server {} section, we can go ahead and obtain the certificate.
[tech@nix ~]$ sudo certbot --nginx -d nix.example.com
You’ll get an output similar to the one below:
Please choose whether HTTPS access is required or optional. ------------------------------------------------------------------------------- 1: Easy - Allow both HTTP and HTTPS access to these sites 2: Secure - Make all requests redirect to secure HTTPS access ------------------------------------------------------------------------------- Select the appropriate number [1-2] then [enter] (press 'c' to cancel):
After you choose what suites you best, hit enter and the final message should be like the below:
IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at /etc/letsencrypt/live/nix.example.com/fullchain.pem. Your cert will expire on 2019-01-09. To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the "certonly" option. To non-interactively renew *all* of your certificates, run "certbot renew"
Please re-chek your /etc/bloonix/webgui/nginx.conf
file and confirm the ssl settings have been updated as below:
[tech@nix ~]$ sudo cat /etc/bloonix/webgui/nginx.conf server { listen 443 default_server; server_name nix.example.com; access_log /var/log/nginx/bloonix-webgui.access.log; error_log /var/log/nginx/bloonix-webgui.error.log; location ~ /public { root /srv/bloonix/webgui; } location /favicon.ico { root /srv/bloonix/webgui/public/img; } location / { expires off; include /etc/nginx/fastcgi_params; root /srv/bloonix/webgui/public; fastcgi_pass 127.0.0.1:9000; } ssl on; ssl_certificate /etc/letsencrypt/live/nix.example.com/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/nix.example.com/privkey.pem; # managed by Certbot }
After this, your deployment should be ready for addition of hosts and devices for monitoring. Thank you for following through and welcome once again.
Leave a Reply
You must be logged in to post a comment.