<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[张宴的博客]]></title> 
<link>http://zyan.cc/index.php</link> 
<description><![CDATA[Web系统架构与底层研发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[张宴的博客]]></copyright>
<item>
<link>http://zyan.cc/post/276/</link>
<title><![CDATA[本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>张宴 &lt;net@s135.com&gt;</author>
<category><![CDATA[其他Unix技术]]></category>
<pubDate>Fri, 03 Aug 2007 10:40:46 +0000</pubDate> 
<guid>http://zyan.cc/post/276/</guid> 
<description>
<![CDATA[ 
	　　[文章作者：张宴 本文版本：v1.0 最后修改：2007.08.03 转载请注明出处：<a href="http://blog.zyan.cc" target="_blank">http://blog.zyan.cc</a>]<br/><br/>　　我管理服务器太多了，不可能每时每刻都登录到上面查看服务器状况，于是写了一个“服务器监控系统 ServMon V1.0”。其原理是用shell脚本定时抓取被监控服务器上信息，再用curl POST到监控机的PHP接口程序上，由PHP接口程序对信息进行分析，如果存在异常，则发送报警邮件给管理员。<br/><br/>　　下午，ServMon V1.0 已经在sina播客服务器上部署，以下为ServMon的删节版内容，只监控磁盘分区使用率和Swap交换空间两项：<br/><br/>　　<a href="http://zyan.cc/attachment/200708/servmon1.gif" target="_blank"><img src="http://zyan.cc/attachment/200708/servmon1.gif" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>　　1、被监控端服务器的shell脚本（Linux）<br/>　　(1)、发送磁盘分区使用率给监控端接口<a href="http://192.168.0.28/servmon/interface.php" target="_blank">http://192.168.0.28/servmon/interface.php</a>的脚本<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">/usr/local/servmon/bin/diskstat_send<br/>#!/bin/sh<br/>LANG=zh_cn<br/>disk=$(/bin/df -kP &#124; grep / &#124; awk -F ' ' ' &#123;print $6":"$5&#125;' &#124; awk -F '%' ' &#123;print $1&#125;' &#124; tr -s '&#92;n' ';')<br/>today=$(date -d "today" +"%Y-%m-%d_%H:%M:%S")<br/>ip=$(/sbin/ifconfig &#124; grep "inet addr" &#124; grep -v "127.0.0.1" &#124; awk '&#123;print $2;&#125;' &#124; awk -F':' '&#123;print $2;&#125;' &#124; tr -s '&#92;n' ';')<br/>/usr/bin/curl -d menu=diskstat -d password=$2 -d date=$today -d ip=$ip -d data=$disk $1</div></div><br/>............<br/><br/>Tags - <a href="http://zyan.cc/tags/linux/" rel="tag">linux</a> , <a href="http://zyan.cc/tags/php/" rel="tag">php</a>
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment221</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>无香 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sat, 04 Aug 2007 09:19:38 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment221</guid> 
<description>
<![CDATA[ 
	救命啊 qq被盗了怎么办啊 <br/> &nbsp; &nbsp;哭救救我啊
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment222</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>王彤 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sun, 05 Aug 2007 09:22:01 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment222</guid> 
<description>
<![CDATA[ 
	没太看懂你写的 &nbsp; 那157段 是什么编的？
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment256</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>LALA &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sat, 25 Aug 2007 07:38:13 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment256</guid> 
<description>
<![CDATA[ 
	还有没有在Linux下监控服务器的CPU ,内存和 MySQL数据库的使用情况呢?能否再发贴补上呀?关注+ING......
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment262</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>zhangluoer &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 28 Aug 2007 05:18:54 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment262</guid> 
<description>
<![CDATA[ 
	在正常使用的服务器上打开sendmail岂不是又为系统暴露了一个漏洞，再说sendmail的漏洞是出了名的。如果在内网使用的话，邮件怎么传送到你的邮箱里呢？这与只打开必须的服务，最少的服务有点不符啊！<br/>每个服务器上都要打开sendmail不成？<br/>别外，监控MYSQL数据库，主要的方法是什么？通过什么样的监控手段来证明服务器是正常运行的？讲讲原理呗！
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment263</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>LALA &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 28 Aug 2007 07:43:09 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment263</guid> 
<description>
<![CDATA[ 
	再请问：在Linux下能不能监控服务器的 MySQL数据库的使用情况呢?它的脚本如何写？<br/>谢谢。。。
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment288</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>sbear &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Mon, 03 Sep 2007 04:44:09 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment288</guid> 
<description>
<![CDATA[ 
	为什么不用snmp么？比cacti有什么优势？
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment297</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>coolzsb &lt;coolzsb@gmail.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 04 Sep 2007 07:15:45 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment297</guid> 
<description>
<![CDATA[ 
	snmp+cacti还可以再加一个cacti的thold插件
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment299</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>sbear &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 04 Sep 2007 09:05:19 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment299</guid> 
<description>
<![CDATA[ 
	楼上正解，还有monitor插件
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment311</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>WW &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 07 Sep 2007 03:53:48 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment311</guid> 
<description>
<![CDATA[ 
	为什么总是提示数据验证密码错误！！
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment346</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>qintel &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 19 Sep 2007 15:02:20 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment346</guid> 
<description>
<![CDATA[ 
	用shell的expect+telnet直接就可以发邮件了，不必再发到php接口程序上。<br/><a href="http://docs.google.com/View?docID=dhjp43kc_15hjhs5m" target="_blank">http://docs.google.com/View?docID=dhjp43kc_15hjhs5m</a>
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment547</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>三源电子 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sun, 30 Dec 2007 13:42:28 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment547</guid> 
<description>
<![CDATA[ 
	好厉害。学习了！
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment641</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>Julyclyde &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 31 Jan 2008 14:05:34 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment641</guid> 
<description>
<![CDATA[ 
	年轻人，用LANG=zh_CN的时候别忘记指定具体编码方式，是GB2312还是UTF-8呢？我发现新浪的人总是在这个问题上不够明确<br/><br/>另外，系统脚本最好在LANG=C的情况下运行
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment831</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>zyu &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 25 Mar 2008 08:04:31 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment831</guid> 
<description>
<![CDATA[ 
	顶
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment1485</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>lovethetree &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 02 Sep 2008 13:33:41 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment1485</guid> 
<description>
<![CDATA[ 
	都是好思路，学习了 家门儿
]]>
</description>
</item><item>
<link>http://zyan.cc/post/276/#blogcomment1486</link>
<title><![CDATA[[评论] 本周写的“Linux服务器监控系统 ServMon V1.0”[原创]]]></title> 
<author>lovethetree &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 02 Sep 2008 13:34:43 +0000</pubDate> 
<guid>http://zyan.cc/post/276/#blogcomment1486</guid> 
<description>
<![CDATA[ 
	迟了一年
]]>
</description>
</item>
</channel>
</rss>