How to build a Web-based lightweight monitoring system on Linux?

Source: Internet
Author: User
Sometimes, as common users and system administrators, we need to know how our system runs. You only need to check the log files generated by the activity service to solve many problems related to the system status. However, it is not easy to check every part of the log file, even if the label: monitoring system sometimes, whether as a common user or a system administrator, we need to know how our system runs. You only need to check the log files generated by the activity service to solve many problems related to the system status. However, it is not easy to check every part of the log file, even for experienced system administrators. This is why system administrators often rely on monitoring software, which can collect information from different information sources and adopt easy-to-interpret formats, ratios, visualization, and statistical data, and report analysis structures.

There are many advanced monitoring system software on the market, such as Cacti, Nagis, Zabbix and Munin. This article focuses on a lightweight monitoring tool named Mnitrix designed to monitor system resources and many well-known third-party applications on Linux/BSD servers. Mnitrix has been optimized and can run on embedded systems with limited resources; it claims to be small and simple and occupies few memory resources. It also comes with a built-in HTTP server to provide a Web-based interface. RRDtl can be used to save statistics on time series, which can be easily used in combination with any scripting language, for example, Perl, Pythn, shell scripts, and Ruby.

Main features

The main features of Mnitrix are listed below. For more information, see its official website (http://www.mnitrix.rg/features.html ).

  • Display system load and system service requirements
  • Display CPU/GPU temperature sensors
  • Displays the disk temperature and health status.
  • Displays network/port traffic and netstat statistics
  • Display Mail statistics
  • Displays statistics on Web servers (Apache, Nginx, and Lighttpd)
  • Display MySQL load and statistics
  • Show Squid proxy statistics
  • Display statistics on NFS servers/clients
  • Show Raspberry Pi sensor statistics
  • Display Memcached statistics

Install and configure Mnitrix on Fedra, CentS, or RHEL

First, install the required package. Note: On CentS, you must first install the EPEL software library and Repfrge software library.

 
  1. ___FCKpd___0nbsp;sud yum install rrdtl rrdtl-perl perl-libwww-perl 
  2. perl-MailTls perl-MIME-Lite perl-CGI perl-DBI perl-XML- 
  3. Simple perl-Cnfig-General perl-HTTP-Server-Simple perl-I 
  4. -Scket-SSL 

After completing this step, you can use the following command to install Mnitrix:

 
  1. ___FCKpd___1nbsp;sud yum install mnitrix 

To configure Mnitrix, open the configuration file in/etc/mnitrix. cnf and change related options. For more information about the Mnitrix configuration file, visit http://www.mnitrix.rg/dcumentatin.html.

By default, the built-in HTTP server listening port 8080 is used. Therefore, make sure that your firewall does not block TCP port 8080.

To start Mnitrix, just type the following command:

 
  1. ___FCKpd___2nbsp;sud service mnitrix start 

Start your common Web browser and enter http :// : 8080/mnitrix to access the Mnitrix Web interface.

Install and configure on Archlinux

On Archlinux, you can download the Mnitrix package (https://aur.archlinux.rg/packages.php? ID = 33911 ).

By default, the built-in HTTP server is disabled on Archlinux. To enable the built-in HTTP server, edit Section, as shown below.

 
  1.  
  2. enabled = y 
  3. hst = 
  4. prt = 8080 
  5. user = nbdy 
  6. grup = nbdy 
  7. lg_file = /var/lg/mnitrix-httpd 
  8. hsts_deny = 
  9. hsts_allw = 
  10.  
  11. enabled = n 
  12. msg = Mnitrix: Restricted access 
  13. htpasswd = /var/lib/mnitrix/htpasswd 
  14.  
  15.  

Finally, start the Mnitrix service.

Open your common Web browser and go to http :// : 8080/mnitrix to access Mnitrix.

Install and configure Mnitrix on Debian and Ubuntu

For the Debian series, Mnitrix can be installed manually or through a third-party software library.

Manual installation (for Debian)

First install all dependency packages.

 
  1. ___FCKpd___4nbsp;sud apt-get install rrdtl perl libwww-perl libmailt 
  2. ls-perl libmime-lite-perl librrds-perl libdbi-perl libxm 
  3. l-simple-perl libhttp-server-simple-perl libcnfig-genera 
  4. l-perl libi-scket-ssl-perl 

Download the mnitrix package from http://www.mnitrix.rg/dwnlads.htmland install the license.

 
  1. ___FCKpd___5nbsp;sud dpkg -i mnitrix*.deb 

During the installation process, you may be required to configure the backend Web server. If you use the Apache server, you must restart the Apache service and reload the Apache configuration.

 
  1. ___FCKpd___6nbsp;sud service apache2 relad 

Install through software library (for Ubuntu)

Enable the Izzysft software library by attaching the following line to/etc/apt/surce. list.

 
  1. deb http://apt.izzysft.de/ubuntu generic universe 

Download the software library and add a GPG key.

 
  1. ___FCKpd___8nbsp;wget http://apt.izzysft.de/izzysft.asc 
  2. ___FCKpd___8nbsp;sud apt-key add izzysft.asc 

Install Mnitrix with the apt-get command. All dependency packages are automatically installed together.

 
  1. ___FCKpd___9nbsp;sud apt-get update 
  2. ___FCKpd___9nbsp;sud apt-get install mnitrix 

Finally, start the Mnitrix service.

 
  1. ___FCKpd___10nbsp;sud service mnitrix start 

To configure Mnitrix, use the text editing tool to edit/etc/mnitrix. cnf and restart the Mnitrix service.

 
  1. ___FCKpd___11nbsp;sud service mnitrix restart 

For Ubuntu, Mnitrix's built-in Web server is enabled by default. To access Web-based monitoring results, go to http :// 8080/mnitrix.

Install and configure Mnitrix on the Raspberry Pi

If you want to install Mnitrix on the Debian-based Raspberry Pi, you cannot use the above Izzysft software library because it does not provide the Mnitrix ARM port. You should follow the manual installation steps based on Debian, as shown below.

First, install the required package.

 
  1. ___FCKpd___12nbsp;sud apt-get install rrdtl perl libwww-perl libmailt 
  2. ls-perl libmime-lite-perl librrds-perl libdbi-perl libxm 
  3. l-simple-perl libhttp-server-simple-perl libcnfig-genera 
  4. l-perl libi-scket-ssl-perl 

If some required packages are not installed, we need to use this command to forcibly install them.

 
  1. ___FCKpd___13nbsp;sud apt-get -f install 

Download the mnitrixpackage (mnitrix_x.x.x-izzy1_all.deb) from http://www.mnitrix.rg/dwnlads.html ).

Use the following command to install the Mnitrix package.

 
  1. ___FCKpd___14nbsp;sud dpkg -i mnitrix_x.x.x-izzy1_all.deb 

After the installation is complete, we need to change a small part of the Mnitrix configuration, as shown below.

Use your frequently used text editing tool to open/etc/mnitrix. cnf. Scroll down until you find . Search for & qut; raspberrypi = n & qut; and replace & qut; n & qut; with & qut; y & qut ;. This will enable this function: monitor the clock frequency, temperature, and voltage of the Raspberry Pi.

After editing, restart the Mnitrix service.

 
  1. ___FCKpd___15nbsp;sud service mnitrix restart 

By default, Mnitrix's built-in HTTP Web server is enabled. To access the Mnitrix Web interface, go to http :// : 8080/mnitrix.

Mnitrix screen (on Raspberry Pi)

Mnitrix home screen:

Average system load data and usage in graphical format:

Active process graphics:

Select & qut; Clck Frequency & qut; (clock Frequency) under & qut; Raspberry Pi & qut; in the home screen ), you will see the Raspberry Pi clock frequency, temperature, voltage, and other graphics.

All metric charts:

Link: http://xmdul.cm/2014/05/web-based-lightweight-system-mnitr-linux.html

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.