Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Linfo to display server health under Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to use Linfo under Linux to display the operation of the server. I hope you will get something after reading this article. Let's discuss it together.

Linfo is a free and open source cross-platform server statistics UI or library, which can display a large amount of system information. Linfo is extensible, and through composer, it is easy to use the PHP5 library to programmatically obtain rich system statistics from PHP applications. It has Web UI and its Ncurses CLI view and is available on Linux, Windows, BSD, Darwin/Mac OSX, Solaris, and Minix systems.

The system information displayed by Linfo includes CPU type / speed, server architecture, mount point usage, hard disk / fiber / Flash drives, hardware devices, network devices and statistics, elapsed time / start date, hostname, memory usage (RAM and swap), temperature / voltage / fan speed and RAID array, etc.

Environmental requirements: PHP 5.3pcre extensions Linux-/ proc and / sys are mounted and readable to PHP. It has been tested in the 2.6.x/3.x kernel how to install Linfo server statistics UI and libraries in Linux.

First, create the Linfo directory under the Web root of Apache or Nginx, then use the rsync command shown below to clone the repository file and move it to the directory / var/www/html/linfo:

$sudo mkdir-p / var/www/html/linfo$ git clone git://github.com/jrgp/linfo.git$ sudo rsync-av linfo/ / var/www/html/linfo/

Next, rename sample.config.inc.php to config.inc.php. This is the configuration file for Linfo, where you can define the values you want:

$sudo mv sample.config.inc.php config.inc.php

Now, open the link http://SERVER_IP/linfo in the Web browser to view the Web UI, as shown in the screenshot below.

As you can see from the screenshot, Linfo shows system kernel information, hardware composition, RAM statistics, network devices, drives, and file system mount points.

Linux server operation information

You can add the following line to the configuration file config.inc.php so that you can see the error message when troubleshooting.

$settings ['show_errors'] = true; runs Linfo in Ncurses mode

Linfo has a simple ncurses-based interface that relies on php's ncurses extension.

# yum install php-pecl-ncurses [on CentOS/RHEL] # dnf install php-pecl-ncurses [on Fedora] $sudo apt-get install php5-dev libncurses5-dev [on Debian/Ubuntu]

Now, compile the php extension as follows:

$wget http://pecl.php.net/get/ncurses-1.0.2.tgz$ tar xzvf ncurses-1.0.2.tgz$ cd ncurses-1.0.2$ phpize # generate configure script$. / configure$ make$ sudo make install

Next, if the php extension is successfully compiled and installed, run the following command:

$sudo echo extension=ncurses.so > / etc/php5/cli/conf.d/ncurses.ini

Verify ncurse:

$php-m | grep ncurses

Now, run Info:

$cd / var/www/html/linfo/$. / linfo-cursesLinux server information

The following features are missing in Info:

Support more Unix operating systems (such as Hurd, IRIX, AIX and HP UX, etc.) support lesser-known operating system Haiku/BeOS additional features / extensions support htop features in ncurses mode after reading this article, I believe you have some understanding of "how to use Linfo to display server health under Linux". If you want to know more about it, welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report