You are reading the documentation for Statusengine 3.x - Switch to Version 2.x for old stable

Statusengine UI

Statusengine UI is a lightweight, responsive, modern web interface, you can use, to make your monitoring data visable.

  • Mobile friendly
  • Big Screen friendly
  • Dark mode
  • Auto refresh
  • Based on JSON API
  • Graphs rendered through Chart.js
  • Basic user management
  • LDAP authentication
  • Multiple monitoring nodes in on interface
  • Anonymous/Guest mode
  • Lightweight
  • Long Plugin Output
  • External commands (Schedule Downtime, Acknowledge issue, etc...)

Please select your operating system first. If your operating system is not in the list, pick the operating system version that matches your operating system best. You can still install Statusengine on your system, even if it is not in the list.

PHP Composer required

Check out the tutorial, of how to install php composer, if you don't have it installed to your system yet.

  1. Load EPEL Repository for PHP 7.2
    yum install epel-release
    yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
    yum check-update
    yum install yum-utils
    yum-config-manager --enable remi-php72
    
  2. Load EPEL Repository for PHP 7.3
    yum install epel-release
    yum install http://rpms.remirepo.net/enterprise/remi-release-8.rpm
    yum check-update
    
    dnf module reset php
    dnf module install php:remi-7.3
    
  3. Install dependencies
    {[{commands[selectedOs].dependencies}]}
  4. Download and Install
    cd /usr/share/
    git clone https://github.com/statusengine/interface.git statusengine-ui
    cd /usr/share/statusengine-ui
    chmod +x bin/*
    composer install
    

Due to the fact that the Statusengine UI Config file has a lot of options you may be don't need, I striped this down to the basics you need to change.

Statusengine Ui can also be configured through environment variables. This can be handy if you want to run Statusengine Ui inside of Docker. See the list of environment variables for more information.

If you are going to use CrateDB you can ignore all MySQL settings and vice vera.

Copy example configuration

cp /usr/share/statusengine-ui/etc/config.yml.example /usr/share/statusengine-ui/etc/config.yml

  • auth_type
    Determines if you want to use Statusengine UI basic authentication or your LDAP for SSO.
  • use_mysql
    Set use_mysql to 1, to enable MySQL Backend.
  • mysql username
    The user Statusengine UI will use to connect to the MySQL server
  • mysql password
    The password of the given MySQL user
  • mysql database
    Name of the MySQL database
  • use_crate
    Set use_crate to 1, to enable CrateDB Backend.
  • crate nodes
    An array of ip addresses of CrateDB instances. I recommend you to use a load balancer in front of your CrateDB cluster, and only add the address of the load balancer.

If you are using Statusengine basic auth, you need to create a user first.
This can be done, via the Statusengine UI Console

/usr/share/statusengine-ui/bin/Console.php users add --username "admin" --password "admin"
Read more about users in the Manage Users section.

All example configurations are using https, with an auto redirect from http:// to https://.
To get a working self-signed certificate we are using the following package:
apt-get install ssl-cert

Fair warning

I have no idea, how secure this certificate really is! Do not use it in production, it's just to make clear how things would work. Use Let's Encrypt to get free TLS certificates.

All example configurations are using https, with an auto redirect from http:// to https://.
Create a new self-signed SSL certificate.
mkdir /etc/ssl/private
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/ssl-cert-snakeoil.key -out /etc/ssl/certs/ssl-cert-snakeoil.pem

openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
cat /etc/ssl/certs/dhparam.pem | tee -a /etc/ssl/certs/ssl-cert-snakeoil.pem

In this example the web server is listen to the address 192.168.56.101 and we create a virtual host for the subdomain statusengine.example.org

{[{commands[selectedOs].apache2}]}
We place the configuration for Statusengine UI to {[{apacheConfig}]}

<VirtualHost 192.168.56.101:80>
    ServerName statusengine.example.org

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]

    DocumentRoot "/usr/share/statusengine-ui/public/"

    RedirectMatch 404 /\.git

    ErrorLog "/var/log/apache2/statusengine-ui-error.log"
    CustomLog "/var/log/apache2/statusengine-ui-access.log" combined
</VirtualHost>

<VirtualHost 192.168.56.101:443>
    ServerName statusengine.example.org

    RedirectMatch 404 /\.git

    DocumentRoot "/usr/share/statusengine-ui/public/"

    SSLEngine On
    SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

    ErrorLog "/var/log/apache2/statusengine-ui-error.log"
    CustomLog "/var/log/apache2/statusengine-ui-access.log" combined
</VirtualHost>
Now we need to enable the configuration and restart the web server
a2ensite statusengine-ui
a2enmod rewrite
a2enmod ssl

{[{commands[selectedOs].apache2Restart}]}
Remove default configuration and restart the web server
rm /etc/httpd/conf.d/welcome.conf

mkdir /var/log/apache2

echo "LoadModule rewrite_module modules/mod_rewrite.so" >> /etc/httpd/conf.modules.d/00-base.conf

echo "<Directory /usr/share/statusengine-ui/public>" >> {[{apacheConfig}]}
echo "  Require all granted" >> {[{apacheConfig}]}
echo "</Directory>" >> {[{apacheConfig}]}

{[{commands[selectedOs].apache2Restart}]}

In this example the web server is listen to the address 192.168.56.101 and we create a virtual host for the subdomain statusengine.example.org

{[{commands[selectedOs].nginx}]}

Notice: We are using php-fpm over a TCP socket!
By default php-fpm will use a Unix socket, so you have to change the following line in the file {[{commands[selectedOs].fpmConfigPath}]} and restart the php-fpm service.


;Remove this line - or make it became a comment
;listen = /run/php/php7.2-fpm.sock

; Add this line to use TCP
listen = 127.0.0.1:9000
{[{commands[selectedOs].phpFpmRestart}]}

We place the configuration for Statusengine UI to {[{nginxConfig}]}

server {
    #Redirect http to https
    listen         80;
    server_name statusengine.example.org;

    server_tokens off;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name statusengine.example.org;

    server_tokens off;
    ssl_certificate     /etc/ssl/certs/ssl-cert-snakeoil.pem;
    ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;

    root   /usr/share/statusengine-ui/public/;
    index  index.html;

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    location ~ \index.php {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass     127.0.0.1:9000;
        fastcgi_index    index.php;
        fastcgi_param    SCRIPT_FILENAME $document_root/api/index.php;
        fastcgi_param    SCRIPT_NAME  /api/index.php;
        fastcgi_param    PHP_SELF     $document_uri;
    }
    
    location ~ /\.git {
        deny all;
    }

    # Remove css, js, and images from access log
    location ~* \.(?:css|js|svg|gif|png|html|ttf|ico|jpg|jpeg)$ {
        access_log off;
    }
}
Enable the configuration and restart the web server
rm /etc/nginx/sites-enabled/default
ln -s /etc/nginx/sites-available/statusengine-ui /etc/nginx/sites-enabled/statusengine-ui

{[{commands[selectedOs].nginxRestart}]}
Remove the server defenition from /etc/nginx/nginx.conf
{[{commands[selectedOs].nginxRestart}]}

You can also use the PHP build-in web server, for example if you are in a Docker environment

php -S 0.0.0.0:80 -t /usr/share/statusengine-ui/public
Before start using the PHP build-in web server, take a look at: http://php.net/manual/en/features.commandline.webserver.php

To manage the users of Statusengine UI Basic Auth, you need to use the CLI Tool provided by Statusengine. Managing Users via the Interface is NOT possible at the moment.
You can access the Statusengine UI User Console, with the following command
/usr/share/statusengine-ui/bin/Console.php users

Create a new user:
If you call the add action without parameters, the shell will be spawn in an interactive mode and ask for username and password.

Crate a new Statusengine UI user in interactive mode

Create a new user - non interactive:
If you call the add action with the parameters --username and --password the new user will be created in non interactive mode and without any questions.
This is useful for automatisation (e.g. Ansible)

Crate a new Statusengine UI user in non interactive mode

Delete a user:
Call the delete action to remove users.
In interactive mode, Statusengine UI will autocomplete usernames.

Delete a Statusengine UI user in interactive mode

List users:
Call the list action to get a list of all available users.

List all available Statusengine UI users

All actions can be called in interactive or non interactive mode!
As alway --help is your friend

Statusengine UI allow to set some user specific settings to the interface. All settings are saved in the local storage of your browser!
I also try to add not too much options.

Statusengine UI users settings

  • Auto refresh - Enable or disable the automatically page refresh interval.
    If you scroll, auto refresh will be temporarily disabled automatically, to avoid jumping lines while reading a log file or so.
  • Auto Refresh frequency - Choose from a predefined list of auto refresh intervals
  • Acknowledge and in Downtime hidden in Menu and Dashboard
    Hosts and services, where the current state was acknowledged or a period of downtime was scheduled, will not count any more as Down, Unreachable, Warning, Critical or Unknown in the menu state overview and the dashboard.
    These hosts and services are just hidden, they will not count as Up or Ok! They will also be not hidden from the state lists.
  • Night mode - Enables dark theme

If you had installed Statusengine UI through git, the update will be done quickly.

  1. Create backup of your files
    cp -r /usr/share/statusengine-ui /some/backup/path
  2. Update your local files
    cd /usr/share/statusengine-ui
    git pull origin master
    composer update
  3. Check for configuration changes
    You old configuration is still loaded. Statusengine UI defines default values for each configuration variable.
    Nevertheless you should compare your current configuration with the new example configuration file for new interessing configuration options.
    vimdiff /usr/share/statusengine-ui/etc/config.yml /usr/share/statusengine-ui/etc/config.yml.example