linux tools

linux tools part 8– Monitoring Reads and Writes to a File and device

May 13, 2013 linux, system No comments

1.配合使用systemtap 监控系统对于文件的读写:

[root@db-42 systemtap]# uname -a
Linux db-42 2.6.18-194.el5 #1 SMP Mon Mar 29 22:10:29 EDT 2010 x86_64 x86_64 x86_64 GN[......]

Read more

linux tools part 7– Monitor socket activity

April 23, 2013 linux, system No comments

systemtap发行版本提供了socktop,用于监控socket套接字之间的通信,具体如下:

[root@db-42 ~]# socktop -h
USAGE: socktop [-d] [-i interval] [-N num] [-P protocol]... [-f family].[......]

Read more

linux tools part 6– network Monitoring (2)

March 19, 2013 linux, system No comments

基于上次的nicstat linux还提供了nethogs,可以监控指定pid的具体流量,在这里可以下到源码.

获取过程:

open("/proc/$pid/fd")
open("/proc/net/tcp")
open("/proc[......]

Read more

linux tools part 5– Trace network information

March 13, 2013 linux, system No comments

Nmap (“Network Mapper”) is an open source tool for network exploration and security auditing. It was designed to rapidly scan large networks, although[……]

Read more

linux tools part 4– Monitor process IO state

March 5, 2013 linux, system No comments

iotop是一个类似top的检测process IO 的Python 项目。可以在这里下载到源码,可以在这里找到具体的说明。下面做一个演示:

首先下载源码,要求python version>=2.6

wget http://guichaz.free.fr/iotop/files/io[......]

Read more

linux tools part 3– Monitor process status

February 28, 2013 linux, system No comments

pidstat是一款很不错的针对linux pid状态监控的程序

The pidstat command is used for monitoring individual tasks currently being managed by the Linux kernel.
It writ[……]

Read more

linux tools part 2– network Monitoring

February 27, 2013 linux, system No comments

本来想写一篇关于nicstat的文章,霸爷已经写的非常好了参考这里nicstat 网络流量统计利器

这里说明一下使用nicstat 可以完美替代iptraf ,nload 等工具

同样可以替代watch –命令行模式:
eg:

Every 1.0s: /sbin/ifconfi[......]

Read more

linux tools part 1– Linux Kernel Performance

February 27, 2013 linux, system No comments

Perf is a profiler tool for Linux 2.6+ based systems that abstracts away CPU hardware differences in Linux performance measurementsand presents a simp[……]

Read more