Monitor your server through a web based dashboard – ESM

Monitoring a server is obviously an important duty to any sys-admin or more generally, anyone having its own server (Selfhosted or not). Several tools exists to do it, like the popular “top” command (for processes, CPU usage, etc..) or “free” command to know the available ram, or “iftop” for bandwidth usage, etc… Most probably you will prefer to have all these info consolidated into a simple graphs accessible through a web interface, similar to Monitorix, Munin that I’ve already detailed in previous postss, or more like a realtime data dashboard similar to Scout Realtime.

In this latest category, I’ve found a new lightweight and simple dashboard for Linux servers called eZ Server Monitoring (eSM), with 2 versions (Web based and command line based)

 

ezserver monitor dashboard screenshot

Written in PHP and released under GPL licence, eSM displays on a single Web page information such as the operating system, the number of logged on users and system load, CPU, RAM, disk space available, bandwidth usage and especially the port monitoring services such as FTP, SMTP, Web, etc …

 

Interested to use it? The installation is very straightforward:

Installation

1) Create a dedicated folder in your /var/www (let’s call it esm)

In root, simply run:

mkdir /var/www/esm
cd /var/www/esm

2) Download the latest archive (V2.0 as of today) and unzip it

wget http://www.ezservermonitor.com/esm-web/downloads/version/2.0 -O esm-2.0.zip
unzip esm-2.0.zip

If you don’t have unzip command, simply install the package:

apt-get install unzip

3) Clean a bit the directory of have all the files at the root of the folder

mv eZServerMonitor-2.0/* .
rm -R eZServerMonitor-2.0/ esm-2.0.zip

Well and that’s all, you can now directly point to HTTP://YourIP/esm to get access to the dashboard.

 

Optional configuration

As written in the documentation,  eZ Server Monitoring Web works out of the box but further modification to the code can be made to better suit your needs by simply editing the file esm.config.json.

Here are few examples:

1) Modify the websites to ping

Simply find and modify the lines:

<pre class="lang:default highlight:0 decode:true crayon-selected">{
...
    "ping": {
        "hosts": [
            "free.fr",
            "orange.fr",
            "google.com"
        ]
    },
...
}

2) Service monitoring

If you want to monitor a service running on a special port (FTP, SSH, Deluge torrent, etc…), simply find and modify:

{
...
    "services": [
        {
            "name": "Web Server (Apache)",
            "port": 80
        },
        {
            "name": "FTP Server (ProFTPd)",
            "port": 21
        },
        {
            "name": "Databases (MySQL)",
            "port": 3306
        },
        {
            "name": "SSH",
            "port": 22
        }
    ]
...
}

 

Virtualhost configuration

If you wish to access to eSM Web interface through a dedicated sub domain or domain name like esm.domain.tld, you can create a virtualhost to do so.

You will need to:

1) Create a A redirection in your DNS server/registrar from esm.domain.tld to your IP

2) Have SSL certificate ready. If not you can read this tutorial. (Optional, but why not!)

3) Create your virtualhost as following:

In /etc/apache2/sites-enabled/, create a file called esm (In root):

nano /etc/apache2/sites-enabled/esm

and paste/adapt the following content:

<VirtualHost *:80>
        ServerAdmin webmaster@domain.tld
        ServerName esm.domain.tld
        Redirect / https://esm.domain.tld

</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>
        SSLEngine on
        SSLCertificateFile /etc/ssl/certs/myblog.pem
        SSLCertificateKeyFile /etc/ssl/private/myblog.key

        ServerAdmin webmaster@domain.tld
        ServerName esm.domain.tld

        DocumentRoot /var/www/esm
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/esm>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>
</IfModule>

Adapt the content (Servername, webmaster, SSL certificate and directory, …).

When done, save the file (CTRL+X then Yes) and reload apache: (In root)

/etc/init.d/apache2 reload

You should now have access in HTTPS to your eSM using esm.domain.tld URL.

And voila!!

Gravatar

Loves to discover web-based apps to install on his own server@home and write articles about it

0 Comments:

Add a comment