ethtool查看网卡速率apt-get install ethtool使用方法 ethtool 网卡名称ethtool eth0————— smartmontools查看硬盘信息apt-get install smartmontools使用方法smartctl -A /dev/sda上面这条命令是用来查看硬盘的SMART信息,如果硬盘本身禁用了SMART,可能会看不到,可以通过下面这条命令启用SMART。smartctl -s on /dev/sda查看硬盘通电时间smartctl -A /dev/sda | grep Power_On_Hours会得到类似下面的信息:9 Power_On_Hours 0x0032 067 067 000 Old_age Always - 24272也就是说这个硬盘已经运行了24272小时。————— 测试硬盘写入速度:dd bs=64k count=4k if=/dev/zero of=test conv=fdatasync;rm -f test—————测试服务器下载速度:wg

nano /etc/snmp/snmpd.confagentAddress udp:161 view all included .1 80 rouser 用户名 auth createUser 用户名 MD5 "密码" DES rocommunity public 客户端IP地址 sysLocation Sitting on the Dock of the Bay sysContact Me <me@example.org> sysServices 72 proc mountd proc ntalkd 4 proc sendmail 10 1 disk / 10000 disk /var 5% includeAllDisks 10% load 12 10 5 iquerySecName internalUser defaultMonitors yes linkUpDownNotifications yes master

安装xen必须的包```apt-get install xen-linux-system xen-tools xenwatch libbeecrypt7 libterm-readline-gnu-perl reiserfsprogs```编辑配置```nano /etc/xen/xend-config.sxp```去掉下面这行前面的#```(dom0-min-mem 256)``````nano /etc/default/grub```添加一行```GRUB_CMDLINE_XEN="dom0_mem=256M"```删除原有的内核(可选)```apt-get remove linux-image-2.6.32-5-amd64```更新grub```mv /etc/grub.d/10_linux /etc/grub.d/50_linux``````update-grub2```重启服务器。```nano /etc/xe

软件 2013-06-02

检测nginx允许打开文件数量:```for pid in `ps aux |grep nginx |grep -v grep|awk '{print $2}'`; do cat /proc/${pid}/limits |grep 'Max open files'; done```释放linux内存中的缓存,一般不需要这么做:```echo 1 > /proc/sys/vm/drop_caches echo 3 > /proc/sys/vm/drop_caches```检测nginx是否502,是的话就重启nginx,可加入crontab定时检测。```#!/bin/bashCheckURL="http://www.yoursite.com"STATUS_CODE=`curl&

```iptables -P INPUT ACCEPT iptables -I INPUT -p tcp --dport 80 -m connlimit --connlimit-above 30 -j DROP```默认允许所有连接,限制每个IP连接80的数量为30个,超过直接丢弃。```iptables -A INPUT -p tcp --dport 80 --syn -m recent --name webpool --rcheck --seconds 30 --hitcount 30 -j LOG --log-prefix 'DDOS:' --log-ip-options iptables -A&nb