`
weimou66
  • 浏览: 1245084 次
文章分类
社区版块
存档分类
最新评论

Monitor_数据分析篇(字段解释)

 
阅读更多

监控程序:

#!/usr/bin/envpython
#
-*-coding:cp936-*-
importthreading,os,time

classConfig_th:

defConfig_m(self):

#globalset_workpath,set_commandpath,set_looptime,set_loophour,set_loopday
path="monitor_config."
monitor_config_path
=open(path,'r')
config_list
=monitor_config_path.readlines()
#SetWorkPathConfig
set_workpath=config_list[1][10:-1]
#setCommandPathConfig
set_commandpath=config_list[2][13:-1]
#setlooptimeConfig
set_looptime=config_list[3][17:-1]
#setloopdataConfig
set_loophour=config_list[4][14:-1]
#setloopdayConfig
set_loopday=config_list[5][14:-1]
#test(os.system("echo%s"%(set_loopday)))
returnset_workpath,set_commandpath,set_looptime,set_loophour,set_loopday

classCpuinfo_th(threading.Thread,Config_th):

def__init__(self):
threading.Thread.
__init__(self)
defrun(self):
#globalset_workpath,set_commandpath,set_looptime,set_loophour,set_loopday
set_workpath,set_commandpath,set_looptime,set_loophour,set_loopday=self.Config_m()
os.system(
"%s/iostat-t-c11>>%s/cpu_info.txt"%(set_commandpath,set_workpath))

classMemoryinfo_th(threading.Thread,Config_th):

def__init__(self):
threading.Thread.
__init__(self)
defrun(self):
#globalset_workpath,set_commandpath,set_looptime,set_loophour,set_loopday
set_workpath,set_commandpath,set_looptime,set_loophour,set_loopday=self.Config_m()
os.system(
"/usr/bin/vmstat-SK11>>%s/memory_info.txt"%(set_workpath))

classDeciveinfo_th(threading.Thread,Config_th):

def__init__(self):
threading.Thread.
__init__(self)
defrun(self):
#globalset_workpath,set_commandpath,set_looptime,set_loophour,set_loopday
set_workpath,set_commandpath,set_looptime,set_loophour,set_loopday=self.Config_m()
os.system(
"%s/iostat-d11>>%s/decive_io_info.txt"%(set_commandpath,set_workpath))

classTotalinfo_th(threading.Thread,Config_th):

def__init__(self):
threading.Thread.
__init__(self)
defrun(self):
#globalset_workpath,set_commandpath,set_looptime,set_loophour,set_loopday
set_workpath,set_commandpath,set_looptime,set_loophour,set_loopday=self.Config_m()
os.system(
"%s/sar-u11>>%s/total_info.txt"%(set_commandpath,set_workpath))

classControl(Config_th):

defconsole(self):
#applicationobject
globalset_workpath,set_commandpath,set_looptime,set_loophour,set_loopday
cpuinfo_th
=Cpuinfo_th()
memoryinfo_th
=Memoryinfo_th()
deciveinfo_th
=Deciveinfo_th()
totalinfo_th
=Totalinfo_th()
set_workpath,set_commandpath,set_looptime,set_loophour,set_loopday
=self.Config_m()
#loopcontrolmain()
foriinrange(float(str(set_loopday))):
foriinrange(float(str(set_loophour))):
time.sleep(float(str(set_looptime)))
print"ExecuteOK!,runcpuinfo,%d"%(i)
cpuinfo_th.run()
time.sleep(
0.001)
print"ExecuteOK!,runmemoryinfo,%d"%(i)
memoryinfo_th.run()
time.sleep(
0.001)
print"ExecuteOK!,rundeciveinfo,%d"%(i)
deciveinfo_th.run()
time.sleep(
0.001)
print"ExecuteOK!,runtotalinfo,%d"%(i)
totalinfo_th.run()
time.sleep(
0.001)
print"TotalExecute%d......"%(i)

if__name__=="__main__":

control
=Control()
control.console()


参数配置:

[Config]
work_path=/home/data
command_path=/usr/local/bin
loop_time_second=10
loop_day_hour=224
loop_week_day=7

[Cpu]
%usr:CPU处在用户模式下的时间百分比。
%sys:CPU处在系统模式下的时间百分比。
%wio:CPU等待输入输出完成时间的百分比。
%idle:CPU空闲时间百分比。
在所有的显示中,我们应主要注意%wio和%idle,%wio的值过高,表示硬盘存在I/O瓶颈,
%idle值高,表示CPU较空闲,如果%idle值高但系统响应慢时,有可能是CPU等待分配内存,
此时应加大内存容量。%idle值如果持续低于10,那么系统的CPU处理能力相对较低,表
明系统中最需要解决的资源是CPU.

[Decive]
bread/s:每秒从硬盘读入系统缓冲区buffer的物理块数。
lread/s:平均每秒从系统buffer读出的逻辑块数。
%rcache:在buffercache中进行逻辑读的百分比。
bwrit/s:平均每秒从系统buffer向磁盘所写的物理块数。
lwrit/s:平均每秒写到系统buffer逻辑块数。
%wcache:在buffercache中进行逻辑读的百分比。
pread/s:平均每秒请求物理读的次数。
pwrit/s:平均每秒请求物理写的次数。
在显示的内容中,最重要的是%cache和%wcache两列,它们的值体现着buffer的使用效
率,%rcache的值小于90或者%wcache的值低于65,应适当增加系统buffer的数量,buffer
数量由核心参数NBUF控制,使%rcache达到90左右,%wcache达到80左右。但buffer参数
值的多少影响I/O效率,增加buffer,应在较大内存的情况下,否则系统效率反而得不到
提高。

[Memory]
procs:
r-->
;在运行队列中等待的进程数
b-->;在等待io的进程数
w-->;可以进入运行队列但被替换的进程
memoy
swap-->
;现时可用的交换内存(k表示)
free-->;空闲的内存(k表示)
pages
re--》回收的页面
mf--》非严重错误的页面
pi--》进入页面数(k表示)
po--》出页面数(k表示)
fr--》空余的页面数(k表示)
de--》提前读入的页面中的未命中数
sr--》通过时钟算法扫描的页面
disk显示每秒的磁盘操作。s表示scsi盘,0表示盘号
fault显示每秒的中断数
in--》设备中断
sy--》系统中断
cy--》cpu交换
cpu表示cpu的使用状态
cs--》用户进程使用的时间
sy--》系统进程使用的时间
id--》cpu空闲的时间

如果r经常大于
4,且id经常少于40,表示cpu的负荷很重。
如果pi,po长期不等于0,表示内存不足。
如果disk经常不等于0,且在b中的队列大于3,表示io性能不好。


分享到:
评论

相关推荐

    SQL Monitor for Oracle,MySQL和DB2 v2.4.3.6 中文绿色版

    SQL Monitor for Oracle,MySQL and DB2 是款免费的数据库跟踪工具,专门用来分析CPU使用率高的问题。 软件功能: 1. 监控SQL Server的进程和Job,查看当前执行的SQL/命令,并终止之。 2. 对象浏览器,跟 SQL Server...

    数据库设计案例(1).doc

    "Y "价格 " "Class(班级表) " "列名 "数据类型 "字段大小 "可否为空 "说明 " "Class_ID "Char "5 "N(KEY) "班级编号 " "Class_monitor"Char "10 "Y "班长 " "Class_room "Char "20 "Y "教室 " "student_num "int ...

    Android手机平台音乐播放器毕业论文

    4.3.2 Dalvik Debug Monitor Service (DDMS)的使用 - 26 - 4.4 Android 音乐播放器的工程 - 26 - 4.4.1 Android项目 - 26 - 4.4.2 Android工程程序结构 - 27 - 4.4.3 AndroidManifest.xml文件 - 29 - 第五章 播放器...

    sql2000 Log Explorer4.2(含注册码)+汉化

    Log Explorer主要用于对MSSQLServer的事物分析和数据恢复。你可以浏览日志、导出数据、恢复被修改或者删除的数据(包括执行过update,delete,drop和truncate语句的表格)。一旦由于系统故障或者人为因素导致数据丢失,...

    Android音乐播放器毕业设计论文

    4.3.2 Dalvik Debug Monitor Service (DDMS)的使用 - 26 - 4.4 Android 音乐播放器的工程 - 26 - 4.4.1 Android项目 - 26 - 4.4.2 Android工程程序结构 - 27 - 4.4.3 AndroidManifest.xml文件 - 29 - 第五章 播放器...

    Log Explorer4.2帮助文档

    Log Explorer主要用于对MSSQLServer的事物分析和数据恢复。你可以浏览日志、导出数据、恢复被修改或者删除的数据(包括执行过update,delete,drop和truncate语句的表格)。一旦由于系统故障或者人为因素导致数据丢失,...

    Log Explorer for SQL Server v4.22 含注册机

    Log Explorer主要用于对MSSQLServer的事物分析和数据恢复。你可以浏览日志、导出数据、恢复被修改或者删除的数据(包括执行过update,delete,drop和truncate语句的表格)。一旦由于系统故障或者人为因素导致数据丢失,...

    Log Explorer for SQL Server v4.22

    Log Explorer主要用于对MSSQLServer的事物分析和数据恢复。你可以浏览日志、导出数据、恢复被修改或者删除的数据(包括执行过update,delete,drop和truncate语句的表格)。一旦由于系统故障或者人为因素导致数据丢失,...

    Toad 使用快速入门

    可以方便的对表进行分析,查看表地所有信息,可以有条件的倒出表里面的数据,并且保存为sql语句。 v. 可以方便的对表进行重组,可以完成exp/imp作不到的事情,而且更少地人工参与,更加安全。 对于视图,存储过程...

    EXCEL 2007 宝典 附光盘文件

    calculated fields and items.xlsx:一个包含演示计算字段和计算项的数据透视表的工作簿。 county data.xlsx:一个包含一个大表格和从表中创建的数据透视表的工作簿。 employee list.xlsx:一个包含演示数据透视表...

    RED HAT LINUX 6大全

    4.4.5 XF86Config Monitor部分 37 4.4.6 XF86Config Graphics Device部分 39 4.4.7 XF86Config Screen部分 40 4.5 使用xf86config 42 4.6 使用XF86Setup进行配置 49 4.7 .xinitrc文件 52 4.8 使用Red Hat的wmconfig...

    Eclipse权威开发指南3.pdf

    4.2.3 修改变量和字段的值..... 116 4.2.4 使用Java编辑器进行调试..... 116 4.2.5 对当前所调试的程序进行操作..... 117 4.2.6 Console视图中的程序输出..... 119 4.2.7 有关断点的更多知识..... 119 ...

    Eclipse权威开发指南1.pdf

    4.2.3 修改变量和字段的值..... 116 4.2.4 使用Java编辑器进行调试..... 116 4.2.5 对当前所调试的程序进行操作..... 117 4.2.6 Console视图中的程序输出..... 119 4.2.7 有关断点的更多知识..... 119 ...

    Eclipse权威开发指南2.pdf

    4.2.3 修改变量和字段的值..... 116 4.2.4 使用Java编辑器进行调试..... 116 4.2.5 对当前所调试的程序进行操作..... 117 4.2.6 Console视图中的程序输出..... 119 4.2.7 有关断点的更多知识..... 119 4.2.8 Java...

Global site tag (gtag.js) - Google Analytics