How to remotely monitor Linux servers and desktops from a Web browser

Source: Internet
Author: User
Tags linux mint
When you want to monitor a Linux machine, you have many options. Although there are many product quality monitoring solutions (such as Nagios, Zabbix, and Zenoss), they have a gorgeous UI, scalable monitoring, and easy-to-understand reports, these solutions are too powerful for most end users.

When you want to monitor a Linux machine, you have many options. Although there are many product quality monitoring solutions (such as Nagios, Zabbix, and Zenoss), they have a gorgeous UI, scalable monitoring, and easy-to-understand reports, these solutions are too powerful for most end users. If you only need to check the basic status of the Linux server or desktop (such as CPU load, memory usage, and active processes), consider linux-dash.

Linux-dash is a web-based lightweight monitoring panel for Linux machines. It can display different system attributes in real time, such as CPU load, memory usage, disk usage, network speed, network connection, upstream/downstream bandwidth, login user, and running processes. Linux-dash does not have a backend database to store long-term statistics. Run linux-dash on any existing web Server (such as Apache and Nginx. This is a fast and simple way to remotely monitor personal projects.

In this tutorial, I will describeHow to Set Linux-dash on linux Nginx web Server. Nginx is used here, instead of Apache, because it is lighter.

Set Linux-dash On Debian, Ubuntu, or linux Mint

First, install the Nginx web server with php-fpm.

 
  1. $ Sudo apt-get install git nginx php5-json php5-fpm php5-curl

Create the following Nginx configuration file/etc/nginx/conf. d/linuxdash. conf for linux-dash. In this example, we use the port 8080.

 
  1. $ Sudo vi/etc/nginx/conf. d/linuxdash. conf
 
  1. Server {
  2. Server_name $ domain_name;
  3. Listen 8080;
  4. Root/var/www;
  5. Index index.html index. php;
  6. Access_log/var/log/nginx/access. log;
  7. Error_log/var/log/nginx/error. log;
  8.  
  9. Location ~ *\.(? : Xml | ogg | mp3 | mp4 | ogv | svg | svgz | eot | otf | woff | ttf | css | js | jpg | jpeg | gif | png | ico) $ {
  10. Try_files $ uri = 404;
  11. Expires max;
  12. Access_log off;
  13. Add_header Pragma public;
  14. Add_header Cache-Control "public, must-revalidate, proxy-revalidate ";
  15. }
  16.  
  17. Location/linux-dash {
  18. Index index.html index. php;
  19. }
  20.  
  21. # PHP-FPM via sockets
  22. Location ~ \. Php (/| $ ){
  23. Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
  24. Fastcgi_split_path_info ^ (. +? \. Php) (/. *) $;
  25. Fastcgi_pass unix:/var/run/php5-fpm.sock;
  26. If (! -F $ document_root $ fastcgi_script_name ){
  27. Return 404;
  28. }
  29. Try_files $ uri // index. php? $ Args;
  30. Include fastcgi_params;
  31. }
  32. }

Disable default site configuration.

 
  1. $ Sudo rm/etc/nginx/sites-enabled/default

Edit/etc/php5/fpm/pool. d/www. conf to configure php-fpm. Make sure to edit the "user", "group", and "listen" commands as follows. You do not need to change the remaining configurations.

 
  1. $ Sudo vi/etc/php5/fpm/pool. d/www. conf
  2.  
  3. User = www-data
  4. Group = www-data
  5. Listen =/var/run/php5-fpm.sock

Download and install linux-dash.

 
  1. $ Git clone https://github.com/afaqurk/linux-dash.git
  2. $ Sudo cp-r linux-dash // var/www/
  3. $ Sudo chown-R www-data: www-data/var/www

Restart Nginx and php-fpm to complete installation.

 
  1. $ Sudo service php5-fpm restart
  2. $ Sudo service nginx restart
Set linux-dash on CentOS, Fedora, and RHEL

On CentOS, you must first enable the EPEL Repository

Install Nginx and php-fpm components.

 
  1. $ Sudo yum install git nginx php-common php-fpm

Configure Nginx for the linux-dash program. Create/etc/nginx/conf. d/linuxdash. conf as follows.

 
  1. $ Sudo vi/etc/nginx/conf. d/linuxdash. conf
 
  1. Server {
  2. Server_name $ domain_name;
  3. Listen 8080;
  4. Root/var/www;
  5. Index index.html index. php;
  6. Access_log/var/log/nginx/access. log;
  7. Error_log/var/log/nginx/error. log;
  8.  
  9. Location ~ *\.(? : Xml | ogg | mp3 | mp4 | ogv | svg | svgz | eot | otf | woff | ttf | css | js | jpg | jpeg | gif | png | ico) $ {
  10. Try_files $ uri = 404;
  11. Expires max;
  12. Access_log off;
  13. Add_header Pragma public;
  14. Add_header Cache-Control "public, must-revalidate, proxy-revalidate ";
  15. }
  16.  
  17. Location/linux-dash {
  18. Index index.html index. php;
  19. }
  20.  
  21. # PHP-FPM via sockets
  22. Location ~ \. Php (/| $ ){
  23. Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
  24. Fastcgi_split_path_info ^ (. +? \. Php) (/. *) $;
  25. Fastcgi_pass unix:/var/run/php-fpm.sock;
  26. If (! -F $ document_root $ fastcgi_script_name ){
  27. Return 404;
  28. }
  29. Try_files $ uri // index. php? $ Args;
  30. Include fastcgi_params;
  31. }
  32. }

Next, edit/etc/php-fpm.d/www. conf to configure php-fpm. In this file, make sure to edit the "user", "group", and "listen" fields as follows. You do not need to change the remaining configurations.

 
  1. $ Sudo vi/etc/php-fpm.d/www. conf
  2. Listen =/var/run/php-fpm.sock
  3. User = nginx
  4. Group = nginx

Download and install linux-dash at/var/wwwx.

 
  1. $ Git clone https://github.com/afaqurk/linux-dash.git
  2. $ Sudo cp-r linux-dash // var/www/
  3. $ Sudo chown-R nginx: nginx/var/www

Finally, restart Nginx and php-fpm, and set the auto-start mode.

 
  1. $ Sudo service php-fpm restart
  2. $ Sudo service nginx restart
  3. $ Sudo chkconfig nginx on
  4. $ Sudo chkconfig php-fpm on

In this example, we have configured linux-dash to use TCP port 8080. Make sure that the firewall does not block TCP port 8080.

Use linux-dash to monitor Linux machines

To access linux-dash in a web browser, you only need to enter http :// : 8080/linux-dash/

The following is linux-dash. The web panel contains several widgets, each of which displays the system parameters of the feature. You can re-arrange and/or close some widgets to customize the appearance of the web panel. Here is a demo site of the linux-dash creator.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.