Name

prtdiag — display system diagnostic information

Synopsis

prtdiag [-f] [-h] [-V] [-t types]

Description

prtdiag displays system configuration and diagnostic information on Linux systems.

Especially on x86 platforms many information is aquired by reading the appropriate values from BIOS using dmidecode(8) and biosdecode(8) from the dmidecode package, which require super user privileges. Therefore this script should be run as super user (aka root).

Furthermore this script utilizes the sysfs of Linux 2.6.x or better kernels, especially for retrieving SCSI and hardware sensor information. It expects the sysfs to be mounted on the /sys directory. NOTE: This script does not try to setup or load any hardware monitoring kernel modules - so the lm_sensors utilities are not used. However you may use its sensors-detect(8) as well as the i2c-detect(8) utilities to find out, which modules are appropriate for your hardware and how to load them automatically at startup.

Options

-f

display all temperatures values in Fahrenheit instead of Celsius.

-h

display a short usage summary and exit.

-H

Do not display the report header (which usually consists of the hostname and time of execution of the script).

-V

display version and copryright information and exit.

-t types

A simple string, which indicates, what system information should be displayed. The following letters are honored:

g

general platform

c

CPUs

p

PCI (especially IO) devices

i

IDE devices

s

SCSI devices

m

memory devices

e

environment (i.e. fan speeds, temperatures, voltages)

b

BIOS/PROM version

a

all (default)

Output Customization

Motherboards vary widely in the connections to sensor chips. There is no standard that ensures, for example, that the second temperature sensor is connected to the CPU, or that the second fan is on the CPU. Also, some values reported by the chips need some computation before they make full sense. For example, most chips can only measure voltages between 0 and +4V. Other voltages are scaled back into that range using external resistors. Since the values of these resistors can change from motherboard to motherboard, the conversions cannot be hard coded into the driver and have to be done in user space.

So for customizing values conversion and labels you may use the configuration file /etc/prtdiag.conf and/or ~/.prtdiag.conf, whereby the first file is considered to be system wide customization and the second customization by the user, which runs the script. The latter one may overwrite all values from the first one.

A customfile is a simple Korn shell scriptlet, which will be sourced in from the prtdiag script (so make sure, you are using korn shell syntax). It honors the following associative array variables:

FAN_SRC[sensor]

a string containing a comma separated list of source names to apply to fan sensors.

TEMP_SRC[sensor]

a string containing a comma separated list of source names to apply to temperature sensors.

VOLT_SRC[sensor]

a string containing a comma separated list of source names to apply to voltage sensors.

FAN_FACTOR[sensor]

factors to apply to fan sensor outputs

TEMP_FACTOR[sensor]

factors to apply to temperature sensor outputs

VOLT_FACTOR[sensor]

factors to apply to voltage sensor outputs

FAN_OFFSET[sensor]

offset in °C to apply to fan sensor outputs

TEMP_OFFSET[sensor]

offset to apply to temperature sensor outputs

VOLT_OFFSET[sensor]

offset to apply to voltage sensor outputs

FAN_IGNORE[sensor]

hide fan sensor outputs marked with a non-empty value

TEMP_IGNORE[sensor]

hide temperature sensor outputs marked with a non-empty value

VOLT_IGNORE[sensor]

hide voltage sensor outputs marked with a non-empty value

sensor is the actual name of the sensor, which provides the meassured value (e.g. it8712). The values of the variables are applied in the same order, as the associated sensor output gets displayed, when no value is hidden. If no value or an empty string is provided, the default value will be used, i.e. for *_SRC a generic name, for *_FACTOR the value 1.0, for *_OFFSET the value 0.0 and for *_IGNORE an empty string. A factor gets always applied first to the sensor output, after that the offset gets applied, i.e. finalValue = value * factor + offset.

Examples

Without any customization, the environmental output for a GA-7N400 Pro2 Rev. 1.x motherboard may read:

Sensor        RPM   Source
----------  ------  ----------------
it8712        2678  Fan 0
it8712           0  Fan 1
it8712        2083  Fan 2

Sensor        °C    Source
----------  ------  ----------------
it8712        44.0  Temp 0
it8712        44.0  Temp 1
it8712        70.0  Temp 2

Sensor       Volt   Source
----------  ------  ----------------
it8712        1.71  CPU #1 (Vcor1)
it8712        2.70  CPU #2 (Vcor2)
it8712        3.28  +3.3V
it8712        2.50  +5V
it8712        3.01  +12V
it8712        1.52  -12V
it8712        1.34  -5V
it8712        2.69  Standby
it8712        4.08  Battery

The study of the /usr/doc/linux-`uname -r`/Documentation/hwmon/it87 as well as the /etc/sensors.conf file and Gigabyte support web pages may lead to the following customizations:

TEMP_SRC[it8712]="Case,Motherboard,CPU"
VOLT_SRC[it8712]="CPU (VCore),RAM (VDimm)"
FAN_SRC[it8712]="CPU Fan,System Fan,Power Fan"
VOLT_FACTOR[it8712]=",,,1.68,4.0,-7.2,-5.6,1.68,"
# not sure, what the in8 value represents - so skip it
VOLT_IGNORE[it8712]=",,,,,,,,x"

The corresponding output would read:

Sensor        RPM   Source
----------  ------  ----------------
it8712        2678  CPU Fan
it8712           0  System Fan
it8712        2083  Power Fan

Sensor        °C    Source
----------  ------  ----------------
it8712        44.0  Case
it8712        44.0  Motherboard
it8712        70.0  CPU

Sensor       Volt   Source
----------  ------  ----------------
it8712        1.70  CPU (VCore)
it8712        2.72  RAM (VDimm)
it8712        3.28  +3.3V
it8712        4.19  +5V
it8712       12.03  +12V
it8712      -10.94  -12V
it8712       -7.53  -5V
it8712        4.52  Standby

See Also

dmidecode(8), biosdecode(8), lsmod(8), modprobe(8), sensors-detect(8), i2c-detect(8)

Files

/sys

the directory, where the kernel 2.6.x or better sysfs filesystem is mounted

/proc

the directory, where the kernel 2.4.x or better procfs filesystem is mounted.

/lib/modules/`uname -r`/kernel/drivers/hwmon

available hardware monitoring kernel modules for your system. In case you get no information about fans, temperatures or voltages, you may try to modprobe them sequentially until prtdiag displays something (might be dangerous on IBM Thinkpads!).

/etc/prtdiag.conf

system wide customization scriptlet for fan, temperature and voltage labels as well adjustments to their values.

~/.prtdiag.conf

users customization scriptlet for fan, temperature and voltage labels as well adjustments to their values.

/usr/doc/kernel-`uname -r`/Documentation/hwmon

Documentation for available harware monitoring kernel modules, what they are able to report and how to adjust values to human understandable values.

NOTES

This script requires a Korn shell (ksh) 93 from AT&T Research Lab. Some Linux distributors are not aware of the fact, that the other implementations of the ksh, e.g. like pdksh (public domain ksh) are NOT compatible with the Korn shell and unknowingly link them to ksh, i.e. make the system think, that the Korn shell is installed (check with 'ls -al /bin/ksh'). If this is the case on your platform, please inform your distributor about this flaw and install the real Korn shell from AT&T Research lab.

dmidecode version 2.8 or less are not yet adjusted to the SMBIOS specification 2.5. Thus it may not recognize the following CPUs: Turion 64, Dual Core Opteron, Athlon 64 X2, Celeron D, Pentium D, Pentium EE. Furthermore FB-DIMMs and some other, prtdiag unrelevant data are not recognized. In this case ask your Linux distributor to apply the dmidecode SMBIOS 2.5 patch.

The latest version of this utility might be found in the Linux prtdiag download directory.

The development of this script was inspired by the Sun Solaris prtdiag utility.

Copyright

Copyright © 2007 Jens Elkner (jel+prtdiag@cs.uni-magdeburg.de).

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.