• Aucun résultat trouvé

Hardware Information

Dans le document Administration UNIX (Page 92-96)

UNIX Administration Starters

3.3 System Information

3.3.2 Hardware Information

It is logical to want to upgrade your UNIX system to improve its overall performance. The first thing you need to know is the current hardware configuration of the UNIX system: how many CPUs are installed? How much memory is used? What is the size of the disk space?

These simple questions are very common, and the UNIX administrator always addresses them.

A partial answer can be obtained with the UNIX command top. The top command lists the top-most CPU-consuming processes. The command is extremely instrumental in performance measurement and the tracing of potential problems. However, the command

also displays basic data about the number of CPUs and memory usage, which is what we are looking for right now. An example follows:

# top

System: mekong Mon Jul 17 22:51:28 2000

Load averages: 0.91, 0.77, 0.75 199 processes: 197 sleeping, 2 running CPU states:

CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS

0 0.83 1.0% 0.0% 1.4% 97.6% 0.0% 0.0% 0.0% 0.0%

1 0.99 75.2% 0.0% 24.8% 0.0% 0.0% 0.0% 0.0% 0.0%

avg 0.91 38.0% 0.0% 13.1% 48.8% 0.0% 0.0% 0.0% 0.0%

Memory: 49676K (40972K) real, 100316K (83172K) virtual, 196720K free Page# 1/19

CPU TTY PID USER PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND

NAME

1 q2 27047 cbw1 239 20 4740K 968K run 173:59 99.09 98.92 udt

0 ? 398 root 154 20 108K 140K sleep 1324:09 0.93 0.93 syncer

0 ? 7448 rpsc 168 20 4484K 696K sleep 35:57 0.89 0.89 udt

0 p1 8405 root 178 20 1260K 340K run 0:00 0.85 0.49 top

0 ? 6948 root 155 2 6288K 6340K sleep 28:49 0.41 0.41 lcp

. . . . . .

It is also a good idea to try using the available system administration tools, like the HP-UX flavored SAM, or AIX flavored SMIT. These always provide hardware-related information among their many other menu selections. They are very well suited to this purpose, because a search for hardware information is almost always interactive.

Otherwise, each UNIX flavor provides a different set of commands used to diagnose the installed hardware. We will discuss some of them.

3.3.2.1 The HP-UX ioscan Command

On the HP-UX platform, the special command ioscan is available for dealing with actual hardware. The command scans system hardware, usable I/O system devices, or kernel I/O system data structures, as appropriate, and lists the results. For each hardware module on the system, ioscan displays (by default) the hardware path to the hardware module, the class of the hardware module, and a brief description of it.

By default, the ioscan command scans the system and lists all reportable hardware found. The types of hardware reported include processors, memory, interface cards, and I/O devices. Entities that cannot be scanned are not listed.

The ioscan command recognizes the following options:

-C class Restricts the output listing to those devices belonging to the specified class

-d driver Restricts the output listing to those devices controlled by the specified driver

-f Generates a full listing, displaying the module’s class, instance number, hardware path, driver, software state, hardware type, and a brief description

-F Produces a compact listing of fields separated by colons

-H hw_path Restricts the scan and output listing to those devices connected at the specified hardware path

-I instance Restricts the scan and output listing to the specified instance -k Scans kernel I/O system data structures instead of the actual hardware

and lists the results

-n Lists device file names in the output; only special files in the /dev directory and its subdirectories are listed

-u Scans and list usable I/O system devices instead of the actual hardware.

Usable I/O devices are those having a driver in the kernel and an assigned instance number.

Some of the options require additional arguments, known as fields, which are defined as follows:

class A device category, for example: disk, printer, or tape

instance The instance number associated with the device or card; it is a unique number assigned to a card or device within a class

hw_path A numerical string of hardware components, noted sequentially from the bus address to the device address; typically, the initial number is appended by slash (“/”), to represent a bus converter (if required by the machine), and subsequent numbers are separated by periods (”.”). Each number represents the location of a hardware component on the path to the device.

driver The name of the driver that controls the hardware component The following example shows a partial output of the ioscan command:

# /usr/sbin/ioscan

H/W Path Class Description

bc

8 bc I/O Adapter

10 bc I/O Adapter

10/0 ext_bus GSC built-in Fast/Wide SCSI Interface

10/0.5 target

10/0.5.0 disk SEAGATE ST15150W

10/0.6 target

10/0.6.0 disk SEAGATE ST15150W

10/0.7 target

10/0.7.0 ctl Initiator

10/4 bc Bus Converter

10/4/0 tty MUX

10/4/12 ext_bus HP 28696A-Wide SCSI ID = 7

10/4/12.12 target

10/4/12.12.0 disk SEAGATE ST32550W

. . . . . . . . . . . .

10/12/5.0 target

10/12/5.0.0 tape HP C1533A

10/12/5.2 target

10/12/5.2.0 disk TOSHIBA CD-ROM XM-5401TA

10/12/5.7 target

10/12/5.7.0 ctl Initiator

3.3.2.2 The Solaris prtconf Command

On the Solaris platform, the prtconf command displays the system configuration information.

The output includes the total amount of memory and the configuration of system peripherals formatted as a device tree.

The prtconf command has several options:

-P Includes information about pseudo devices; by default, information regarding pseudo devices is omitted

-v Specifies verbose mode

-F Returns the device pathname of the console frame buffer, if one exists. If there is no frame buffer, prtconf returns a non-zero exit code

-p Displays information derived from the device tree provided by the firmware (PROM)

-V Display platform-dependent information

-D For each system peripheral in the device tree, displays the name of the device driver used to manage the peripheral

The following example presents a partial output of the command running on a Sun4/65 series machine:

# /usr/sbin/prtconf

System configuration: Sun Microsystems sun4c Memory size: 16 megabytes

System peripherals (software nodes):

Sun 4_65

options, instance #0 zs, instance #0 zs, instance #1 fd (driver not attached) audio (driver not attached) sbus, instance #0 dma, instance #0 esp, instance #0 sd (driver not attached) st (driver not attached) sd, instance #0

sd, instance #1 (driver not attached) . . .

. . . le, instance #0

cgsix (driver not attached) auxiliary-io (driver not attached) interrupt-enable (driver not attached) memory-error (driver not attached) counter-timer (driver not attached) eeprom (driver not attached) pseudo, instance #0

10/12/6 lan Built-in LAN

10/12/7 ps2 Built-in Keyboard/Mouse

32 processor processor

34 processor processor

49 memory Memory

The output of the prtconf command is highly dependent upon the version of the PROM installed in the system. The output will be affected in potentially all circumstances.

The “driver not attached” message means that no driver is currently attached to that specific device. In general, drivers are loaded and installed (and attached to hardware instances) on demand and when needed, and may be uninstalled and unloaded when the device is not in use.

3.3.2.3 The Solaris sysdef Command

Another Solaris command that can be used for this purpose is sysdef. The sysdef command outputs the current system definition in tabular form. It lists all hardware devices, as well as pseudo devices, system devices, loadable modules, and the values of selected kernel tunable parameters. It generates the output by analyzing the named bootable operating system file (namelist) and extracting the configuration information from it. The default system namelist is /dev/kmem. However, the command output is not entirely comprehen-sive for figuring out basic hardware information; it is more suitable for kernel-related information. This command should probably not be the first choice.

Dans le document Administration UNIX (Page 92-96)