2009年3月6日星期五

xorg.conf for Archlinux KDE 4.2.1 in HP Compaq nx7400

xorg.conf for Archlinux KDE 4.2.1 in HP Compaq nx7400

# /.../
# SaX generated X11 config file
# Created on: 2008-08-19T16:21:40+0800.
#
# Version: 8.1
# Contact: Marcus Schaefer <sax@suse.de>, 2005
# Contact: SaX-User list
<https://lists.berlios.de/mailman/listinfo/sax-users>
#
# Automatically generated by [ISaX] (8.1)
# PLEASE DO NOT EDIT THIS FILE!
#

Section "Files"
# FontPath "/usr/share/fonts/misc:unscaled"
FontPath "/usr/share/fonts/local"
FontPath "/usr/share/fonts/75dpi:unscaled"
FontPath "/usr/share/fonts/100dpi:unscaled"
FontPath "/usr/share/fonts/URW"
FontPath "/usr/share/fonts/Speedo"
FontPath "/usr/share/fonts/PEX"
FontPath "/usr/share/fonts/cyrillic"
FontPath "/usr/share/fonts/latin2/misc:unscaled"
FontPath "/usr/share/fonts/latin2/75dpi:unscaled"
FontPath "/usr/share/fonts/latin2/100dpi:unscaled"
FontPath "/usr/share/fonts/latin2/Type1"
FontPath "/usr/share/fonts/latin7/75dpi:unscaled"
FontPath "/usr/share/fonts/baekmuk:unscaled"
FontPath "/usr/share/fonts/japanese:unscaled"
FontPath "/usr/share/fonts/kwintv"
FontPath "/usr/share/fonts/truetype"
FontPath "/usr/share/fonts/uni:unscaled"
FontPath "/usr/share/fonts/CID"
FontPath "/usr/share/fonts/ucs/misc:unscaled"
FontPath "/usr/share/fonts/ucs/75dpi:unscaled"
FontPath "/usr/share/fonts/ucs/100dpi:unscaled"
FontPath "/usr/share/fonts/hellas/misc:unscaled"
FontPath "/usr/share/fonts/hellas/75dpi:unscaled"
FontPath "/usr/share/fonts/hellas/100dpi:unscaled"
FontPath "/usr/share/fonts/hellas/Type1"
FontPath "/usr/share/fonts/misc/sgi:unscaled"
FontPath "/usr/share/fonts/xtest"
FontPath "/opt/kde3/share/fonts"
InputDevices "/dev/gpmdata"
InputDevices "/dev/input/mice"
EndSection

Section "ServerFlags"
Option "AIGLX" "on"
Option "AllowMouseOpenFail" "on"
Option "ZapWarning" "on"
EndSection

Section "Module"
Load "glx"
#Load "type1"
Load "extmod"
Load "dbe"
Load "freetype"
Load "dri"
Load "synaptics"
EndSection

Section "InputDevice"
Driver "kbd"
Identifier "Keyboard[0]"
#Option "Protocol" "Standard"
Option "XkbLayout" "us"
#Option "XkbModel" "microsoftpro"
Option "XkbModel" "pc104"
#Option "XkbRules" "xfree86"
EndSection


Section "InputDevice"
Driver "mouse"
Identifier "Mouse[1]"
Option "Buttons" "5"
Option "Device" "/dev/input/mice"
Option "Name" "Pixart Imaging USB OPTICAL MOUSE"
Option "Protocol" "explorerps/2"
Option "Vendor" "Sysp"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
Driver "synaptics"
Identifier "Mouse[3]"
Option "Buttons" "5"
Option "Device" "/dev/input/mice"
Option "Emulate3Buttons" "on"
Option "HorizScrollDelta" "0"
Option "InputFashion" "Mouse"
Option "Name" "Synaptics;Touchpad"
Option "Protocol" "explorerps/2"
Option "SHMConfig" "on"
Option "Vendor" "Sysp"
Option "ZAxisMapping" "4 5"
EndSection


Section "Monitor"
DisplaySize 305 230
HorizSync 30-82
Identifier "Monitor[0]"
ModelName "1280X1024@60HZ"
Option "DPMS"
#Option "PreferredMode" "1280x1024"
VendorName "--> LCD"
VertRefresh 50-60
UseModes "Modes[0]"
EndSection


Section "Modes"
Identifier "Modes[0]"
# 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
ModeLine "640x480" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
# # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
ModeLine "640x480" 31.5 640 664 704 832 480 489 491 520 -hsync -vsync
# # 800x600 @ 56Hz (VESA) hsync: 35.2kHz
ModeLine "800x600" 36.0 800 824 896 1024 600 601 603 625 +hsync +vsync
# # 800x600 @ 60Hz (VESA) hsync: 37.9kHz
ModeLine "800x600" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync
# # 800x600 @ 72Hz (VESA) hsync: 48.1kHz
ModeLine "800x600" 50.0 800 856 976 1040 600 637 643 666 +hsync +vsync
# # 800x600 @ 75Hz (VESA) hsync: 46.9kHz
ModeLine "800x600" 49.5 800 816 896 1056 600 601 604 625 +hsync +vsync
# # 1024x768 @ 60Hz (VESA) hsync: 48.4kHz
ModeLine "1024x768" 65.0 1024 1048 1184 1344 768 771 777 806 -hsync -vsync
# # 1024x768 @ 70Hz (VESA) hsync: 56.5kHz
ModeLine "1024x768" 75.0 1024 1048 1184 1328 768 771 777 806 -hsync -vsync
# # 1024x768 @ 75Hz (VESA) hsync: 60.0kHz
ModeLine "1024x768" 78.8 1024 1040 1136 1312 768 769 772 800 +hsync +vsync
# # 1280x960 @ 60Hz (VESA) hsync: 60.0kHz
ModeLine "1280x960" 148.5 1280 1344 1504 1728 960 961 964 1011 +hsync
+vsync
# # 1280x1024 @ 60Hz (VESA) hsync: 64.0kHz
ModeLine "1280x1024" 108.0 1280 1328 1440 1688 1024 1025 1028 1066
+hsync +vsync
# # 1280x1024 @ 75Hz (VESA) hsync: 80.0kHz
ModeLine "1280x1024" 135.0 1280 1296 1440 1688 1024 1025 1028 1066
+hsync +vsync
# # 1600x1200 @ 60Hz (VESA) hsync: 75.0kHz
ModeLine "1600x1200" 162.0 1600 1664 1856 2160 1200 1201 1204 1250
+hsync +vsync
# # 1600x1200 @ 65Hz (VESA) hsync: 81.3kHz
ModeLine "1600x1200" 175.5 1600 1664 1856 2160 1200 1201 1204 1250
+hsync +vsync
# # 1600x1200 @ 70Hz (VESA) hsync: 87.5kHz
ModeLine "1600x1200" 189.0 1600 1664 1856 2160 1200 1201 1204 1250
+hsync +vsync
# # 1600x1200 @ 75Hz (VESA) hsync: 93.8kHz
ModeLine "1600x1200" 202.5 1600 1664 1856 2160 1200 1201 1204 1250
+hsync +vsync
EndSection


Section "Screen"
DefaultDepth 16
SubSection "Display"
Depth 15
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1280x720"
"1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1280x720"
"1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1280x720"
"1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1280x720"
"1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
EndSubSection
Device "Device[0]"
Identifier "Screen[0]"
Monitor "Monitor[0]"
EndSection


Section "Device"
BoardName "945 GM"
BusID "0:2:0"
Driver "intel"
Identifier "Device[0]"
Option "monitor-LVDS" "Monitor[0]"
Screen 0
VendorName "Intel"
#Option "AddARGBGLXVisuals" "True"
EndSection

Section "ServerLayout"
Identifier "Layout[all]"
InputDevice "Keyboard[0]" "CoreKeyboard"
InputDevice "Mouse[1]" "CorePointer"
InputDevice "Mouse[3]" "SendCoreEvents"
Option "Clone" "off"
Option "Xinerama" "off"
Screen "Screen[0]"
EndSection


Section "DRI"
Group "video"
Mode 0660
EndSection

Section "Extensions"
Option "Composite" "Enable"
EndSection

2009年2月11日星期三

LINUX:CENTOS:HOWTO 安装MRTG

主要资料来源:
http://www.sofee.cn/blog/2006/10/21/49/


OS:centos 4.7

1、安装SNMPD服务
# yum install net-snmp-utils
# vi /etc/snmp/snmpd.conf
把以下的内容注释掉:

# First, map the community name "public" into a "security name"  #       sec.name  source          community ##com2sec notConfigUser  default       public  #### # Second, map the security name into a group name:  #       groupName      securityModel securityName ##group   notConfigGroup v1           notConfigUser ##group   notConfigGroup v2c           notConfigUser  #### # Third, create a view for us to let the group have rights to:  # Make at least  snmpwalk -v 1 localhost -c public system fast again. #       name           incl/excl     subtree         mask(optional) ##view    systemview    included   .1.3.6.1.2.1.1 ##view    systemview    included   .1.3.6.1.2.1.25.1.1  #### # Finally, grant the group read-only access to the systemview view.  #       group          context sec.model sec.level prefix read   write  notif ##access  notConfigGroup ""      any       noauth    exact  systemview none none


然后增加以下内容:

############################################################## ## sec.name source community com2sec local   localhost       public com2sec lan     192.168.1.0/24  public  ## group.name sec.model sec.name group   MyRWGroup       v1      local group   MyRWGroup       v2c     local group   MyRWGroup       usm     local group   MyROGroup       v1      lan group   MyROGroup       v2c     lan group   MyROGroup       usm     lan  view all    included  .1                               80 #view mib2   included  .iso.org.dod.internet.mgmt.mib-2 fc  ## context sec.model sec.level prefix read write notif access MyROGroup ""      any       noauth    exact      all    none   none access MyRWGroup ""      any       noauth    exact      all    all    all rocommunity  public disk / 100000 disk /mnt/share 500000 ##############################################################

其中的disk配置是为了监控磁盘的使用量,用户可自行修改要监控的目录,这里监控的是系统目录/和数据目录/mnt/share。

完了之后就开启snmpd服务。
# chkconfig snmpd on
# /etc/init.d/snmpd start


2、安装MRTG
# yum install mrtg
默认安装下,已在/etc/cron.d/下生成一个mrtg任务,cron进程会根据据/etc/cron.d/mrtg 中指定的参数每5分钟执行一次,对统计数据的结果页面进行更新,所以要注意MRTG配置文件的保存位置。一般情况下,MRTG的流量统计页面是放在 /var/www/mrtg/下,配置文件保存在/etc/mrtg/mrtg.cfg。如果用户自行修改了保存位置,那么也请同时修改/etc /cron.d/mrtg文件中的路径。

2.1 测试生成MRTG配置文件
#/usr/bin/cfgmaker �global 'WorkDir: /var/www/mrtg' �output /etc/mrtg/mrtg.cfg public@127.0.0.1
如果出现一些错误,一般都是/etc/snmp/snmpd.conf文件配置错误引起,执行后会在/etc/mrtg/下生成一个mrtg.cfg配置 文件。
MRTG除了统计流量之外,还可以统计CPU、UPTIME、内存、磁盘使用量等等,而用cfgmaker生成的配置文件只包含网卡的流量统计,所以用户 可� �据自己的需求对/etc/mrtg/mrtg.cfg进行修改。可参考本文最后我的mrtg.cfg配置文件内容。

由于MRTG根据SNMP获取的UPTIME信息不符合规则,所以需要写个脚本来进行转换。
# vi /var/www/mrtg/mrtg-uptime.pl

sub convertUptime {         my $data = shift;         my $days = 0;         # 1 day, 1:42:50         if ( $data =~ /^(d+)sday/ ) {                 $days = $1;         }         return ("$days"); }


注:如果直接使用cfgmaker生成的配置文件的话,那么还需要执行indexmaker来生成统计页面。
/usr/bin/indexmaker -output=/var/www/mrtg/index.html -title="sofee.cn MRTG Graph" /etc/mrtg/mrtg.cfg

2.2 配置Apache

安装 apache
#yum install httpd

在CentOS中,Apache的配置部分是除了本机之外拒绝所有人访问的,所以还需要对Apache进行相应的配置,以使外网也能够对MRTG统 计页面进行访问。
# vi /etc/httpd/conf.d/mrtg.conf

Alias /mrtg /var/www/mrtg <Location /mrtg>     Order deny, allow     Allow from all #   Deny from all #   Allow from 127.0.0.1 #   Allow from ::1 #   Allow from .example.com </Location>

这里设置的是所有人都可以通过WEB访问/mrtg,用户可自行设置相应权限。
# /etc/init.d/httpd graceful

2.3 生成统计页面
# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
第1、2次执行一般都会有错误信息,执行第3次就好了。

至此,MRTG已基本设置完毕,可通过浏览器访问http://www.yourhost.com/mrtg来查看统计页面。

3、我的MRTG配置文件
/etc/mrtg/mrtg.cfg

######################################################################
# Multi Router Traffic Grapher -- Example Configuration File         
######################################################################
# This file is for use with mrtg-2.0                                 
#                                                                    
# Note:                                                              
#                                                                    
# * Keywords must start at the begin of a line.                      
#                                                                    
# * Lines which follow a keyword line which do start                 
#   with a blank are appended to the keyword line                    
#                                                                    
# * Empty Lines are ignored                                          
#                                                                    
# * Lines starting with a # sign are comments.                       

# Where should the logfiles, and webpages be created?

# Minimal mrtg.cfg
#--------------------

HtmlDir: /var/www/mrtg
ImageDir: /var/www/mrtg
LogDir: /var/lib/mrtg 
ThreshDir: /var/lib/mrtg
Target[r1]: 2:public@myrouter.somplace.edu
MaxBytes[r1]: 1250000                    
Title[r1]: Traffic Analysis              
PageTop[r1]: <h1>Stats for our Ethernet</h1>

#Language: GB2312
                
Interval:5      
                
Options[_]: nopercent,growright,noinfo,gauge
                                           
MaxBytes[_]: 125000000                     
                                           
Xsize[_]: 600                              
Ysize[_]: 200                              
Ytics[_]: 10                               
                                           
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt,/usr/share/snmp/mibs/TCP-MIB.txt,/usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt                                                                                 
ConversionCode: /var/www/mrtg/mrtg-uptime.pl                                                          
                                                                                                      
###############################################################################                       
#                                                                                                     
# HTML formatting stuff                                                                               
#                                                                                                     
###############################################################################                       
PageTop[^]: <table cellspacing="0" cellpadding="10" border="0" width="100%" align="center"><tr><td width="185" valign="top" class="small"><table cellspacing="0" cellpadding="5" border="0" width="100%"><tr><td class="tableh">Network</td></tr><tr><td class="tablesh"><a href="index.html">- Traffic</a><br><a href="newtcp.html">- New Connections</a><br><a href="estabtcp.html">- Established Connections</a></td></tr><tr><td>&nbsp;</td></tr><tr><td class="tableh">System Stats</td></tr><tr><td class="tablesh"><a href="load.html">- Load Averages</a><br><a href="swap.html">- Swap Memory</a><br><a href="processes.html">- Processes</a><br><a href="uptime.html">- Uptime</a><br><a href="cpu.html">- CPU</a><br><a href="memory.html">- Free Memory</a><br><a href="disk.html">- Disk Usage</a></td></tr><tr><td>&nbsp;</td></tr></table></td><td>                                                                                            
                                                                                                      
PageFoot[^]: </td></tr></table>                                                                       
                                                                                                      
AddHead[^]: <meta http-equiv='Expires' content='-1'><style><!-- body { text-align: center; background-color: #CCCCCC; font-size: 10pt; font-family: arial, verdana; } th, td { font-size: 10pt; font-family: arial, verdana; } h3 { font-size: 12pt; font-family: arial, verdana; font-weight: bold; } .small { font-size: 8pt; font-family: arial, verdana; } .tableh { font-size: 10pt; font-family: arial, verdana; color: white; background-color: black; font-weight: bold; } .tablesh { font-size: 10pt; font-family: arial, verdana; color: black; background-color: #999999; font-weight: normal; } a:visited, a:active, a:link { text-decoration: none; font-weight: normal; font-family: arial, verdana; color: black; } a:hover { font-weight: normal; font-family: arial, verdana; background-color: #999999; color: white; } --></style>  
                                                                                                      
######################################################################                                
# System: www.sofee.cn                                                                                
# Description: Linux www.sofee.cn 2.6.9-42.ELsmp #1 SMP Tue Aug 15 10:35:26 BST 2006 x86_64           
# Contact: Root <root@localhost> (configure /etc/snmp/snmp.local.conf)                                
# Location: Unknown (edit /etc/snmp/snmpd.conf)                                                       
######################################################################                                
#                                                                                                     
# Traffic Monitoring                                                                                  
#                                                                                                     
Target[index]: 2:public@127.0.0.1:                                                                    
SetEnv[index]: MRTG_INT_IP="192.168.0.22" MRTG_INT_DESCR="eth0"                                       
Options[index]: nopercent,growright, noinfo, bits                                                     
Title[index]: Traffic Analysis for eth0                                                               
PageTop[index]: <h1>Traffic Analysis for eth0</h1>                                                    
PNGTitle[index]: Traffic Analysis for eth0                                                            
kilo[index]: 1024                                                                                     
                                                                                                      
#                                                                                                     
# CPU Monitoring                                                                                      
#                                                                                                     
Target[cpu]:ssCpuRawUser.0&ssCpuRawUser.0:public@localhost + ssCpuRawSystem.0&ssCpuRawSystem.0:public@localhost + ssCpuRawNice.0&ssCpuRawNice.0:public@localhost                                             
Title[cpu]: CPU Load                                                                                  
PageTop[cpu]: <h1>Active CPU Load %</h1>                                                              
PNGTitle[cpu]: CPU Load - System, User and Nice Processes                                             
RouterUptime[cpu]: public@localhost                                                                   
MaxBytes[cpu]: 100                                                                                    
Unscaled[cpu]: ymwd                                                                                   
ShortLegend[cpu]: %                                                                                   
YLegend[cpu]: CPU Utilization                                                                         
Legend1[cpu]: Active CPU in % (Load)                                                                  
Legend2[cpu]:                                                                                         
Legend3[cpu]:                                                                                         
Legend4[cpu]:                                                                                         
LegendI[cpu]:  Active                                                                                 
LegendO[cpu]:                                                                                         
Options[cpu]: growright,nopercent                                                                     
                                                                                                      
#                                                                                                     
# Memory Monitoring                                                                                   
#                                                                                                     
Target[memory]: memAvailReal.0&memTotalReal.0:public@localhost                                        
Title[memory]: Free Memory                                                                            
PageTop[memory]: <h1>Free Memory</h1>                                                                 
PNGTitle[memory]: Free Memory                                                                         
MaxBytes[memory]: 100000000000                                                                        
ShortLegend[memory]: B                                                                                
YLegend[memory]: Bytes                                                                                
LegendI[memory]: Free                                                                                 
LegendO[memory]: Total                                                                                
Legend1[memory]: Free memory, not including swap, in bytes                                            
Legend2[memory]: Total memory                                                                         
Options[memory]: gauge,growright,nopercent,noinfo                                                     
kMG[memory]: k,M,G,T,P,X                                                                              
                                                                                                      
#                                                                                                     
# Swap Monitoring                                                                                     
#                                                                                                     
Target[swap]: memAvailSwap.0&memAvailSwap.0:public@localhost                                          
Title[swap]: Swap Memory                                                                              
PageTop[swap]: <h1>Swap Memory</h1>                                                                   
PNGTitle[swap]: Available Swap                                                                        
Options[swap]: nopercent,growright,gauge,noinfo                                                       
MaxBytes[swap]: 1000000                                                                               
kMG[swap]: k,M,G,T,P,X                                                                                
YLegend[swap]: bytes                                                                                  
ShortLegend[swap]: bytes                                                                              
LegendI[swap]:  Free Memory:                                                                          
LegendO[swap]:                                                                                        
Legend1[swap]: Swap memory avail, in bytes                                                            
                                                                                                      
#                                                                                                     
# New TCP Connection Monitoring (per minute)                                                          
#                                                                                                     
Target[newtcp]: tcpPassiveOpens.0&tcpActiveOpens.0:public@localhost                                   
Title[newtcp]: Newly Created TCP Connections                                                          
PageTop[newtcp]: <h1>New TCP Connections</h1>                                                         
PNGTitle[newtcp]: Newly Created Inbound&Outbound TCP Connections                                      
MaxBytes[newtcp]: 10000000000                                                                         
ShortLegend[newtcp]: c/s                                                                              
YLegend[newtcp]: Conns / Min                                                                          
LegendI[newtcp]: In                                                                                   
LegendO[newtcp]: Out                                                                                  
Legend1[newtcp]: New inbound connections                                                              
Legend2[newtcp]: New outbound connections                                                             
Options[newtcp]: growright,nopercent,perminute                                                        
                                                                                                      
#                                                                                                     
# Established TCP Connections                                                                         
#                                                                                                     
Target[estabtcp]: tcpCurrEstab.0&tcpCurrEstab.0:public@localhost                                      
Title[estabtcp]: Currently Established TCP Connections                                                
PageTop[estabtcp]: <h1>Established TCP Connections</h1>                                               
PNGTitle[estabtcp]: Established TCP Connections                                                       
MaxBytes[estabtcp]: 10000000000                                                                       
ShortLegend[estabtcp]:                                                                                
YLegend[estabtcp]: Connections                                                                        
LegendI[estabtcp]: No. of Connections                                                                 
LegendO[estabtcp]:                                                                                    
Legend1[estabtcp]: Established connections                                                            
Legend2[estabtcp]:                                                                                    
Options[estabtcp]: growright,nopercent,gauge                                                          
                                                                                                      
#                                                                                                     
# Disk Usage Monitoring                                                                               
#                                                                                                     
# add disk entry to snmpd.conf                                                                        
# disk / 100000                                                                                       
# disk /mnt/data 500000                                                                               
Target[disk]: dskPercent.1&dskPercent.2:public@localhost                                              
Title[disk]: Disk Partition Usage                                                                     
PageTop[disk]: <h1>Disk Partition Usage / and /uappl</h1>                                             
PNGTitle[disk]: Disk Usage on / and /uappl                                                            
MaxBytes[disk]: 100                                                                                   
ShortLegend[disk]: %                                                                                  
YLegend[disk]: Utilization                                                                            
LegendI[disk]: /                                                                                      
LegendO[disk]: /uappl                                                                                 
Options[disk]: gauge,growright,nopercent                                                              
Unscaled[disk]: ymwd                                                                                  
                                                                                                      
#                                                                                                     
# Load Averages Monitoring                                                                            
#                                                                                                     
Target[load]: laLoadInt.1&laLoadInt.3:public@localhost                                                
Title[load]: Load Averages                                                                            
PageTop[load]: <h1>Load Averages</h1>                                                                 
PNGTitle[load]: Load Averages                                                                         
Options[load]: growright, gauge, nopercent, noinfo                                                    
MaxBytes[load]: 3000                                                                                  
YLegend[load]: Load (10E-2)                                                                           
ShortLegend[load]: (10E-2)                                                                            
LegendI[load]: 1-minute stagger                                                                       
LegendO[load]: 15-mintute stagger                                                                     
Legend1[load]: Load Average over last 1 minutes                                                       
Legend2[load]: Load Average over last 15 minutes                                                      
Legend3[load]: Average over last 1 minutes                                                            
Legend4[load]: Average over last 15 minutes                                                           
                                                                                                      
#                                                                                                     
# Processes Monitoring                                                                                
#                                                                                                     
Target[processes]: hrSystemProcesses.0&hrSystemProcesses.0:public@localhost                           
Title[processes]: Processes                                                                           
PageTop[processes]: <h1>Processes</h1>                                                                
PNGTitle[processes]: Processes                                                                        
Options[processes]: gauge,nopercent,growright
MaxBytes[processes]: 1000
YLegend[processes]: Processes
ShortLegend[processes]:
LegendI[processes]: Total
LegendO[processes]: Running

#
# Uptime Monitoring
#
Target[uptime]: hrSystemUptime.0&hrSystemUptime.0:public@localhost|convertUptime
Title[uptime]: System Uptime In Days
PageTop[uptime]: <h1>System Uptime Report</h1>
PNGTitle[uptime]: System Uptime
MaxBytes[uptime]: 100
ShortLegend[uptime]: Days
YLegend[uptime]: No. of Days
LegendI[uptime]: Uptime:
LegendO[uptime]:
Legend1[uptime]: Uptime in Days
Options[uptime]: gauge,growright,nopercent,noo


2008年12月24日星期三

测试java可以支持多少内存

测试java可以支持多少内存

可用于TOMCAT启动

$ java -Xmx2560m -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode)
$ java -Xmx2680m -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode)
$ java -Xmx2816m -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

2008年12月16日星期二

Linux:Archlinux 如何备份系统

Linux:Archlinux 如何备份系统

目的:把Archlinux移动到另外一个硬盘

1.使用 df 命令看 root 在哪个盘符

文件系统 1K-块 已用 可用 已用% 挂载点
/dev/sda11 15236724 4942120 9526700 35% /
none 1033680 0 1033680 0% /dev/shm
/dev/sda3 15236756 10887052 3581800 76% /media/vmware
/dev/sda5 20482184 2560444 17921740 13% /home
/dev/sda7 2048188 32884 2015304 2% /tmp


root 在 /dev/sda11

2.使用livecd启动电脑

3.使用df 看sda11 是否mount 上如

/dev/sda11 15236724 4942120 9526700 35% /mnt/sda11

4.去到放置备份文件的目录执行以下命令

sudo tar -cvpzf ./archlinux_root_`date +%y%m%d`.tgz /mnt/sda11

5.要恢复系统,最好新系统的ROOT盘也在 sda11上,否则要修改的东西很多
进入新的硬盘分区
用 sudo tar -xvzf archlinux_root_xxxx.tgz 解压系统文件

修改 /etc/fstab
修改 /boot/grub/menu.lst

6.用livecd

grub

grub> find /boot/grub/stage1

(hd1,0)

grub> root (hd1,0)

grub> setup (hd1)

grub> quit

7.用硬盘启动