`
isiqi
  • 浏览: 16028380 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

linux summary tool

阅读更多

from: http://aspersa.googlecode.com/svn/html/summary.html

svn checkout http://aspersa.googlecode.com/svn/trunk

# Download and run:

wget http://aspersa.googlecode.com/svn/trunk/summary

bash summary

------------------------

The summary tool is a convenient way to summarize the status and configuration of a server, so that you can learn about it at a glance. It is not a tuning tool or diagnosis tool; expert humans are better at that. It produces a report that is easy to 'diff,' and can be pasted into emails without losing the formatting. This tool works well on Linux at this time; other Unix-like operating systems might be supported later.

Command-Line Options and Environment Variables

There are no command-line options. The tool uses environment variables instead of command-line options, because it supports a one-step method of execution that prevents command-line options from working. The ASPERSA_SKIP environment variable can be used to disable specific sections of the tool. This environment variable is a comma-separated list of any or all of the following values: MOUNT,NETWORK,PROCESS. See below for how these affect the output.

How it Works

This tool runs a large variety of commands to inspect system status and configuration, saves the output into files in /tmp, and then runs Unix commands on these results to format them nicely. It works best when executed as a privileged user, but will also work without privileges, although some output might not be possible to generate without root.

Example Usage

This tool can be run one of two different ways:
# Download and run:
wget http://aspersa.googlecode.com/svn/trunk/summary
bash summary

# Or, download and run in a single step:
wget -O- http://aspersa.googlecode.com/svn/trunk/summary | bash

The following is a sample report from the summary tool. Each section is followed by explanatory text.


# Aspersa System Summary Report ##############################
Date | 2010-09-22 18:11:34 UTC (local TZ: PDT -0700)
Hostname | server1
Uptime | 14 days, 22:08, 1 user, load average: 0.00, 0.00, 0.00
System | Dell Inc.; PowerEdge R610; vNot Specified ()
Service Tag | B0ZNVH8
Release | CentOS release 5.2 (Final)
Kernel | 2.6.18-92.1.22.el5
Architecture | CPU = 64-bit, OS = 64-bit
Threading | NPTL 2.5
Compiler | GNU CC version 4.1.2 20071124 (Red Hat 4.1.2-42).
SELinux | Disabled
Virtualized | No virtualization detected

The first section shows the current date and time, and a synopsis of the server and operating system.


# Processor ##################################################
Processors | physical = 2, cores = 8, virtual = 16, hyperthreading = yes
Speeds | 16x2261.089
Models | 16xIntel(R) Xeon(R) CPU E5520 @ 2.27GHz
Caches | 16x8192 KB

This section is derived from /proc/cpuinfo.


# Memory #####################################################
Total | 31.42G
Free | 447.26M
Used | physical = 30.99G, swap = 288.00k, virtual = 30.99G
Buffers | 141.09M
Caches | 23.52G
Dirty | 4280 kB
Used | 6.82G
Swappiness | vm.swappiness = 0
DirtyPolicy | vm.dirty_ratio = 40, vm.dirty_background_ratio = 10
Locator Size Speed Form Factor Type Type Detail
========= ======== ================= ============= ============= ===========
DIMM_A2 4096 MB 1066 MHz (0.9 ns) DIMM {OUT OF SPEC} Synchronous
DIMM_A3 4096 MB 1066 MHz (0.9 ns) DIMM {OUT OF SPEC} Synchronous
DIMM_A5 4096 MB 1066 MHz (0.9 ns) DIMM {OUT OF SPEC} Synchronous
DIMM_A6 4096 MB 1066 MHz (0.9 ns) DIMM {OUT OF SPEC} Synchronous
DIMM_B2 4096 MB 1066 MHz (0.9 ns) DIMM {OUT OF SPEC} Synchronous
DIMM_B3 4096 MB 1066 MHz (0.9 ns) DIMM {OUT OF SPEC} Synchronous
DIMM_B5 4096 MB 1066 MHz (0.9 ns) DIMM {OUT OF SPEC} Synchronous
DIMM_B6 4096 MB 1066 MHz (0.9 ns) DIMM {OUT OF SPEC} Synchronous
DIMM_A1 {EMPTY} Unknown DIMM {OUT OF SPEC} Synchronous
DIMM_A4 {EMPTY} Unknown DIMM {OUT OF SPEC} Synchronous
DIMM_B1 {EMPTY} Unknown DIMM {OUT OF SPEC} Synchronous
DIMM_B4 {EMPTY} Unknown DIMM {OUT OF SPEC} Synchronous

Information about memory is gathered from free . The Used statistic is the total of the rss sizes displayed by ps . The Dirty statistic for the cached value comes from /proc/meminfo. On Linux, the swappiness settings are gathered from sysctl . The final portion of this section is a table of the DIMMs, which comes from dmidecode .


# Mounted Filesystems ########################################
Filesystem Size Used Type Opts Mountpoint
/dev/mapper/VolGroup00-LogVol00 62G 56% ext3 (rw) /
/dev/mapper/VolGroup01-MySQLData00 67G 20% ext3 (rw) /var/lib/mysql
/dev/sda2 190M 11% ext3 (rw) /boot
tmpfs 7.9G 0% tmpfs (rw) /dev/shm

The mounted filesystem section is a combination of information from mount and df . If the ASPERSA_SKIP environment variable includes "MOUNT", then this section is skipped.


# Disk Schedulers And Queue Size #############################
sda | [cfq] 128
sdb | [cfq] 128
sr0 | [cfq] 128

The disk scheduler information is extracted from the /sys filesystem in Linux.


# Disk Partioning ############################################
Device Type Start End Size
============ ==== ========== ========== ==================
/dev/sda Disk 299439751168
/dev/sda1 Part 1 13 98703360
/dev/sda2 Part 14 36404 299317939200
/dev/sdb Disk 429523992576
/dev/sdb1 Part 1 52219 429507671040

Information about disk partitioning comes from fdisk -l .


# Kernel Inode State #########################################
dentry-state | 52867 47869 45 0 0 0
file-nr | 3570 0 3211611
inode-nr | 42968 59

These lines are from the files of the same name in the /proc/sys/fs directory on Linux. Read man proc to learn about the meaning of these files on your system.


# LVM Volumes ################################################
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 269.00G
LogVol01 VolGroup00 -wi-ao 9.75G

This section shows the output of lvs .


# RAID Controller ############################################
Controller | Fusion-MPT SAS

The summary tool can detect a variety of RAID controllers by examining lspci and dmesg information. If the controller software is installed on the system, in many cases it is able to execute status commands and show a summary of the RAID controller's status and configuration:

Controller Detected? Status/Config?
LSI Logic MegaRAID SAS Y Y
Fusion-MPT SAS Y
AACRAID Y Y
HP Smart Array Y Y
3Ware Y

If your RAID controller is not supported, please contribute information about it so we can add support for it to this tool.


# Network Config #############################################
Controller | Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
Controller | Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
Controller | Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
Controller | Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
FIN Timeout | net.ipv4.tcp_fin_timeout = 60
Port Range | net.ipv4.ip_local_port_range = 32768 61000

The network controllers attached to the system are detected from lspci . The TCP/IP protocol configuration parameters are extracted from sysctl . If the ASPERSA_SKIP environment variable includes "NETWORK", then this section is skipped.


# Interface Statistics #######################################
interface rx_bytes rx_packets rx_errors tx_bytes tx_packets tx_errors
========= ========= ========== ========== ========== ========== ==========
lo 1608579960 14405424 0 1608579960 14405424 0
eth0 148784272 307574175 0 2642073200 343143727 0
eth1 0 0 0 0 0 0
eth2 0 0 0 0 0 0
eth3 0 0 0 0 0 0

Interface statistics are gathered from ip -s link . The columns are received and transmitted bytes, packets, and errors. If the ASPERSA_SKIP environment variable includes "NETWORK", then this section is skipped.


# Network Connections ########################################
Connections from remote IP addresses
10.1.12.30 1
10.1.202.243 6
74.125.127.82 1
Connections to local IP addresses
10.1.251.31 8
Connections to top 10 local ports
22 1
32832 1
38709 1
40537 1
52169 1
58109 1
807 1
976 1
States of connections
ESTABLISHED 2
LISTEN 10
TIME_WAIT 6

This section shows a summary of network connections, retrieved from netstat and fuzzy-rounded . There are two sub-sections showing how many connections there are per origin and destination IP address, and a sub-section showing the count of ports in use. In this case, none of the ports has a count greater than 1, but in examples such as MySQL or web servers, you will see many incoming connections to a single port. Finally, the section ends with the count of the network connetions' states. If the ASPERSA_SKIP environment variable includes "NETWORK", then this section is skipped.


# Top Processes ##############################################
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 15 0 10332 700 588 S 0 0.0 0:03.05 init
2 root RT -5 0 0 0 S 0 0.0 0:00.03 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/0
4 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/0
5 root RT -5 0 0 0 S 0 0.0 0:00.27 migration/1
6 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/1
7 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/1
8 root RT -5 0 0 0 S 0 0.0 0:00.01 migration/2
9 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/2

This section is just the top few lines of top so that you can see what processes are actively using CPU time. If the ASPERSA_SKIP environment variable includes "PROCESS", then this section is skipped.


# Simplified and fuzzy rounded vmstat (wait please) ##########
procs ---swap-- -----io---- ---system---- --------cpu--------
r b si so bi bo ir cs us sy il wa st
0 0 0 0 8 10 125 175 2 1 100 1 0
1 0 0 0 0 0 90 100 0 0 100 0 0
1 0 0 0 0 50 225 250 1 1 100 3 0
0 0 0 0 0 0 60 100 0 0 100 0 0
1 0 0 0 0 0 225 250 1 1 100 0 0
# The End ####################################################

This section is a trimmed-down sample of vmstat 1 5 , so you can see the general status of the system at present. The values in the table are fuzzy-rounded , except for the CPU columns. If the ASPERSA_SKIP environment variable includes "PROCESS", then this section is skipped.

分享到:
评论

相关推荐

    Linux Productivity Tools.pdf

    高效Linux工具使用 • Part 1: Overview and Logistics • Part 2: Basics • Part 3: Streams, pipe and redirection • Part 4: Classic Tools: find, grep, awk, sed • Part 5: Session Management: tmux • ...

    Advanced Linux 3D graphics programming

    Advanced Linux 3D graphics programming Chapter 1 Basic Linux 3D Graphics Concepts ..................1 2D Graphics Fundamentals ......................................1 3D Graphics Fundamentals ...........

    cgal-releases-CGAL-5.0.zip

    Summary of CGAL's Configuration Variables gives information about which CMake variables can be used to help resolve missing dependencies while using the cmake command line tool. Building CGAL ...

    Phpmaker 2019

    PHPMaker is a powerful automation tool that can generate a full set of PHP scripts quickly from MySQL, PostgreSQL, Microsoft Access, Microsoft SQL Server, Oracle and SQLite databases. Using PHPMaker ...

    panzg123.github.io:blog,学习笔记

    博客访问地址: 或者直接打开_posts目录下的markdown文件 模板来源: Jekyll theme by ...profile_tool_summary系统分析工具总结 simple_ip_stack简单的IP协议栈的实现 linux_timerLinux平台定时器的用法

    nmon aix性能分析工具.rar

    If you are using the nmon2rrd or nmon Analyser, please also check these tool accept the new data files generated by nmon 11. Please feedback any problems to the developer Nigel Griffiths at nag@uk....

    acpi控制笔记本风扇转速

    Summary of changes for version 20061109: 1) ACPI CA Core Subsystem: Optimized the Load ASL operator in the case where the source operand is an operation region. Simply map the operation region ...

    rfc3550 RTP协议中文版本

    6 5 6 TOOL:应用程序或工具名字的SDES数据项(TOOL: Application or Tool Name SDES Item) 6 5 7 NOTE:通知/状态的SDES数据项(NOTE: Notice/Status SDES Item) 6 5 8 PRIV:私有扩展的SDES数据项(PRIV: ...

    深入理解计算机系统(英文版)

    1.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 I Program Structure and Execution 19 2 Representing and Manipulating Information 21 2.1 ...

    spring-boot-reference.pdf

    I. Spring Boot Documentation 1. About the Documentation 2. Getting Help 3. First Steps 4. Working with Spring Boot 5. Learning about Spring Boot Features 6. Moving to Production 7. Advanced Topics ...

    MySQL 5.6 Reference Manual

    Table of Contents Preface, Notes, Licenses . . . . . . . . ....1. Licenses for Third-Party Components ....1.1. FindGTest.cmake License ....1.2. LPeg Library License ....1.3. LuaFileSystem Library License ....

Global site tag (gtag.js) - Google Analytics