<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wardking.com Studio</title>
	<atom:link href="http://www.wardking.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wardking.com</link>
	<description>写下我的生活回忆，陪伴我的生命岁月</description>
	<lastBuildDate>Sun, 05 Feb 2012 11:51:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>2012春节入手Kindle Fire</title>
		<link>http://www.wardking.com/2012/01/enjoy-my-kindle-fire/</link>
		<comments>http://www.wardking.com/2012/01/enjoy-my-kindle-fire/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 02:26:55 +0000</pubDate>
		<dc:creator>Michael ZHANG</dc:creator>
				<category><![CDATA[生活日志]]></category>
		<category><![CDATA[Kindle]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.wardking.com/?p=1436</guid>
		<description><![CDATA[<p><img src="http://www.wardking.com/wp-content/uploads/2012/01/gty_kindle_fire_nt_110928_wg.jpg" alt="My Kindle Fire" /></p>
<p>到上海后，上下班要耗费约1.5小时乘地铁，如何利用这段时间为自己充电？先看看地铁人群的众生相，玩手机、看书、玩iPad、看报纸？我确实很羡慕别人有iPad玩，但不是为了玩游戏，而是看书。我的电脑里下载了上千本PDF格式的电子书，但是在电脑上看书的时间真的不多。羡慕iPad，但是不想买，因为确实价格贵了。</p>
<p>3个月来，翻转Internet上的各大平板电脑评测，智器Ten 2、原道、爱国者、飞利浦、摩托罗拉、ACER等都不中意，最终在圣诞节前选定了亚马逊的Kindle Fire，虽然有人说中文输入法、软件安装之内的问题，但我主要是看英文书，个人不觉得是什么问题。正好老婆的妹妹去LasVgas，于是我速速下单，将包裹直接发至酒店地址，加上3日内限时达运费一共205.98美金。淘宝上也有很多代购的商家，价格也不错，而且还代为破解，但是考虑到风险和信誉，所以没有购买。</p>
<p>除夕夜终于拿到了小巧的Kindle Fire，7寸的屏幕握在手里很合适。开机后通过Wi-Fi注册非常顺利，然后下载安装豌豆荚享受丰富的应用软件资源，看在线视频、电子书、玩愤怒的小鸟和切水果都很流畅。目前觉得不足的地方就是在读PDF的时候，A4大小的单面在7寸上太小了，横屏时又不方便看页面中的图像。正在寻找软件把PDF转换为Kindle Fire的那种.mobi格式，这样可以放大缩小页面上的文字，无白边。</p>
<p>虽然Kindle Fire没有赠送数据线，但是其接口是Micro USB。我在办理中国电信e9套餐时，赠送给我的创维PE89数据线，刚好可以用来给Kindle Fire。</p>]]></description>
		<wfw:commentRss>http://www.wardking.com/2012/01/enjoy-my-kindle-fire/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>上海&#8211;多年的职业发展目标</title>
		<link>http://www.wardking.com/2011/12/%e4%b8%8a%e6%b5%b7-%e5%a4%9a%e5%b9%b4%e7%9a%84%e8%81%8c%e4%b8%9a%e5%8f%91%e5%b1%95%e7%9b%ae%e6%a0%87/</link>
		<comments>http://www.wardking.com/2011/12/%e4%b8%8a%e6%b5%b7-%e5%a4%9a%e5%b9%b4%e7%9a%84%e8%81%8c%e4%b8%9a%e5%8f%91%e5%b1%95%e7%9b%ae%e6%a0%87/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 14:07:45 +0000</pubDate>
		<dc:creator>Michael ZHANG</dc:creator>
				<category><![CDATA[生活日志]]></category>
		<category><![CDATA[feeling]]></category>

		<guid isPermaLink="false">http://www.wardking.com/?p=1431</guid>
		<description><![CDATA[<p>2005年我第一次到上海，参加RedHat Linux培训。记得当时RHEL在国内并不热门，我于次年考出的证书，还在中国还是前500。自那时起，了解到上海特有的金融和IT优势环境，就下定决心一定要到上海发展。漫长的6年过去了，我终于可以来到上海，和600多万外来就业人员一起，早九晚五地拥挤于地铁，在这座超级大都市的血管中流动。</p>
<p>10月底到达上海，50元住了一晚青年旅馆，卫生和安全实在不敢恭维。搬到朋友家住了几日后，在上海大学附近租下一套，很快入住。11月的上海，仲秋的天气。在宁波时，还可以午睡半小时，但现在不能午睡了，很有些不适应，午饭后就显得有些昏沉，加之每天早起，步行半小时才能到地铁站，整个上班时间差不多1.5小时，导致疲惫不甚。入职体检时，经过十二经络的检测，大夫也说我需要休息。现在每天早睡早起，有了自行车，精神恢复好多，可叹过去的睡懒觉的日子啊。</p>
<p>听说一位同事花了三年时间适应上海的生活，也许她是在适应这种快速的节奏，也或是人潮人海的氛围。在这样的生存环境中，压力随之而来，同我一样奋斗在上海的外来人，我们都深知自己站在中国经济发展的前沿阵地，必须努力地打拼。一个月多来，融入上海的生活已经不是困扰我的问题，每天上班路途中享受两包子一鸡蛋的早餐，而午餐和晚餐都在学校食堂享用。周末到上海大学附近用餐，味道很好，而价格却比起宁波还低，饭后还可以去Wall-Mart，农工商或者联华，拥有便利的生活配套设施。</p>
<p>新的联系方式附上，请大家<a href="http://www.wardking.com/?attachment_id=1433">下载</a></p>]]></description>
		<wfw:commentRss>http://www.wardking.com/2011/12/%e4%b8%8a%e6%b5%b7-%e5%a4%9a%e5%b9%b4%e7%9a%84%e8%81%8c%e4%b8%9a%e5%8f%91%e5%b1%95%e7%9b%ae%e6%a0%87/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Exchange 2007垃圾邮件过滤白名单设置</title>
		<link>http://www.wardking.com/2011/11/message-rejected-as-spam-by-content-filtering/</link>
		<comments>http://www.wardking.com/2011/11/message-rejected-as-spam-by-content-filtering/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 08:45:52 +0000</pubDate>
		<dc:creator>Michael ZHANG</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.wardking.com/?p=1426</guid>
		<description><![CDATA[今天配置了一台ICINGA/Nagios服务器，尝试Sendmail和postfix后，发现给163.com邮箱发件可以收到，但是给自己域内的Exchange邮箱发送始终不成功。经过仔细分析后，发现root用户收到一封系统邮件，其中一句是 reason: 550 5.7.1 Message rejected as spam by Content Filtering.这样看来应该是被Exchange邮件服务器直接拒绝了。

为了不改变当前的Exchange邮件服务器安全策略等级，决定采用增加白名单的办法，具体操作如下：

打开Exchange Management Shell，首先检查当前的设置，使用以下命令：Get-ContentFilterConfig，查看输出结果中的ByPassedSenders设定值，并记录。

添加新的发件人白名单：Set-ContentFilterConfig -BypassedSenders icinga@wardking.com, jdoe@abc.com
由于执行的是覆盖操作，因此在这里要把先前设定的发件人也一并附上。

如果需要添加整个域中的所有发件人到白名单，执行以下操作：
Set-ContentFilterConfig -BypassedSenderDomains wardking.com, *.xyz.com

当白名单添加至一定数量时，会发现以上的操作很麻烦，此时可以使用变量：
执行添加操作：
$x = Get-ContentFilterConfig
$x.BypassedSenders += “icinga@wardking.com”, “nagios@wardking.com”

执行删除操作：
$x = Get-ContentFilterConfig
$x.BypassedSenders -= “icinga@wardking.com”

清空名单列表
Set-ContentFilterConfig -BypassedSenders $null]]></description>
		<wfw:commentRss>http://www.wardking.com/2011/11/message-rejected-as-spam-by-content-filtering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache+Tomcat运行环境下JSP程序的验证码无法显示</title>
		<link>http://www.wardking.com/2011/09/jsp-captcha-error-on-tomcat-with-apache/</link>
		<comments>http://www.wardking.com/2011/09/jsp-captcha-error-on-tomcat-with-apache/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 05:41:41 +0000</pubDate>
		<dc:creator>Michael ZHANG</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://www.wardking.com/?p=1422</guid>
		<description><![CDATA[<p>同事发来一个用JSP编写的小程序，配置好Tomcat，并使用Proxy配合Apache实现了端口转发。刚开始运行的三天里，一切正常。</p>
<p>今天报告一个非常奇怪的问题。用户登录界面的验证码突然不显示了，仔细检查了Apache虚拟主机和Tomcat的相关配置文件，没有发现被改动的迹象。 Tomcat日志中仅有一句：</p>
<blockquote><p>ERROR [com.nbqt.util.CaptchaServiceSingleton] - <校验码校验异常 ＝＝ java.lang.NullPointerException>
</p></blockquote>
<p>在Google里查寻了数篇关于java.lang.NullPointerException的文章，众说纷云。几经尝试，终于找到以下解决办法：</p>
<p>修改tomcat下的/bin/catalina.sh文件。找到-Djava.io.tmpdir="$CATALINA_TMPDIR"，在这一行的下面加入-Djava.awt.headless=true \ 一共需要修改六处，改完重启tomcat。</p>
<p>错误原因是tomcat没有加载java.awt.headless</p>]]></description>
		<wfw:commentRss>http://www.wardking.com/2011/09/jsp-captcha-error-on-tomcat-with-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>将top命令显示内容输出至文本文件</title>
		<link>http://www.wardking.com/2011/08/howto-capture-linux-top-command-output-to-text-file/</link>
		<comments>http://www.wardking.com/2011/08/howto-capture-linux-top-command-output-to-text-file/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 03:54:52 +0000</pubDate>
		<dc:creator>Michael ZHANG</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://www.wardking.com/?p=1419</guid>
		<description><![CDATA[习惯于使用top命令检查Linux系统的当前资源使用情况，但是如何将其输出至文件呢？首先想到的肯定是管道重定向，使用大于符号&#62;，试试看：
<blockquote>[michael@wardking.com ~]$ top -n 1 &#62; top-output

[michael@wardking.com ~]$ less top-output
"top-output" may be a binary file.  See it anyway?</blockquote>
直接输出的结果是二进制文件？没错！看来得另想办法，遇到问题先读manual，这是学习Linux必须养成的习惯。仔细阅读会发现以下两项：
<blockquote>-b : Batch mode operation
Starts top in 'Batch mode', which could be useful for sending output from top to other programs or to a file. In this mode, top will not accept input and runs until the iterations limit you've set with the '-n' command-line option or until killed.

-n : Number of iterations limit as: -n number
Specifies the maximum number of iterations, or frames, top should produce before ending.</blockquote>
看来选项-b是关键，在top命令后加上后试试
<blockquote>[michael@wardking.com ~]$ top -n 1 -b &#62; top-output

[michael@wardking.com ~]$ less top-output
top - 11:44:32 up 8 days,  1:53,  1 user,  load average: 0.00, 0.00, 0.00
Tasks: 131 total,   1 running, 130 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.1%us,  0.0%sy,  0.0%ni, 99.7%id,  0.1%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   4046052k total,  3807064k used,   238988k free,   278240k buffers
Swap:  2031608k total,      140k used,  2031468k free,  2733024k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
28280 root      15   0 12760  984  720 R  2.0  0.0   0:00.01 top
    1 root      15   0 10372  692  580 S  0.0  0.0   0:00.90 init
    2 root      RT  -5     0    0    0 S  0.0  0.0   0:00.56 migration/0
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
    4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0
    5 root      RT  -5     0    0    0 S  0.0  0.0   0:00.01 migration/1
    6 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/1</blockquote>
输出的结果正是所需要的！

接下来做进一步思考，既然可以按照此方法输出至文本文件，也可以使用管道直接输出为其它命令的参数，比如：top -n 1 &#124; less，或者top -n 1 -b &#124; grep -e httpd -e COMMAND]]></description>
		<wfw:commentRss>http://www.wardking.com/2011/08/howto-capture-linux-top-command-output-to-text-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows 2008R2活动目录中不是回收站的“回收站”功能</title>
		<link>http://www.wardking.com/2011/07/active-directory-recycle-bin-in-windows-server-2008-r2/</link>
		<comments>http://www.wardking.com/2011/07/active-directory-recycle-bin-in-windows-server-2008-r2/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 13:49:14 +0000</pubDate>
		<dc:creator>Michael ZHANG</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[活动目录]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.wardking.com/?p=1409</guid>
		<description><![CDATA[原文来自：http://searchwindowsserver.techtarget.com/tip/When-is-a-Recycle-Bin-Not-a-Recycle-Bin-When-its-in-Active-Directory?asrc=EM_NLN_14422016&#38;track=NL-463&#38;ad=840235

当人们谈到Windows操作系统中的回收站功能时，都会不约而同地想到桌面上的回收站图标。通过简单地双击，就可以看到被删除的文件夹和文件。

在Windows 2008R2中，微软在Active Directory中推出了回收站Active Directory Recycle Bin (ADRB)功能，非常多的技术人员都期盼这一功能应该是某种图形化的界面，可以非常容易地拖拽。然而不幸地是，并没有这种万众期盼的功能。活动目录中的回收站功能，并不是大家熟知的文件管理器中的回收站。从某方面说，它是一种非常有用的恢复工具，只是需要注意它的功能和使用限制。

在没有ADRB之前，管理员仍可以恢复被删除的AD对象，但是需要非常熟练地掌握Active Directory的相关知识，例如：需要将域控制器置于离线模式，在经过授权的情况下执行域控制器恢复，以及相关的操作步骤。如果需要恢复最近删除的Active Directory对象，亦可以使用类似ADSIEdit的命令行工具，直接修改对象的tombstone属性值，使其不再显示为“已删除”。但是，即使成功恢复该对象，仍然还有很多的属性值丢失。因此而不得不从内存、或者从备份中恢复先前的版本。总的来说，恢复单个已删除的Active Directory始终是一件很头痛的事。

针对以上情况，微软推出ADRB，旨在提高管理员的效率，降低难度。如何使用ADRB呢？首先，ADRB功能必须在Windows Server 2008 R2级别的域上启用，这也意味着所有的域控制器必须使用对应版本的Windows系统。其次，必须通过PowerShell命令行启用ADRB功能。这里还有一些限制。第一，ADRB只能恢复整个被删除的对象，不能够恢复对象的单个发生。第二，当试图恢复整个被删除的OU时，情况变得比较复杂：必须先恢复container（容器），然后搜索并恢复该容器中的对象。

目前，ADRB并不是一个很好的恢复方案，但是明显地好于以前版本的Windows Server操作系统。部署Activ Directory的企业组织可能还是会优先选择第三方的Active Directory恢复工具，可以非常方便地使用图形化界面的拖拽功能，支持单个属性恢复，以及更多的高级功能。]]></description>
		<wfw:commentRss>http://www.wardking.com/2011/07/active-directory-recycle-bin-in-windows-server-2008-r2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何使用Nagios监控Cisco交换机硬件及运行状态</title>
		<link>http://www.wardking.com/2011/06/monitoring-cisco-switch-by-nagios/</link>
		<comments>http://www.wardking.com/2011/06/monitoring-cisco-switch-by-nagios/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 04:19:09 +0000</pubDate>
		<dc:creator>Michael ZHANG</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.wardking.com/?p=1399</guid>
		<description><![CDATA[系统环境：Nagios 3.x + CentOS 5.6 + Cisco 4500

前提条件：
1. Cisco交换机都支持SNMP协议，只需要简单的设置即可开启，例如：snmp-server community snmppw RO。更加详细的设置请使用Google搜索“Cisco 开启 SNMP”，参考网上相关文章。

2. 在安装Nagios之前，必须已经安装Net-Utils及其开发组件。成功安装Nagios之后，再次检查libexec目录下有check_snmp命令。

系统测试：
check_snmp命令提供了详细的使用说明，只需要在Linux命令行输入 check_snmp --help即可查看帮助信息，这其中包括每一项参数的使用等。

这里以检测Cisco交换机的系统为例，示范如何使用check_snmp。交换机为Cisco 4500系列，系统描述的OID为.1.3.6.1.2.1.1.1.0
<blockquote>[root@wardking libexec]# ./check_snmp -H 10.241.10.1 -o .1.3.6.1.2.1.1.1.0 -C snmppw
SNMP OK - "Cisco IOS Software, Catalyst 4500 L3 Switch Software (cat4500-ENTSERV              &#124;  K9-M), Version 12.2(53)SG2, RELEASE SOFTWARE (fc1)</blockquote>
建议用于Nagios监控的OID:
系统内存使用（5分钟内）1.3.6.1.4.1.9.9.48.1.1.1.5.1
系统可用内存（5分钟内）1.3.6.1.4.1.9.9.48.1.1.1.6.1
CPU使用率（5分钟内）1.3.6.1.4.1.9.2.1.58.0
硬件状态1.3.6.1.4.1.9.9.13
<!--more-->
系统配置：
由于使用check_snmp检测的结果不够人性化，大部分的结果都需要重新调整。使用Perl脚本调用NET::SNMP模块，实现收集监控结果，并重新输出，更易阅读和使用。

这里引用4个从国外网站收集的脚本，<a rel="attachment wp-att-1403" href="http://www.wardking.com/2011/06/monitoring-cisco-switch-by-nagios/check_snmp_env/">check_snmp_env</a>, <a rel="attachment wp-att-1402" href="http://www.wardking.com/2011/06/monitoring-cisco-switch-by-nagios/check_snmp_cisco_memutil/">check_snmp_cisco_memutil</a>, <a rel="attachment wp-att-1401" href="http://www.wardking.com/2011/06/monitoring-cisco-switch-by-nagios/check_snmp_cisco_loadavg/">check_snmp_cisco_loadavg</a>, <a rel="attachment wp-att-1400" href="http://www.wardking.com/2011/06/monitoring-cisco-switch-by-nagios/check_snmp_cisco_ifstatus/">check_snmp_cisco_ifstatus</a>

请下载至nagios安装目录下的libexec子目录中，例如/usr/local/nagios/libexec，重命名去掉txt扩展名，赋予可执行权限：
<blockquote>[root@nagios libexec]# pwd
/usr/local/nagios/libexec
[root@nagios libexec]# chmod a+x check_snmp_cisco_* check_snmp_env -v
mode of `check_snmp_cisco_ifstatus' retained as 0755 (rwxr-xr-x)
mode of `check_snmp_cisco_loadavg' retained as 0755 (rwxr-xr-x)
mode of `check_snmp_cisco_memutil' retained as 0755 (rwxr-xr-x)
mode of `check_snmp_env' retained as 0755 (rwxr-xr-x)</blockquote>
剩下的工作就是follow标准流程设置监控命令，添加被监控的交换机和服务了。

编辑etc/objects/command.cfg，添加如下定义：
<blockquote>#Check Cisco, Extreme and Juniper hardware
define command{
command_name    check_snmp_env
command_line    $USER1$/check_snmp_env -H $HOSTADDRESS$ -C $ARG1$ $ARG2$
}
#Cisco SNMP device monitoring

define command{
command_name    check_snmp_cisco_mem
command_line    $USER1$/check_snmp_cisco_memutil -H $HOSTADDRESS$ -C $ARG1$ -w $ARG2$ -c $ARG3$
}
define command{
command_name    check_snmp_cisco_cpu
command_line    $USER1$/check_snmp_cisco_loadavg -H $HOSTADDRESS$ -C $ARG1$ -w $ARG2$ -c $ARG3$
}
define command{
command_name    check_snmp_cisco_if
command_line    $USER1$/check_snmp_cisco_ifstatus -H $HOSTADDRESS$ -C $ARG1$ -i $ARG2$ -w $ARG3$ -c $ARG4$
}</blockquote>
编辑switch.cfg加入监控的交换机配置，新增相关系统服务，例如：
<blockquote>define service{
use                     generic-service ; Inherit values from a template
host_name               CAT4506E_B1_LG3_1,  CAT4506E_B3_A09L_1, CAT4507R_B5_A09R_1, CAT4507R_B1_LG3_1, CAT4507R_B5_D12_1, RackSW_PDC_1, RackSW_PDC_2, RackSW_PDC_3, RackSW_PDC_4, RackSW_SDC_2, RackSW_SDC_3
service_description     Environment
check_command           check_snmp_env!snmppw
}
define service{
use                     generic-service ; Inherit values from a template
host_name               CAT4507R_B5_D12_1, CAT4507R_B1_LG3_1, CAT4506E_B1_LG3_1,  CAT4506E_B3_A09L_1, CAT4507R_B5_A09R_1
service_description     LoadAVG
check_command           check_snmp_cisco_cpu!snmppw!60!80
}
define service{
use                     generic-service ; Inherit values from a template
host_name               CAT4507R_B5_D12_1, CAT4507R_B1_LG3_1, CAT4506E_B1_LG3_1,  CAT4506E_B3_A09L_1, CAT4507R_B5_A09R_1
service_description     Memutil
check_command           check_snmp_cisco_mem!snmppw!70!90
}</blockquote>

最终监控列表：
<a href="http://www.wardking.com/2011/06/monitoring-cisco-switch-by-nagios/check_snmp_cisco/" rel="attachment wp-att-1404"><img src="http://www.wardking.com/wp-content/uploads/2011/06/check_snmp_cisco-450x190.png" alt="" title="check_snmp_cisco" width="450" height="190" class="alignnone size-medium wp-image-1404" /></a>]]></description>
		<wfw:commentRss>http://www.wardking.com/2011/06/monitoring-cisco-switch-by-nagios/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>在浏览器中通过Javascript启动Linux系统</title>
		<link>http://www.wardking.com/2011/05/%e5%9c%a8%e6%b5%8f%e8%a7%88%e5%99%a8%e4%b8%ad%e9%80%9a%e8%bf%87javascript%e5%90%af%e5%8a%a8linux%e7%b3%bb%e7%bb%9f/</link>
		<comments>http://www.wardking.com/2011/05/%e5%9c%a8%e6%b5%8f%e8%a7%88%e5%99%a8%e4%b8%ad%e9%80%9a%e8%bf%87javascript%e5%90%af%e5%8a%a8linux%e7%b3%bb%e7%bb%9f/#comments</comments>
		<pubDate>Wed, 18 May 2011 12:05:44 +0000</pubDate>
		<dc:creator>Michael ZHANG</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.wardking.com/?p=1395</guid>
		<description><![CDATA[今天发现<a href="http://bellard.org/">Fabrice Bellard</a>编写了一个在JavaScript中运行的模拟器，使得用户在浏览器中就可以<a href="http://bellard.org/jslinux/">启动Linux</a>。但目前仅支持Firefox 4和Google Chrome 11)。他是QEMU模拟器项目的创始人。另有报道称，他去年曾用个人电脑创造了<a href="http://science.solidot.org/article.pl?sid=10/01/05/1021257&#38;tid=41">Pi的世界纪录</a>。

<a rel="attachment wp-att-1396" href="http://www.wardking.com/2011/05/%e5%9c%a8%e6%b5%8f%e8%a7%88%e5%99%a8%e4%b8%ad%e9%80%9a%e8%bf%87javascript%e5%90%af%e5%8a%a8linux%e7%b3%bb%e7%bb%9f/jspcemulator/"><img class="alignnone size-full wp-image-1396" title="jspcemulator" src="http://www.wardking.com/wp-content/uploads/2011/05/jspcemulator.png" alt="" width="662" height="621" /></a>]]></description>
		<wfw:commentRss>http://www.wardking.com/2011/05/%e5%9c%a8%e6%b5%8f%e8%a7%88%e5%99%a8%e4%b8%ad%e9%80%9a%e8%bf%87javascript%e5%90%af%e5%8a%a8linux%e7%b3%bb%e7%bb%9f/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>通过Nagios监控VMware ESX/ESXi/vSphere服务器</title>
		<link>http://www.wardking.com/2011/05/monitoring-vmware-esx-3-x-esxi-vsphere-4-and-vcenter-server/</link>
		<comments>http://www.wardking.com/2011/05/monitoring-vmware-esx-3-x-esxi-vsphere-4-and-vcenter-server/#comments</comments>
		<pubDate>Tue, 17 May 2011 11:56:44 +0000</pubDate>
		<dc:creator>Michael ZHANG</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://www.wardking.com/?p=1388</guid>
		<description><![CDATA[桦凌信息技术服务工作室翻译，转载请注明出处：<a href="http://www.wardking.com/2011/05/monitoring-vmware-esx-3-x-esxi-vsphere-4-and-vcenter-server">http://www.wardking.com/2011/05/monitoring-vmware-esx-3-x-esxi-vsphere-4-and-vcenter-server</a>

本文主要阐述如何使用Nagios的扩展插件check_esx来监控VMware ESX和vSphere服务器。既可以实现监控单台ESX(i)/vSphere服务器，也可以监控VirtualCenter/vCenter服务器集群。当企业中已经部署虚拟数据中心(vCenter)时，应该监控vCenter而不是单台VM服务器。

本文目标：
<ol>
	<li>监控 VMware ESX Datacenter/vCenter 虚拟数据中心</li>
	<li>监控 VMware ESX/vSphere 服务器</li>
	<li>直接监控运行于VMware 架构上的虚拟服务器</li>
	<li>通过虚拟数据中心监控虚拟服务器</li>
	<li>通过虚拟数据中心监控ESX/vSphere服务器</li>
</ol>
<!--more--><strong>实施需求：</strong>

首先在ESX/vSphere主机系统中添加一个新的用户，加入"user"组，赋予"Read Only"权限。具体设置可以参考vSphere手册。

必须在Nagios服务器上安装VMware vSphere SDK for Perl工具包，如果你已经在VMware网站注册，可以直接从这里下载：<a href="http://communities.vmware.com/community/developer/forums/vsphere_sdk_perl">http://communities.vmware.com/community/developer/forums/vsphere_sdk_perl</a>。请根据你的操作系统下载对应的32bit/64bit版本。

<strong>监控命令：</strong>
从这里下载<a rel="attachment wp-att-1415" href="http://www.wardking.com/2011/05/monitoring-vmware-esx-3-x-esxi-vsphere-4-and-vcenter-server/check_esx3/">check_esx3</a>，存放至nagios安装目录下的libexec目录中，建议更名为check_esx3，并添加可执行权限。

编辑Nagios配置文件command.cfg，添加监控命令：
<blockquote># VMware ESX Infrastructure
define command{
command_name check_esx3_host_cpu_usage
command_line $USER1$/check_esx3 -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -l cpu -s usage -w $ARG3$ -c $ARG4$
}

define command{
command_name check_esx3_host_mem_usage
command_line $USER1$/check_esx3 -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -l mem -s usage -w $ARG3$ -c $ARG4$
}

define command{
command_name check_esx3_host_swap_usage
command_line $USER1$/check_esx3 -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -l mem -s swap -w $ARG3$ -c $ARG4$
}

define command{
command_name check_esx3_host_net_usage
command_line $USER1$/check_esx3 -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -l net -s usage -w $ARG3$ -c $ARG4$
}

define command{
command_name check_esx3_host_vmfs
command_line $USER1$/check_esx3 -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -l vmfs -s $ARG3$ -w $ARG4$ -c $ARG5$
}

define command{
command_name check_esx3_host_runtime_status
command_line $USER1$/check_esx3 -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -l runtime -s status
}

define command{
command_name check_esx3_host_runtime_issues
command_line $USER1$/check_esx3 -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -l runtime -s issues
}

define command{
command_name check_esx3_dc_host_cpu_usage
command_line $USER1$/check_esx3 -D $ARG1$ -u $ARG2$ -p $ARG3$ -H $HOSTALIAS$ -l cpu -s usage -w $ARG4$ -c $ARG5$
}

define command{
command_name check_esx3_dc_host_mem_usage
command_line $USER1$/check_esx3 -D $ARG1$ -u $ARG2$ -p $ARG3$ -H $HOSTALIAS$ -l mem -s usage -w $ARG4$ -c $ARG5$
}

更多命令设置参考./check_esx3 --help</blockquote>
<strong>设置监控主机和服务</strong>

建议设置自定义配置文件esx.cfg，以下为部分设置：
<blockquote>define host{
        use             linux-server
        host_name       vSphere3
        alias           vSphere Host3(SSB412)
        address         10.2.1.153
        hostgroups      ESX
        icon_image      vmware.png
        icon_image_alt  VMware vSphere (SSB412)
        vrml_image      vmware.jpg
        statusmap_image vmware.gd2
        2d_coords       800,900
        parents         RackSW_PDC_1
        }

define service{
        use                     generic-service
        host_name               VM-ESXi-01,VM-ESXi-02,vSphere1,vSphere2,vSphere3
        service_description     CPU Usage
        check_command         check_esx3_host_cpu_usage!nagios!password!100!110
        }

define service{
        use                     generic-service
        host_name               VM-ESXi-01,VM-ESXi-02,vSphere1,vSphere2,vSphere3
        service_description     Memory Usage
        check_command         check_esx3_host_mem_usage!nagios!password!100!110
        }</blockquote>
监控效果：

<a rel="attachment wp-att-1389" href="http://www.wardking.com/2011/05/monitoring-vmware-esx-3-x-esxi-vsphere-4-and-vcenter-server/nagios-monitoring-vmware/"><img class="alignnone size-full wp-image-1389" title="nagios-monitoring-vmware" src="http://www.wardking.com/wp-content/uploads/2011/05/nagios-monitoring-vmware.png" alt="" width="473" height="387" /></a>

如有问题，欢迎交流。]]></description>
		<wfw:commentRss>http://www.wardking.com/2011/05/monitoring-vmware-esx-3-x-esxi-vsphere-4-and-vcenter-server/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>倒车练习小游戏Flash</title>
		<link>http://www.wardking.com/2011/05/howto-stop-car/</link>
		<comments>http://www.wardking.com/2011/05/howto-stop-car/#comments</comments>
		<pubDate>Thu, 12 May 2011 12:38:31 +0000</pubDate>
		<dc:creator>Michael ZHANG</dc:creator>
				<category><![CDATA[生活日志]]></category>

		<guid isPermaLink="false">http://www.wardking.com/?p=1372</guid>
		<description><![CDATA[多年不开车的我，在上周末租了一辆赛欧，在Kevin LI的大力帮助下，总算再次熟悉起来。马路上行驶已经找回了感觉，但是倒车从开始学车时就很勉强。

今天找了一些资料，包括视频小游戏，帮助复习。

<a rel="attachment wp-att-1375" href="http://www.wardking.com/2011/05/howto-stop-car/howtostopcar/">How to stop your car</a>

<a rel="attachment wp-att-1374" href="http://www.wardking.com/2011/05/howto-stop-car/attachment/2008320193832776/"><img class="alignnone size-medium wp-image-1374" title="2008320193832776" src="http://www.wardking.com/wp-content/uploads/2011/05/2008320193832776-450x244.jpg" alt="" width="450" height="244" /></a>]]></description>
		<wfw:commentRss>http://www.wardking.com/2011/05/howto-stop-car/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

