Computer systems are constructed by software systems and hardware systems. Detecting hardware status is very important to ensure the stability of the entire system. Whether the operating system uses Linux, or Windows, once the hardware fails, the security of the entire system is serious. Here we mainly detect the CPU, hard disk and memory of the computer system running Linux. The central processor status is the central processor is the core hardware of the Linux host. Let's take a look at the Linux root directory: / proc directory content. The files in this directory are actually not stored on the disk. The file system of this directory is called the Proc file system, which is an image of the system kernel. That is to say that the file in this directory is stored in the system memory. It provides an interface to the operation of accessing system kernel data in a file system. User and applications can get system information through / proc, and change certain parameters of the kernel. Since the system information (such as a process) is dynamically changed, the Proc file system is dynamically generated and submitted by dynamic nucleation from the system. The information of the CPU is stored in the "CPUInfo" file. We can also use the following command to view: #cat / proc / cpuinfo The following is the following author's AMD Athlon 1100 as an example:
Processor: 0
Vendor_ID: Authentic AMD
CPU Family: 6
MODEL: 7
Model Name: AMD Athlon (TM) Processor
STEpping: 0
CPU MHz: 1100.046
Cache Size: 64 KB # Cache Capacity #
FDIV_BUG: No # No bug #
HLT_BUG: No # No bug #
F00f_bug: no # No bug #
Coma_bug: no # No bug #
FPU: YES
FPU_EXCEPTION: YES
CPUID Level: 1
WP: YES
Flags: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV
PAT PSE36 MMX FXSR SSE SYSCALL MMXEXT 3DNOWEXT 3DNOW
BOGOMIPS: 2195.45 Be sure that the CPU hardware does not have bugs and is recognized by the system. The above is just the basic situation of the CPU, which we use MBMON software to detect CPUs, 1 for real-time conditions. Software download: http://www.nt.phys.kyushu-u.ac.jp/shimizu/download/xmbmon203.tar.gz, http://www.nt.phys.kyushu-u.ac.jp/shimizu /download/readme-xmbmon203.html. After downloading the software: Readme-XMBMON203PL1.html checks if the software supports your motherboard chip. 2. install software:
Gunzip xmbmon203.tar.gz
TAR XMBMON203.TAR
CD XMBMON203
./configure;make;make install
3. Running software: MBMON can work under the command line and the X window, first check down the author's motherboard:
./mbmon-d
Using Via686 HWM Directly !!
* VIA Chip VT82C686A / B FOUND. The above content indicates that the motherboard chip is VT82C686A / B. The following is running under the command line.
./mbmon
Temp. = 42.1, 33.0, 24.2; Rot. = 5357, 0, 0
Vcore = 1.78, 3.11; Volt. = 3.41, 0.93, 12.19, 0.00, 0.00 showed that the central processor temperature is 42.1, the power supply temperature is 33.0, the main board temperature is 24.2; the CPU fan speed is 5357 rev / min; CPU core voltage It was 1.78 volts and the input voltage was 12.19 volts, 3.41 volts, 4.93 volts. By default, the above is updated for five seconds. MBMON runs under the X window, and the results are shown in Figure 1. ./Xmbmon Figure 1 MBMON runs 4 under the X window. Remote Monitor MBMON latest version also provides remote monitoring features: ./ MBMON-P 22 where "-p 22" indicates that the port 22 is opened, so you can use the Telnet, SSH and other remote tools to connect the Linux host to detect the CPU state. The hard disk track detects that hard drive physical bad track is the most headache in all Linux hardware failures of the hard disk. It lightly makes your Linux computer frequently crafted, and all of you have all the data into a dark. Now the factory hard disk (after 1993) basically supports the automatic detection analysis and reporting technology of Smart (Self Monitoring Analysis and Reporting Technology). SMART technology can monitor the head unit of the hard disk, the disc motor drive system, the hard disk internal circuit, and the disc surface dielectric material. When SMART monitors and analyzes the hard disk, the user will be alarmed to the user to avoid loss of computer data. SMART technology must only take effects on board support, and SMART technology does not guarantee the possible hard disk failure. Smart (SFF-8035i) is an industrial standard established by hard disk manufacturers. This standard is a table that saves a attribute such as execution, reliability, read error rate, etc. on the hard disk. All attributes have a standardized value of 1 Ibyte (size range 1-253), and also contains another 1byte key phase value. If a data in the property table is close to less than or reaches a critical stage value, it indicates that the hard disk is not working properly. Smartmontools is a hard disk detection tool in Linux. Home is http://smartmontools.sourceforge.net, download link: ftp: //fr2.rpmfind.net/linux/sources/smartmontools/smartmontools-5.1-18.i386.rpm. 1. Software installation: RPM-IVH / SmartMontools-5.1-18.i386.rpm Software installation After the / usr / local / directory generates program: SmartCTL, first detect whether the hard disk and the motherboard support SMART technology (see Figure 2). SmartCTL -I / DEV / HDA7 Figure 2 Detection hard disk Support SMART Figure 2 shows the author's hard drive support Smart, model is: ST320414A (Seagate's Cool fish III, 72000 rpm, 2 megabyge caokes). 2. Comprehensive detection of hard drives running the following hard disk detection command: SmartCTL -A / DEV / HDA7 Figure 3 Hard disk physical logic state Figure 3 is the detected hard disk information, the information displayed is different from your hard disk manufacturer, of which 1-202 line representative Different physical properties of the hard disk, the logic status of the hard disk. FLAG is a tag, the standard value (Value) should be less than or equal to the key value (Thresh). When_failed represents the error message, the WHEN_FAILED line in Figure 3 is blank, indicating that the hard disk is not faulty. If the WHEN_FAILD displays a number, it indicates that the hard disk track may have a relatively large bad track.
SmartCTL has more than a dozen parameters, detailed, the following command view: smartctl --help 3. Advanced App We can use crontab command to implement a daily scheduled scan: (1) Build a file, file name Linuxect (name you set): # crontab -e (2) file content: 05 16 * * 5 smartctl -a / DEV / HDA7 uses VI editing after exiting. Add to the task list using the crontab: #crontab Linuxect This system is automatically scanned every Friday at 16:05 per week. Memory detection typically we will think that there is little damage to the wrong damage, and it is considered that if it is broken, it is impossible to start self-test by the motherboard BIOS. In fact, this self-test program has little features, but only detects the capacity speed, many internal existence errors do not detect. If you have a program when you run the program, you will not lose your response from time to time; when you open a file, you can make damage to the file, but you have no problem later ... then you should consider testing your memory. 1. Detect (1) Use the Linux command (1) Use the "free" command to monitor the memory usage in the command line #free
Total Used Free Shared Buffers Cached
MEM: 256024 192284 63740 0 10676 101004
- / buffers / cache: 80604 175420
SWAP: 522072 0 522072 The system of 256MB of RAM and 512MB swap space is given. (2) Make the VMSTAT command to monitor virtual memory usage:
1 0 0 63692 10704 101008 0 0 239 42 126 105 48 45 7 0VMSTAT () command is a universal monitor that is an abbreviation for Virtual Meomory Statistics (virtual memory statistics). If you use the vmstat command, you will receive a one-time report when using the vmstat command. The vmstat commands the main activity type of activity (procs), memory (in kilobytes), swap partition (in kilobytes), input and output from block devices (hard drives), system interrupt (The number of occurrences per second), the central processing unit (CPU) is allocated to the user system and the ratio of the proportion. 2. Use tool software to detect MEMTEST86 is a free memory test software, high test accuracy, and the recessive problem of memory can also be checked. You can download its latest version 3.0 version by http://www.memtest86.com/ page. Download link: http://www.memtest86.com/memtest86-3.0.tar.gz software installation: