Many ways for Linux box monitoring are available today, but what`s the best one? Thus, for example, you can get a complete high-quality product that is designed especially for the purpose – for instance, Zenoss, Nagios, Zabbix and etc. You can find comparison between all those monitoring tools – for example this one. Meanwhile, options like monitoring scalability, boasting of UI and reporting are all features Linux-users need. However, if your only goal is checking out the general status of your machine – such as observing its disk or memory usage, CPU load and etc, what you must take under considerations by all means is the linux-dash. It represents a specially tailored dashboard that is used for Linux monitoring and that can show you different features and properties – in real time – and without even installing anything, but only using it via your web browser. With the linux-dash, you can have a glance at the RAM usage, Internet speed, CPU load, connections for internet, running process, logged-in users and many other things. However, this web-based tool does not include blackened database that can store your statistics for long period. What you have to do is to drop in the linux-based program a currently available web served (for example, Nginx or Apache) and you can use it for free! That’s the easiest way for a remote monitor of your Linux-based system.
What our guide is made for, though, is to show you how to settle the linux-dash inside the Apache server on your Linux (Debian, Ubuntu) machine. We have chosen the Apache suggestion, because it is more widely used than Nginx, but you can easily install linux-dash on Nginx without problems.
Install Linux Dash on Ubuntu/Debian
First of all you need to install PHP and Apache. Although they come pre-installed on most servers make sure you have it on your Linux box.
howopensource@esprimo:~$ sudo apt-get install apache2 howopensource@esprimo:~$ sudo apt-get install php5 libapache2-mod-php5
Linux-dash needs some PHP modules – so make sure you install them.
howopensource@esprimo:~$ sudo apt-get install php5-json php5-fpm php5-curl
Check that PHP functions shell_exec and exec is enabled. If this is a fresh Apache and PHP installation, it should be OK. So to do that open file /etc/php5/apache2/php.ini in your favorite text editor or use grep or more to find line disable_functions in the php.ini file and make sure that functions shell_exec and exec are not listed there.
howopensource@esprimo:~$ sudo vi /etc/php5/apache2/php.ini howopensource@esprimo:~$ sudo grep disable_functions /etc/php5/apache2/php.ini
Then you need to install git, because we are going to use git installation method.
howopensource@esprimo:~$ sudo apt-get install git.
Next step is to use Git to download Linux Dash. But first navigate to home web directory.
howopensource@esprimo:~$ cd /var/www howopensource@esprimo:~$ sudo git clone https://github.com/afaqurk/linux-dash.git
After cloning Linux Dash you should be ready. Just make sure that Apache web server is running.
howopensource@esprimo:~$ sudo service apache2 start
Use Linux Dash to monitor system status via browser
And then visit http://SERVER_IP_ADDRESS/linux-dash and see the dashboard. In my case it is http://192.168.1.2/linux-dash.
You can also take a look at the following linux-dash screenshots in order to see the different widgets that your monitoring dashboard offers. Note that each of them actually corresponds to a certain property of your Linux system. Last, but not least, feel free to change the web dashboard look according to your personal preferences – simply change the colors or the order of the widgets.
Password protecting access to system monitor
If you run Linux Dash on a server information displayed is a publicly available and some sensitive information could be revealed. So it is strongly recommended to password protect this web app.
Open your Apache virtual hosts file for editing with your favorite text editor and add the following lines anywhere within the
howopensource@esprimo:~$ sudo vi /etc/apache2/sites-available/default
<Directory /var/www/linux-dash> Options FollowSymLinks AllowOverride All Order allow,deny allow from all </Directory>
Next step is to create .htaccess file in the Linux Dash directory and to enable user authentication in this web directory. So copy and paste text into .htaccess file.
howopensource@esprimo:~$ sudo vi /var/www/linux-dash/.htaccess
AuthType Basic AuthName "Linux Dash" AuthUserFile /var/www/linux-dash/.htpasswd Require valid-user
Final step is to create valid user and to enter his/her password. Note that file name specified is the same specified in AuthUserFile option. And user is howopensource in our case. In your case enter your name.
howopensource@esprimo:~$ sudo htpasswd -c /var/www/linux-dash/.htpasswd howopensource New password: Re-type new password: Adding password for user howopensource
And you are ready, but do not forget to restart Apache.
howopensource@esprimo:~$ sudo service apache2 restart
Now when you open http://SERVER_IP_ADDRESS/linux-dash you will be asked for a user name and a password.