Use GkrellM to monitor Linux network servers

Source: Internet
Author: User
Article Title: Use GkrellM to monitor Linux network servers. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Linux is an open-source and freely-transmitted UNIX-like operating system. It is mainly used on Computers Based on Intel x86 series CPUs. The TCP/IP protocol, as an important means of connecting Internet technologies and different hosts, has been developed and developed on Unix and has been well inherited in Linux systems. This makes TCP/IP an integral part of the Linux system. In addition, Linux also supports all common network communication protocols, including NFS, DCE, IPX/SPX, SLIP, and PPP, so that the Linux system can easily communicate with existing host systems, and various Wan and LAN connections. Linux has developed rapidly based on the Internet. Therefore, it is natural that Linux has powerful network functions. It can be easily integrated with TCP/IP, LAN Manager, Windows for Workgroups, Novell Netware, or Windows NT/2000/2003 networks, or connected to the Internet through Ethernet or modem. Linux is widely used, especially in network applications.
  
A large number of network servers use the Linux operating system. To fully measure the network running status, you must be able to perform more detailed and accurate measurements on the network status. The establishment of the SNMP protocol provides powerful support for Internet measurement, simple Network Management Protocol (SNMP) has actually become the core standard. Because SNMP was initially proposed to solve the management problem of routers on the Internet, many people think that SNMP runs on the IP protocol because the Internet runs the TCP/IP protocol. But in fact, the design of SNMP is not related to the Protocol, so it can be used in IP, IPX, AppleTalk, OSI and other transmission protocols. GKrellM is a typical SNMP-based network traffic statistical analysis tool. GKrellM consumes a small amount of system resources, so many plug-ins are also attached.
  
How GKrellM works
  
The Linux system provides administrators with an excellent way to change the kernel while the system is running, without the need to reboot the kernel/system. This is achieved through the/proc Virtual File System. The/proc file virtual system is a mechanism used by the kernel and kernel module to send information to the process (so it is called/proc ). This pseudo file system allows you to interact with the internal data structure of the kernel to obtain useful information about the process. on the fly, you can change the settings (by changing the kernel parameters ). Unlike other file systems,/proc exists in the memory rather than on the hard disk. You can view the system information without restarting CMOS. This is one of the highlights of/proc. First, take a look at the author's/proc directory snapshot (Redhat Linux 8.0) as shown in figure-1:
  
   
  
Figure-1/proc directory Snapshot
  
Below we will introduce the main file content in the/proc directory, as shown in table-1:
  
Main contents of table-1/proc directory
  
   
  
For each Linux system, the content of the/proc Virtual File System varies depending on the hardware and software. The/proc virtual file system has three important directories: net, scsi, and sys. The Sys directory is writable and can be used to access or modify kernel parameters. net and scsi depend on Kernel configuration. For example, if the system does not support scsi, the scsi directory does not exist. In addition to the above descriptions, there are also some directories named by numbers, which are process directories. The. net directory contains multiple Network pseudo files in ASCII format, which describe part of the network layer. You can use commands such as arp, netstat, and route to query these files.
  
Generally, the/proc file system provides the following five main functions:
  
1. Process Information: For any process in the system, there is a process ID with the same name in the proc subdirectory. You can find the following information: Restore Line, mem, root, stat, statm, and status. Some information is only visible to super users, such as the process root directory. There are some available dedicated links to each process that contains existing process information. For any process in the system, there is a separate self-link pointing to the process information. It is used to obtain command line information from a process.
  
2. System Information: If you need to know the overall system information, you can also obtain it from/proc/stat. It includes: CPU usage, disk space, Memory Page, memory swap, all interruptions, touch switch, and the last System Auto-lifting time.
  
3. CPU information: using the/proc/cpuinfo file, you can obtain the current accurate information of the central processor.
  
4. Load information: The/proc/loadavg file contains the system load information.
  
5. system memory information: The meminfo file contains detailed information about the system memory. It displays the number of physical memory, the number of available swap space, the number of idle memory, and so on.
  
For example, to obtain the system load information, you only need to do this:
  
Cat/proc/loadavg2.28 1.17 0.46 3/85 2677
  
Load indicates the extent to which the system is used. The first is the highest utilization rate, the second is the average utilization rate, and the last is the lowest utilization rate. The average value is the most useful. Next, the number of running tasks and total number of tasks are displayed, and the last used process number is displayed. The space delimiter displayed by the cat command is a nul separator.
  
The above is a command line monitoring method. GKrellM is a system monitor that supports the/proc file system. Work in the KDE Desktop Environment. It can display host name, time/date, cpu usage (supports multi-processor and motherboard Temperature Detection), disk usage status; Internet usage monitoring, can monitor ftp, http .. connection status, using different colors to differentiate system input/output data, as well as email detection. In addition to Linux systems, GkrellM also supports FreeBSD, Mac OS X, NetBSD/OpenBSD, and Solaris.
  
1. system requirements:
  
Hardware: CPU: compatible with Intel X86 processor PentiumII 400 or above, 64 MB (128 MB recommended) memory, 350 MB or more hard disk space, Display memory 4 MB.
  
Software: kernel version is based on 2.4 or above, KDE3.0 or above, X Window System XFree86 3.6.x or above, desktop resolution is at least 640 × 480, Desktop color is at least 60 thousand colors (16 bits ).
  
Download: According to your Linux release download related software, the author uses: gkrellm-0.10.5-1.i386.rpm (Redhat Lnux 8.0) software home page: http://web.wt.net /~ Billw/gkrellm/gkrellm.html
  
2. Preparations before installation:
  
GKrellM is written in Perl language, and uses gdk, gtk and glib, the server already contains the following software: perl (perl-5.0xx or above) gdk (1.1.3-xx or above) glib 2.0 and snmp.
  
Run RPM to confirm the method:
  
Rpm-qa | grep perl
Rpm-qa | grep glib
Rpm-qa | grep gdk
Rpm-qa | grep gtk
Rpm-qa | grep snmp
  
3. installation:
  
Rpm-ivh gkrellm-0.10.5-1.i386.rpm
  
4. create shortcuts
  
To create a shortcut on the desktop, right-click the desktop and choose new "application link". Add/usr/bin/gkrellm to the execution menu.
  
5. Run the software:
  
./Usr/bin/gkrellm
  
Before Running GkrellM for real-time monitoring, press the "F 1" key to configure the hardware and network conditions of your Linux server to display the data you are concerned about. See figure-2:
  
   
  
Figure 2 configuration before software running
  
As shown in figure-1, the GkrellM software can monitor almost all the key components of the Linux system. After the configuration is complete, click the "Apply" button and GkrellM starts running immediately, the running result is shown in figure-2.
  
  
  
Figure-3 Linux Server monitoring by GkrellM
  
From figure 3, we can clearly monitor the Linux server running time, the load of each CPU, the temperature, the Proc file system usage, the system temperature, the CPU fan speed, and the CPU core voltage in real time, input voltage, hard disk usage, network interface (NIC and Modem) status, memory (including virtual memory),/usr directory, and whether new emails exist. Is GkrellM indeed a good helper for network administrators? Basically, all inbound and outbound traffic, host information network, and network interface statuses are invisible, and its system resource usage is relatively low. In addition, GkrellM also supports plug-ins and the function of changing the display color. However, I do not recommend you use these features. A plug-in of GkrellM has a security vulnerability and changing the display color will also occupy system resources.
  
Summary
  
Total data traffic of network servers (total data transfer of network cards), and packet transfer rate (or traffic) of CPU usage and special services ), network administrators must pay attention to this because when the CPU usage of the host is too high, the system may be unstable, and when the traffic changes abnormally, note that some hackers may be trying to steal our information. In terms of network management, it is necessary to know the network traffic status of our Linux server and limit or increase the bandwidth based on the traffic.

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.