How can I remotely monitor Linux servers and desktops from a Web browser?

Source: Internet
Author: User
Tags linux mint
Many methods are available to monitor Linux devices. Although many monitoring solutions for production environments (such as Nagios, Zabbix, and Zenoss) claim to have beautiful user interfaces, monitoring scalability, and comprehensive reporting functions, but these solutions are a big label for us: Linux server Linux desktop remote monitoring when it comes to monitoring Linux devices, there are many ways to choose from. Although many monitoring solutions for production environments (such as Nagios, Zabbix, and Zenoss) claim to have beautiful user interfaces, monitoring scalability, and comprehensive reporting functions, however, these solutions may be of minor use to most of our end users. If you only need to check the basic status of a remote Linux server or desktop system (such as processor load, memory usage, and active processes), consider using Linux-dash.

Linux-dash is a lightweight Web-based monitoring dashboard for Linux systems. it can display various system attributes in real time, such as processor load, memory usage, disk usage, Internet speed, network connection, RX/TX bandwidth, logged-on users, running processes, and so on. Linux-dash does not include any backend servers used to store long-term statistics. You only need to install the linux-dash application on an existing Web server (such as Apache and Nginx servers. This is a fast and simple way to build a remote monitoring mechanism for personal projects.

In this tutorial, I will introduce how to install Linux-dash on the Nginx Web server on the linux platform. With light engines, Nginx Web servers are more popular than Apache Web servers.

Install Linux-dash on Debian, Ubuntu, or linux Mint

First, install the Nginx Web server and the php-fpm component.

 
 
  1. ___FCKpd___0nbsp;sudo apt-get install git nginx php5-json php5-fpm php5-curl 

To Configure Nginx for a linux-dash application, create/etc/nginx/conf. d/linuxdash. conf as follows. In this example, port 8080 is used.

 
 
  1. ___FCKpd___1nbsp;sudo vi /etc/nginx/conf.d/linuxdash.conf 
  2. server { 
  3. server_name     $domain_name; 
  4. listen          8080; 
  5. root            /var/www; 
  6. index           index.html index.php; 
  7. access_log      /var/log/nginx/access.log; 
  8. error_log       /var/log/nginx/error.log; 
  9. location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)___FCKpd___1nbsp;{ 
  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. location /linux-dash { 
  16. index index.html index.php; 
  17. # PHP-FPM via sockets 
  18. location ~ \.php(/|$) { 
  19. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
  20. fastcgi_split_path_info ^(.+?\.php)(/.*)$; 
  21. fastcgi_pass unix:/var/run/php5-fpm.sock; 
  22. if (!-f $document_root$fastcgi_script_name) { 
  23. return 404; 
  24. try_files $uri $uri/ /index.php?$args; 
  25. include fastcgi_params; 

Disable the default site configuration.

 
 
  1. ___FCKpd___2nbsp;sudo rm /etc/nginx/sites-enabled/default 

To configure php-fpm, edit/etc/php5/fpm/pool. d/www. conf. Make sure to edit the following "user", "group", and "listen" commands. The rest of the configuration can be retained.

 
 
  1. ___FCKpd___3nbsp;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 
  6. . . . 

Download and install linux-dash.

 
 
  1. ___FCKpd___4nbsp;git clone https://github.com/afaqurk/linux-dash.git 
  2. ___FCKpd___4nbsp;sudo cp -r linux-dash/ /var/www/ 
  3. ___FCKpd___4nbsp;sudo chown -R www-data:www-data /var/www 

Restart the Nginx Web server and restart the php5-fpm to complete the last step of installation.

 
 
  1. ___FCKpd___5nbsp;sudo service php5-fpm restart 
  2. ___FCKpd___5nbsp;sudo service nginx restart 

Install linux-dash on CentOS, Fedora, or RHEL

On CentOS, this step is required to first enable the EPEL software library (see http://xmodulo.com/2013/03/how-to-set-up-epel-repository-on-centos.html for details.

Install the Nginx Web server and the php-fpm component. BitsCN.com

 
 
  1. ___FCKpd___6nbsp;sudo yum install git nginx php-common php-fpm 

To Configure Nginx for a linux-dash application, you must create/etc/nginx/conf. d/linuxdash. conf, as shown below.

 
 
  1. ___FCKpd___7nbsp;sudo vi /etc/nginx/conf.d/linuxdash.conf 
  2. server { 
  3. server_name     $domain_name; 
  4. listen          8080; 
  5. root            /var/www; 
  6. index           index.html index.php; 
  7. access_log      /var/log/nginx/access.log; 
  8. error_log       /var/log/nginx/error.log; 
  9. location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)___FCKpd___7nbsp;{ 
  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. location /linux-dash { 
  16. index index.html index.php; 
  17. # PHP-FPM via sockets 
  18. location ~ \.php(/|$) { 
  19. fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name; 
  20. fastcgi_split_path_info ^(.+?\.php)(/.*)$; 
  21. fastcgi_pass unix:/var/run/php-fpm.sock; 
  22. if (!-f $document_root$fastcgi_script_name) { 
  23. return 404; 
  24. try_files $uri $uri/ /index.php?$args; 
  25. include fastcgi_params; 

Next, configure php-fpm and edit/etc/php-fpm.d/www. conf for this. In this file, make sure to set fields such as "listen", "user", and "group" as follows. The rest of the configuration is retained.

 
 
  1. ___FCKpd___8nbsp;sudo vi /etc/php-fpm.d/www.conf 
  2. . . . 
  3. listen = /var/run/php-fpm.sock 
  4. user = nginx 
  5. group = nginx 
  6. . . . 

Download linux-dash and install it under/var/www.

 
 
  1. ___FCKpd___9nbsp;git clone https://github.com/afaqurk/linux-dash.git 
  2. ___FCKpd___9nbsp;sudo cp -r linux-dash/ /var/www/ 
  3. ___FCKpd___9nbsp;sudo chown -R nginx:nginx /var/www 

Finally, restart the Nginx Web server, restart php-fpm, and set them to automatically start running as soon as the system starts.

 
 
  1. ___FCKpd___10nbsp;sudo service php-fpm restart 
  2. ___FCKpd___10nbsp;sudo service nginx restart 
  3. ___FCKpd___10nbsp;sudo chkconfig nginx on 
  4. ___FCKpd___10nbsp;sudo chkconfig php-fpm on 

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

Monitor linux machines with Linux-dash

To access linux-dash from a Web browser, you only need to enter http: // in your Web browser :// : 8080/linux-dash /.

Below are several linux-dash screens. The Web dashboard consists of several window components, each of which displays specific system attributes. You can customize the appearance of this Web dashboard by simply reorganizing and/or closing some of the window components. The demo website built by linux-dash developers is http://afaq.dreamhosters.com/linux-dash/. interested readers will not be able to access the website.

Link: http://xmodulo.com/2014/04/monitor-linux-server-desktop-remotely-web-browser.html

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.