<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.feedsky.com/styles/feedsky7.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" 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/" version="2.0"><channel><atom:link href="http://feed.8next.com" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/neemem" type="application/rss+xml"></fs:self_link><lastBuildDate>Wed, 08 Oct 2008 02:18:32 GMT</lastBuildDate><title>Neemem's Blog</title><image><url>http://www.feedsky.com/images/feedsky_logologo.gif</url><title>Neemem's Blog</title><link>http://www.8next.com</link></image><link>http://www.8next.com</link><language>en</language><pubDate>Wed, 08 Oct 2008 02:18:32 GMT</pubDate><item><title>eZ Publish 4.1 adds native support for Sun Solaris 10 and Oracle Database</title><link>http://item.feedsky.com/~feedsky/neemem/~7060273/121736000/5136544/1/item.html</link><content:encoded>&lt;div class=&quot;attribute-short&quot;&gt;
&lt;p&gt;On June 18th, 2008, during eZ Conference&amp;#8217;s developer day, eZ Systems announced that the upcoming eZ Publish &lt;a href=&quot;http://www.8next.com/archives/tag/41&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with 4.1&quot;&gt;4.1&lt;/a&gt; will support &lt;a href=&quot;http://www.8next.com/archives/tag/sun-solaris-10&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with sun solaris 10&quot;&gt;Sun Solaris 10&lt;/a&gt; and &lt;a href=&quot;http://www.8next.com/archives/tag/oracle&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with oracle&quot;&gt;Oracle&lt;/a&gt; Database. In addition, new features that enhance the user experience were also presented, including a new version of the Online Editor and multi-upload functionality.&lt;/p&gt;&lt;/div&gt;
&lt;div class=&quot;attribute-long&quot;&gt;
&lt;p&gt;eZ&amp;#8217;s focus with the eZ Publish Content Management System is to combine a powerful enterprise platform with a rich user interface.&lt;br /&gt;
&amp;#8220;Our demanding customers, especially within the media industry, need a flexible and powerful platform capable of handling any type of content. They use eZ Publish to serve millions of visitors, and also for the easy-to-use interfaces that enable both editors and users to quickly publish their articles, blogs, videos, and more,&amp;#8221; explains Bård Farstad, Co-Founder and Chief Technology Officer at eZ Systems.&lt;/p&gt;
&lt;p&gt;Developer day took place at the new eZ &lt;a href=&quot;http://www.8next.com/archives/tag/headquarters-location&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with headquarters location&quot;&gt;Headquarters location&lt;/a&gt; in Skien, Norway. eZ developers from around the world came together to discuss and present on eZ Publish, eZ Components and the surrounding technologies. eZ Conference continues with two more days that include presentations about best practices for eZ&amp;#8217;s products and eZ Publish for online digital media.&lt;/p&gt;
&lt;p&gt;For more information on eZ Publish, visit     &lt;a href=&quot;http://ez.no/&quot;&gt;http://ez.no/ezpublish&lt;/a&gt;&lt;br /&gt;
For more information on eZ Conference, visit     &lt;a href=&quot;http://conference.ez.no/&quot;&gt;http://conference.ez.no&lt;/a&gt;&lt;/div&gt;

	Tags: &lt;a href=&quot;http://www.8next.com/archives/tag/ezpublish&quot; title=&quot;ezpublish&quot; rel=&quot;tag&quot;&gt;ezpublish&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/headquarters-location&quot; title=&quot;headquarters location&quot; rel=&quot;tag&quot;&gt;headquarters location&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/native&quot; title=&quot;native&quot; rel=&quot;tag&quot;&gt;native&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/oracle&quot; title=&quot;oracle&quot; rel=&quot;tag&quot;&gt;oracle&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/solaris&quot; title=&quot;solaris&quot; rel=&quot;tag&quot;&gt;solaris&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/sun-solaris-10&quot; title=&quot;sun solaris 10&quot; rel=&quot;tag&quot;&gt;sun solaris 10&lt;/a&gt;&lt;br /&gt;

	&lt;h4&gt;Related posts&lt;/h4&gt;
	&lt;ul class=&quot;st-related-posts&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.8next.com/archives/2779&quot; title=&quot;Building an eZ publish module (September 22, 2008)&quot;&gt;Building an eZ publish module&lt;/a&gt; (0)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=4537cea20222bcc52c29035e5e839e51&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=4537cea20222bcc52c29035e5e839e51&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=7a5d586b17c69590e909bb7eaf2f7a96&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=7a5d586b17c69590e909bb7eaf2f7a96&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=623a3b94f93d7a751ca25250167c0f30&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=623a3b94f93d7a751ca25250167c0f30&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=ea55c206d9fc6ae04760ed67dffa15e8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=ea55c206d9fc6ae04760ed67dffa15e8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=234c9a4f7e0005463effcf41de90f88c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=234c9a4f7e0005463effcf41de90f88c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=26f52ec065c123b76b33f388915e20ed&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=26f52ec065c123b76b33f388915e20ed&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=aed1182f897fe7b7b7bafba5affb8c29&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=aed1182f897fe7b7b7bafba5affb8c29&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=b2e6aa7b7acf688e349f329c9cd4c8b6&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=b2e6aa7b7acf688e349f329c9cd4c8b6&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://www.8next.com/archives/2883/feed</wfw:commentRss><description>On June 18th, 2008, during eZ Conference&amp;#8217;s developer day, eZ Systems announced that the upcoming eZ Publish 4.1 will support Sun Solaris 10 and Oracle Database. In addition, new features that enhance the user experience were also presented, includ...&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=4537cea20222bcc52c29035e5e839e51&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=4537cea20222bcc52c29035e5e839e51&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=7a5d586b17c69590e909bb7eaf2f7a96&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=7a5d586b17c69590e909bb7eaf2f7a96&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=623a3b94f93d7a751ca25250167c0f30&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=623a3b94f93d7a751ca25250167c0f30&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=ea55c206d9fc6ae04760ed67dffa15e8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=ea55c206d9fc6ae04760ed67dffa15e8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=234c9a4f7e0005463effcf41de90f88c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=234c9a4f7e0005463effcf41de90f88c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=26f52ec065c123b76b33f388915e20ed&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=26f52ec065c123b76b33f388915e20ed&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=aed1182f897fe7b7b7bafba5affb8c29&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=aed1182f897fe7b7b7bafba5affb8c29&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=b2e6aa7b7acf688e349f329c9cd4c8b6&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=b2e6aa7b7acf688e349f329c9cd4c8b6&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>sun solaris 10</category><category>solaris</category><category>oracle</category><category>PHP</category><category>ezpublish</category><category>headquarters location</category><category>native</category><pubDate>Wed, 08 Oct 2008 10:18:32 +0800</pubDate><author>neemem</author><comments>http://www.8next.com/archives/2883#comments</comments><guid isPermaLink="false">http://www.8next.com/?p=2883</guid><dc:creator>neemem</dc:creator><fs:srclink>http://www.8next.com/archives/2883</fs:srclink><fs:srcfeed>http://www.8next.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/neemem/~7060273/121736000/5136544</fs:itemid></item><item><title>nagios的安装和配置</title><link>http://item.feedsky.com/~feedsky/neemem/~7060273/121736001/5136544/1/item.html</link><content:encoded>&lt;p&gt;&lt;span class=&quot;f14&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;什么是&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;？&lt;br /&gt;
&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;是一款网络管理软件，开源的软件。能够对网络内的主机和硬件设备进行状态监控。 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;f14&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;的优势：&lt;br /&gt;
免费；开源；高扩展性。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;f14&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;能实现的功能：&lt;br /&gt;
1. 状态监控&lt;br /&gt;
2. 预警处理&lt;br /&gt;
3. 集中，规模化管理&lt;br /&gt;
4. 可视化显示方式&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;f14&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;的实现方式：&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;采用分布-集中的管理模式。在&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;服务器上安装&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;主程序，&lt;br /&gt;
在被监控主机上安装&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;代理程序。通过&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;主程序和&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;代理程序之间的通讯，监视&lt;br /&gt;
主机状态。&lt;br /&gt;
主程序和代理程序之间有两种工作方式，一种是主程序&amp;#8211;&amp;gt;Active&amp;#8211;&amp;gt;代理程序；另一种是&lt;br /&gt;
主程序&amp;#8211;&amp;gt;passive&amp;#8211;&amp;gt;代理程序；顾名思义，是以一方向另一方主动提出通讯需求来划分的。&lt;span class=&quot;f14&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;的安装：&lt;br /&gt;
&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;服务器上需要安装以下包，&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;主程序，&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;的plugin程序，check_nrpe程序，imagepak包；&lt;br /&gt;
1、&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;安装&lt;br /&gt;
tar –xvzf &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-2.0.tar.gz&lt;br /&gt;
mkdir /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;&lt;br /&gt;
pw useradd &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt; –d /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;&lt;br /&gt;
pw addgroup root&lt;br /&gt;
chmod 755 /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;&lt;br /&gt;
cd &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-2.0&lt;br /&gt;
./configure &amp;#8211;prefix=/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt; &amp;#8211;with-gd-lib=/usr/local/lib &amp;#8211;with-gd-inc=/usr/local/include&lt;br /&gt;
make all&lt;br /&gt;
make install&lt;br /&gt;
make install-init          ##This installs the init script in /usr/local/etc/rc.d&lt;br /&gt;
make install-commandmode&lt;br /&gt;
make install-config        ##将初始的配置文件安装到/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/etc&lt;br /&gt;
注:在makeinstall-init这一步的时候可能会进行不下去，这时只要加个root组即可。&lt;br /&gt;
pw addgroup root&lt;br /&gt;
2、&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-plugins的安装&lt;br /&gt;
tar –xvzf &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-plugins-1.4.tar&lt;br /&gt;
mkdir /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-plugins&lt;br /&gt;
cd &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-plugins-1.4&lt;br /&gt;
./configure &amp;#8211;prefix=/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-plugins&lt;br /&gt;
make all&lt;br /&gt;
make install&lt;br /&gt;
mv /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-plugins/libexec /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;&lt;br /&gt;
3、imagepak-base的安装&lt;br /&gt;
tar –xvzf imagepak-base.tar.gz&lt;br /&gt;
解压以后是base目录&lt;br /&gt;
cp –R base /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/share/images/logos&lt;br /&gt;
4. &lt;a href=&quot;http://www.8next.com/archives/tag/nrpe&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nrpe&quot;&gt;nrpe&lt;/a&gt;的安装&lt;br /&gt;
安装&lt;a href=&quot;http://www.8next.com/archives/tag/nrpe&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nrpe&quot;&gt;nrpe&lt;/a&gt;(主要是使用check_nrpe模块)&lt;br /&gt;
#./configure &amp;#8211;enable-ssl  &amp;#8211;enable-command-args&lt;br /&gt;
#make all&lt;br /&gt;
#cp src/check_nrpe /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/libexec&lt;br /&gt;
vi checkcommands.cfg&lt;br /&gt;
定义check_nrpe命令&lt;br /&gt;
# &amp;#8216;check_nrep&amp;#8217; command definition&lt;br /&gt;
define command{&lt;br /&gt;
command_name check_nrpe&lt;br /&gt;
command_line /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$&lt;br /&gt;
}&lt;br /&gt;
restart &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;。&lt;/p&gt;
&lt;p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;f14&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;被监控主机需要安装&lt;a href=&quot;http://www.8next.com/archives/tag/nrpe&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nrpe&quot;&gt;nrpe&lt;/a&gt;和ncsa代理程序以及plugin程序。&lt;br /&gt;
1、安装&lt;a href=&quot;http://www.8next.com/archives/tag/nrpe&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nrpe&quot;&gt;nrpe&lt;/a&gt;与配置&lt;br /&gt;
#./configure &amp;#8211;enable-ssl  &amp;#8211;enable-command-args&lt;br /&gt;
#make all&lt;br /&gt;
#mkdir -p /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/etc&lt;br /&gt;
#mkdir /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/bin&lt;br /&gt;
#mkdir /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/libexec&lt;br /&gt;
#pw addgroup &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;&lt;br /&gt;
#pw useradd &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt; -g &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt; -d /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/ -s /sbin/nologin&lt;br /&gt;
#chown -R &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;:&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt; /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;&lt;br /&gt;
#cp &lt;a href=&quot;http://www.8next.com/archives/tag/nrpe&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nrpe&quot;&gt;nrpe&lt;/a&gt;.cfg /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/etc&lt;br /&gt;
#cp src/&lt;a href=&quot;http://www.8next.com/archives/tag/nrpe&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nrpe&quot;&gt;nrpe&lt;/a&gt; /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/bin&lt;br /&gt;
2、启动&lt;a href=&quot;http://www.8next.com/archives/tag/nrpe&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nrpe&quot;&gt;nrpe&lt;/a&gt;，端口为5666&lt;br /&gt;
/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/bin/&lt;a href=&quot;http://www.8next.com/archives/tag/nrpe&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nrpe&quot;&gt;nrpe&lt;/a&gt; -c -n /etc/&lt;a href=&quot;http://www.8next.com/archives/tag/nrpe&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nrpe&quot;&gt;nrpe&lt;/a&gt;.cfg -d&lt;br /&gt;
3、安装监测的模块&lt;br /&gt;
&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-plugins的安装&lt;br /&gt;
tar –xvzf &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-plugins-1.4.tar&lt;br /&gt;
cd &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-plugins-1.4&lt;br /&gt;
./configure &amp;#8211;prefix=/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;&lt;br /&gt;
make all&lt;br /&gt;
make install &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;f14&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;的配置：&lt;br /&gt;
一、配置&lt;a href=&quot;http://www.8next.com/archives/tag/apache&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with apache&quot;&gt;apache&lt;/a&gt;&lt;br /&gt;
在&lt;a href=&quot;http://www.8next.com/archives/tag/apache&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with apache&quot;&gt;apache&lt;/a&gt;的配置文件httpd.conf中追加&lt;br /&gt;
ScriptAlias /&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/cgi-bin/ /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/sbin/&lt;br /&gt;
&amp;lt;Directory &amp;#8220;/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/sbin/&amp;#8221;&amp;gt;&lt;br /&gt;
AllowOverride AuthConfig&lt;br /&gt;
Options ExecCGI&lt;br /&gt;
Order allow,deny&lt;br /&gt;
Allow from all&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
Alias /&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/ /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/share/&lt;br /&gt;
&amp;lt;Directory &amp;#8220;/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/share&amp;#8221;&amp;gt;&lt;br /&gt;
Options None&lt;br /&gt;
AllowOverride AuthConfig&lt;br /&gt;
Order allow,deny&lt;br /&gt;
Allow from all&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
二、设置访问权限 1、在/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/share目录下&lt;br /&gt;
vi .htaccess&lt;br /&gt;
AuthName &amp;#8220;&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;Nagios&lt;/a&gt; Access&amp;#8221;&lt;br /&gt;
AuthType Basic&lt;br /&gt;
AuthUserFile /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/etc/.htpasswd&lt;br /&gt;
require valid-user&lt;br /&gt;
2、在/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/sbin目录下&lt;br /&gt;
vi .htpasswd&lt;br /&gt;
AuthName &amp;#8220;&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;Nagios&lt;/a&gt; Access&amp;#8221;&lt;br /&gt;
AuthType Basic&lt;br /&gt;
AuthUserFile /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/etc/.htpasswd&lt;br /&gt;
require valid-user&lt;br /&gt;
3、/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/apache&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with apache&quot;&gt;apache&lt;/a&gt;/bin/htpasswd –c /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/etc/.htpasswd &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;&lt;br /&gt;
这个&lt;a href=&quot;http://www.8next.com/archives/tag/apache&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with apache&quot;&gt;apache&lt;/a&gt;目录根据安装目录的不同而不同,主要所以用.htpasswd这个命令生成用户名和密码&lt;br /&gt;
三、配置&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt; 1、在/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/etc下是&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;的配置模板文件.cfg-sample,把.cfg-sample文件全部拷贝成.cfg&lt;br /&gt;
例如:cp &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;.cfg-sample &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;.cfg&lt;br /&gt;
全部拷贝完成即可.&lt;br /&gt;
2、vi dependencies.cfg (在2.0没有生成这个文件，自己创建)&lt;br /&gt;
然后保存即可.(在1.2用一个空的文件代替原来的dependencies.cfg文件,否则会出错)&lt;br /&gt;
3、修改minimal.cfg，把里面所有定义command的全部注释掉&lt;br /&gt;
vi /etc/minimal.cfg&lt;br /&gt;
修改cgi.cfg&lt;br /&gt;
修改use_authentication=1为use_authentication=0,即不用验证.不然有一些页面不会显示。&lt;br /&gt;
4、然后检查配置文件是否出错&lt;br /&gt;
/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/bin/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt; –v /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/etc/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;.cfg&lt;br /&gt;
出现Total Warnings: 0&lt;br /&gt;
Total Errors:   0&lt;br /&gt;
为正常&lt;br /&gt;
出错的话,就是.cfg文件有问题&lt;br /&gt;
5、启动后台进程&lt;br /&gt;
/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/bin/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt; -d /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/etc/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;.cfg&lt;br /&gt;
/usr/local/etc/rc.d/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt; start&lt;br /&gt;
6、&lt;a href=&quot;http://yourip/nagios/index.html&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;http://yourip/nagios/index.html&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(如果有些页面看不到的话.可以在cgi.cfg文件中&lt;br /&gt;
把带有authorized的选项前的#号去掉即可)&lt;br /&gt;
这些配置完以后，基本的&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;配置完成。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;f14&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;经验：&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;功能非常强大，但是配置也特别复杂。在部署&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;应用之前，一定要事先规划好；&lt;br /&gt;
哪些主机需要监视，都需要监视哪些服务，在监视中都采取哪些动作；而且要把他们条理&lt;br /&gt;
清楚的体现在cfg文件中，这样便于问题查找和扩充。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;f14&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;举几个cfg文件的例子。&lt;br /&gt;
hosts.cfg hostgroup.cfg service.cfg这三个配置文件对于简单的配置很重要，至于其他的配置文件，就要根据具体的应用来配置了。&lt;br /&gt;
Hosts.cfg&lt;br /&gt;
# &amp;#8216;novell1&amp;#8242; host definition&lt;br /&gt;
define host{&lt;br /&gt;
use generic-host ; Name of host template to use&lt;br /&gt;
host_name 你想管理的机器名&lt;br /&gt;
alias 自己定义的别名&lt;br /&gt;
address 你想管理的机器的IP&lt;br /&gt;
check_command check-host-alive&lt;br /&gt;
max_check_attempts 10&lt;br /&gt;
notification_interval 120&lt;br /&gt;
notification_period 24&amp;#215;7&lt;br /&gt;
notification_options d,u,r&lt;br /&gt;
}&lt;br /&gt;
Hostgroup.cfg&lt;br /&gt;
# &amp;#8216;novell-servers&amp;#8217; host group definition&lt;br /&gt;
define hostgroup{&lt;br /&gt;
hostgroup_name novell-servers&lt;br /&gt;
alias Novell Servers&lt;br /&gt;
contact_groups novell-admins&lt;br /&gt;
members 你想管理的机器名（可以用多个，中间用逗号分隔）&lt;br /&gt;
}&lt;br /&gt;
services.cfg&lt;br /&gt;
# Service definition&lt;br /&gt;
define service{&lt;br /&gt;
use generic-service ; Name of service template to use&lt;br /&gt;
host_name 你的机器名字&lt;br /&gt;
service_description SMTP&lt;br /&gt;
is_volatile 0&lt;br /&gt;
check_period 24&amp;#215;7&lt;br /&gt;
max_check_attempts 3&lt;br /&gt;
normal_check_interval 3&lt;br /&gt;
retry_check_interval 1&lt;br /&gt;
contact_groups novell-admins&lt;br /&gt;
notification_interval 120&lt;br /&gt;
notification_period 24&amp;#215;7&lt;br /&gt;
notification_options w,u,c,r&lt;br /&gt;
check_command check_smtp&lt;br /&gt;
}&lt;br /&gt;
contacts.cfg misccommands.cfg dependencies.cfg&lt;br /&gt;
&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;.cfg dependencies.cfg.bak resource.cfg&lt;br /&gt;
cgi.cfg escalations.cfg checkcommands.cfg&lt;br /&gt;
hostgroups.cfg services.cfg contactgroups.cfg&lt;br /&gt;
hosts.cfg timeperiods.cfg &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;f14&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;以 上三个配置文件对于想管理的机器，需要去配置，不过对于你的机器加入在不同的组里面所监视的服务是不同的，不同工作组的计算机在&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;的管理软件界 面中的服务是不一样的，如果想要更多的监视一台服务器，那么就需要配置services.cfg文件，灵活的更改services.cfg文件对于使用好 &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;非常的重要。 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

	Tags: &lt;a href=&quot;http://www.8next.com/archives/tag/images-logos&quot; title=&quot;images logos&quot; rel=&quot;tag&quot;&gt;images logos&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; title=&quot;nagios&quot; rel=&quot;tag&quot;&gt;nagios&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/nagios-plugins&quot; title=&quot;nagios plugins&quot; rel=&quot;tag&quot;&gt;nagios plugins&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/nrpe&quot; title=&quot;nrpe&quot; rel=&quot;tag&quot;&gt;nrpe&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/%e4%b8%bb%e7%a8%8b%e5%ba%8f&quot; title=&quot;主程序&quot; rel=&quot;tag&quot;&gt;主程序&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/%e9%85%8d%e7%bd%ae&quot; title=&quot;配置&quot; rel=&quot;tag&quot;&gt;配置&lt;/a&gt;&lt;br /&gt;

	&lt;h4&gt;Related posts&lt;/h4&gt;
	&lt;ul class=&quot;st-related-posts&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.8next.com/archives/2778&quot; title=&quot;nagios的安装和配置 (September 17, 2008)&quot;&gt;nagios的安装和配置&lt;/a&gt; (0)&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.8next.com/archives/1972&quot; title=&quot;在你的iPhone/iPod Touch上安装并配置Lighttpd+php (August 15, 2008)&quot;&gt;在你的iPhone/iPod Touch上安装并配置Lighttpd+php&lt;/a&gt; (0)&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.8next.com/archives/2163&quot; title=&quot;lighttpd+PHP(FAST-CGI)+MySQL配置方案 (August 21, 2008)&quot;&gt;lighttpd+PHP(FAST-CGI)+MySQL配置方案&lt;/a&gt; (1)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=2fee03f00132bed209fc2452a632c12e&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=2fee03f00132bed209fc2452a632c12e&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=8d5e8c6bfb25e29c256ea36f72ffbde8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=8d5e8c6bfb25e29c256ea36f72ffbde8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=9551537e4ea2215e8eaf9fae98839739&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=9551537e4ea2215e8eaf9fae98839739&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=2e2f86be36c4517af8b2e2e9e55cbe58&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=2e2f86be36c4517af8b2e2e9e55cbe58&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=2e47e9762f283337e42f5ca6921c901b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=2e47e9762f283337e42f5ca6921c901b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=a147fd870316656efae46b517a57640f&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=a147fd870316656efae46b517a57640f&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=73e58989466786fc92b8f8b457bbed7b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=73e58989466786fc92b8f8b457bbed7b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=2484cc9811da38c9799d3c09fa8c8e24&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=2484cc9811da38c9799d3c09fa8c8e24&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://www.8next.com/archives/2777/feed</wfw:commentRss><description>什么是nagios？
nagios是一款网络管理软件，开源的软件。能够对网络内的主机和硬件设备进行状态监控。 


nagios的优势：
免费；开源；高扩展性。


nagios能实现的功能：
1. 状态监控
2. ...&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=2fee03f00132bed209fc2452a632c12e&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=2fee03f00132bed209fc2452a632c12e&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=8d5e8c6bfb25e29c256ea36f72ffbde8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=8d5e8c6bfb25e29c256ea36f72ffbde8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=9551537e4ea2215e8eaf9fae98839739&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=9551537e4ea2215e8eaf9fae98839739&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=2e2f86be36c4517af8b2e2e9e55cbe58&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=2e2f86be36c4517af8b2e2e9e55cbe58&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=2e47e9762f283337e42f5ca6921c901b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=2e47e9762f283337e42f5ca6921c901b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=a147fd870316656efae46b517a57640f&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=a147fd870316656efae46b517a57640f&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=73e58989466786fc92b8f8b457bbed7b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=73e58989466786fc92b8f8b457bbed7b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=2484cc9811da38c9799d3c09fa8c8e24&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=2484cc9811da38c9799d3c09fa8c8e24&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>Unix Like</category><category>images logos</category><category>nagios</category><category>nrpe</category><category>配置</category><category>nagios plugins</category><category>主程序</category><pubDate>Thu, 02 Oct 2008 16:51:54 +0800</pubDate><author>neemem</author><comments>http://www.8next.com/archives/2777#comments</comments><guid isPermaLink="false">http://www.8next.com/?p=2777</guid><dc:creator>neemem</dc:creator><fs:srclink>http://www.8next.com/archives/2777</fs:srclink><fs:srcfeed>http://www.8next.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/neemem/~7060273/121736001/5136544</fs:itemid></item><item><title>Apache vs Nginx : Web Server Performance Deathmatch</title><link>http://item.feedsky.com/~feedsky/neemem/~7060273/121736002/5136544/1/item.html</link><content:encoded>&lt;div class=&quot;entry&quot;&gt;
&lt;p&gt;Deathmatch may be an &lt;a href=&quot;http://www.8next.com/archives/tag/overstatement&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with overstatement&quot;&gt;overstatement&lt;/a&gt; but here are the results from some &lt;a href=&quot;http://www.8next.com/archives/tag/performance&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with performance&quot;&gt;performance&lt;/a&gt; benchmarking.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Setup:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Server:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;CENTOS 5.1&lt;/li&gt;
&lt;li&gt;Dual 2.4GHz Xeon CPUs&lt;/li&gt;
&lt;li&gt;4GB RAM&lt;/li&gt;
&lt;li&gt;RAID5 (4 x 15k disks)&lt;/li&gt;
&lt;li&gt;Server and test client were connected via a consumer grade 10/100 switch&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Configurations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Basic static vhost&lt;/li&gt;
&lt;li&gt;Keepalive turned on and with timeout of 15 seconds&lt;/li&gt;
&lt;li&gt;GZIP turned on&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I used &lt;a onclick=&quot;urchinTracker('/outbound/www.xenoclast.org');&quot; href=&quot;http://www.xenoclast.org/autobench/&quot;&gt;autobench&lt;/a&gt; to perform the tests. Basically this is a perl script that sits on top of &lt;a onclick=&quot;urchinTracker('/outbound/www.hpl.hp.com');&quot; href=&quot;http://www.hpl.hp.com/research/linux/httperf/&quot;&gt;httperf&lt;/a&gt; and will run multiple tests in succession outputing the results to CSV. Awfully convenient.&lt;/p&gt;
&lt;p&gt;All the tests were run against the same robots.txt file. Autobench ran the following command 20 times incrementing the request rate by 10 each time. I started at 10 requests per second and went up to 200.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;httperf –timeout=5 –client=0/1 –server=HOST –port=80 –uri=/robots.txt –rate=X –send-buffer=4096 –recv-buffer=16384 –num-conns=5000 –num-calls=10&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I performed two samples and arbitrarily used the second as the results shown here. At the bottom of this post I will have spreadsheet containing the data from these tests so you can check &lt;a href=&quot;http://www.8next.com/archives/tag/out&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with out&quot;&gt;out&lt;/a&gt; all the results.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Results:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Both &lt;a href=&quot;http://www.8next.com/archives/tag/web&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with Web&quot;&gt;web&lt;/a&gt; servers performed well in all the tests and had no issues completing the requests. So I will not mention the metrics that they finished very closely on, only the ones that they did not have similar results.&lt;/p&gt;
&lt;p&gt;There were three httperf related tests that &lt;a href=&quot;http://www.8next.com/archives/tag/nginx&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nginx&quot;&gt;Nginx&lt;/a&gt; and &lt;a href=&quot;http://www.8next.com/archives/tag/apache&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with apache&quot;&gt;Apache&lt;/a&gt; differed on more than small amount, reply rate, network I/O and response time.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2235/2298818585_3baeeeb8a7.jpg?v=0&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;293&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This one really piqued my interest. It seems strange to me why we would see such a result from &lt;a href=&quot;http://www.8next.com/archives/tag/apache&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with apache&quot;&gt;Apache&lt;/a&gt;. In both tests there was a big difference at the 700 request mark. Statistically the difference was only on the max reply rate. The average and minimum are within a few tenths of a percent consistent through the tests. The max for &lt;a href=&quot;http://www.8next.com/archives/tag/apache&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with apache&quot;&gt;Apache&lt;/a&gt; in the first test was 734.7 and in the second 758.7, &lt;a href=&quot;http://www.8next.com/archives/tag/standard-deviations&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with standard deviations&quot;&gt;standard deviations&lt;/a&gt; of 13.9 and 22.9 respectively. I suppose the real question here is whether or not this is my test or how &lt;a href=&quot;http://www.8next.com/archives/tag/apache&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with apache&quot;&gt;Apache&lt;/a&gt; acts. If it is the later it seems strange that dealing with 700 requests would be any different than dealing with 800. From 800 requests to 2000, the larger differences in these results seems more realistic, controlled and gradual.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2207/2298695415_878064086a.jpg?v=0&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;305&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The network I/O graph I find interesting mostly because I don’t know how to take it. On one hand it seems &lt;a href=&quot;http://www.8next.com/archives/tag/apache&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with apache&quot;&gt;Apache&lt;/a&gt; is simply using more bandwidth to do the same number of requests as &lt;a href=&quot;http://www.8next.com/archives/tag/nginx&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nginx&quot;&gt;Nginx&lt;/a&gt;. Which would seem bad. On the other it could just mean that &lt;a href=&quot;http://www.8next.com/archives/tag/apache&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with apache&quot;&gt;Apache&lt;/a&gt; does a better job of consuming and using the available pipe. Which would seem good. My hunch is that it is the former.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3241/2298693485_df1606c495.jpg?v=0&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;331&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The response times are also interesting since &lt;a href=&quot;http://www.8next.com/archives/tag/nginx&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nginx&quot;&gt;Nginx&lt;/a&gt; responds consistently at 0.4 ms. I am not sure why this is since I don’t know the internals to &lt;a href=&quot;http://www.8next.com/archives/tag/nginx&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nginx&quot;&gt;Nginx&lt;/a&gt; but I imagine that it is something that is built into how it deals with requests.&lt;/p&gt;
&lt;p&gt;While the httperf tests were running I collected sar data from that time. The results show that &lt;a href=&quot;http://www.8next.com/archives/tag/nginx&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nginx&quot;&gt;Nginx&lt;/a&gt; uses a good amount less CPU and produces equally less load.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.8next.com/archives/tag/apache&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with apache&quot;&gt;Apache&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;CPU:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3106/2298664881_4a3d493ec9.jpg?v=0&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;214&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Load:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2306/2298664819_bfe6cc2483.jpg?v=0&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;143&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.8next.com/archives/tag/nginx&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nginx&quot;&gt;Nginx&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;CPU:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3069/2298664689_2312632a86.jpg?v=0&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;214&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Load:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3229/2299462026_eb9032c6a1.jpg?v=0&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;143&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Thats all I got, pretty cool. &lt;a href=&quot;http://www.8next.com/archives/tag/nginx&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nginx&quot;&gt;Nginx&lt;/a&gt; seems to compete pretty well with &lt;a href=&quot;http://www.8next.com/archives/tag/apache&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with apache&quot;&gt;Apache&lt;/a&gt; and there doesn’t seem like there is a good reason not to use it especially in CPU usage constrained situations (ie huge traffic, slow machines and etc).&lt;/p&gt;
&lt;p&gt;Here’s my results &lt;a href=&quot;http://www.joeandmotorboat.com/wp-content/files/bench_results-comb-static.ods&quot;&gt;spreadsheet&lt;/a&gt; for the detailed results of each httperf metric.&lt;/div&gt;

	Tags: &lt;a href=&quot;http://www.8next.com/archives/tag/apache&quot; title=&quot;apache&quot; rel=&quot;tag&quot;&gt;apache&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/nginx&quot; title=&quot;nginx&quot; rel=&quot;tag&quot;&gt;nginx&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/overstatement&quot; title=&quot;overstatement&quot; rel=&quot;tag&quot;&gt;overstatement&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/performance&quot; title=&quot;performance&quot; rel=&quot;tag&quot;&gt;performance&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/performance-benchmarking&quot; title=&quot;performance benchmarking&quot; rel=&quot;tag&quot;&gt;performance benchmarking&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/setup-server&quot; title=&quot;setup server&quot; rel=&quot;tag&quot;&gt;setup server&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/standard-deviations&quot; title=&quot;standard deviations&quot; rel=&quot;tag&quot;&gt;standard deviations&lt;/a&gt;&lt;br /&gt;

	&lt;h4&gt;Related posts&lt;/h4&gt;
	&lt;ul class=&quot;st-related-posts&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.8next.com/archives/2111&quot; title=&quot;nginx+apache+mysql+php+memcached+squid搭建门户网站 (August 19, 2008)&quot;&gt;nginx+apache+mysql+php+memcached+squid搭建门户网站&lt;/a&gt; (0)&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.8next.com/archives/1906&quot; title=&quot;浅析Apache中SSI和CGI的设定方法 (August 13, 2008)&quot;&gt;浅析Apache中SSI和CGI的设定方法&lt;/a&gt; (0)&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.8next.com/archives/93&quot; title=&quot;安装nginx作为web服务器及反向代理 (June 20, 2008)&quot;&gt;安装nginx作为web服务器及反向代理&lt;/a&gt; (0)&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.8next.com/archives/44&quot; title=&quot;关于编译支持mysqli的php6和mysql6 (June 9, 2008)&quot;&gt;关于编译支持mysqli的php6和mysql6&lt;/a&gt; (0)&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.8next.com/archives/1891&quot; title=&quot;Ubuntu 8.04快速搭建nginx+php(fastcgi)系统 (August 12, 2008)&quot;&gt;Ubuntu 8.04快速搭建nginx+php(fastcgi)系统&lt;/a&gt; (0)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=14eb64c0eff6bdedca73f76f148c66f6&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=14eb64c0eff6bdedca73f76f148c66f6&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=530e805e4d3e20ee8ee59e66e36a07e8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=530e805e4d3e20ee8ee59e66e36a07e8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=d54796f4ffbc42848cc817ada1e6dd7b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=d54796f4ffbc42848cc817ada1e6dd7b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=089999e4c82e05e588cab5c9a5cb5600&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=089999e4c82e05e588cab5c9a5cb5600&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=fd42b7e0f9fb5416880e7e0c85a34903&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=fd42b7e0f9fb5416880e7e0c85a34903&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=d351d3aa05312f3cc9f51973082cd6aa&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=d351d3aa05312f3cc9f51973082cd6aa&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=0b96cdea10f0f6320ecb25d5b11548ff&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=0b96cdea10f0f6320ecb25d5b11548ff&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=1ea8fb573dc6c3a4643a4f8c66fac777&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=1ea8fb573dc6c3a4643a4f8c66fac777&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://www.8next.com/archives/2782/feed</wfw:commentRss><description>Deathmatch may be an overstatement but here are the results from some performance benchmarking.

The Setup:

Server:

	CENTOS 5.1
	Dual 2.4GHz Xeon CPUs
	4GB RAM
	RAID5 (4 x 15k disks)
	Server and t.....&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=14eb64c0eff6bdedca73f76f148c66f6&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=14eb64c0eff6bdedca73f76f148c66f6&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=530e805e4d3e20ee8ee59e66e36a07e8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=530e805e4d3e20ee8ee59e66e36a07e8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=d54796f4ffbc42848cc817ada1e6dd7b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=d54796f4ffbc42848cc817ada1e6dd7b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=089999e4c82e05e588cab5c9a5cb5600&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=089999e4c82e05e588cab5c9a5cb5600&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=fd42b7e0f9fb5416880e7e0c85a34903&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=fd42b7e0f9fb5416880e7e0c85a34903&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=d351d3aa05312f3cc9f51973082cd6aa&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=d351d3aa05312f3cc9f51973082cd6aa&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=0b96cdea10f0f6320ecb25d5b11548ff&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=0b96cdea10f0f6320ecb25d5b11548ff&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=1ea8fb573dc6c3a4643a4f8c66fac777&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=1ea8fb573dc6c3a4643a4f8c66fac777&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>standard deviations</category><category>overstatement</category><category>Uncategorized</category><category>Unix Like</category><category>PHP</category><category>setup server</category><category>nginx</category><category>performance</category><category>apache</category><category>performance benchmarking</category><pubDate>Thu, 02 Oct 2008 16:51:20 +0800</pubDate><author>neemem</author><comments>http://www.8next.com/archives/2782#comments</comments><guid isPermaLink="false">http://www.8next.com/?p=2782</guid><dc:creator>neemem</dc:creator><fs:srclink>http://www.8next.com/archives/2782</fs:srclink><fs:srcfeed>http://www.8next.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/neemem/~7060273/121736002/5136544</fs:itemid></item><item><title>lost iphone…..buy a windows mobile phone</title><link>http://item.feedsky.com/~feedsky/neemem/~7060273/121736003/5136544/1/item.html</link><content:encoded>&lt;p&gt;buy &lt;a href=&quot;http://www.8next.com/archives/tag/wm&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with wm&quot;&gt;wm&lt;/a&gt;-htc touch diamond&amp;#8230;&amp;#8230;expensive&lt;/p&gt;
No tags for this post.
	&lt;h4&gt;Related posts&lt;/h4&gt;
	&lt;ul class=&quot;st-related-posts&quot;&gt;
	&lt;li&gt;No related posts.&lt;/li&gt;
	&lt;/ul&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=5c1ff3db6911887a409605e863397d4e&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=5c1ff3db6911887a409605e863397d4e&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=441cf3e8334d6f1edc42e431fdc890f1&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=441cf3e8334d6f1edc42e431fdc890f1&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=7d17013bde783679d1021c2c16547ef2&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=7d17013bde783679d1021c2c16547ef2&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=215eb28b2b6b630c3e8752c5f211662c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=215eb28b2b6b630c3e8752c5f211662c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=67b52d9cd9e33abec871927f95cff797&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=67b52d9cd9e33abec871927f95cff797&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=afbb44c3a53a6ffdb13f128635106711&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=afbb44c3a53a6ffdb13f128635106711&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=59b7b788c6f4c83c09fda857c0c8caf6&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=59b7b788c6f4c83c09fda857c0c8caf6&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=a643fb722cb52b4aae16e8c9be395e8a&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=a643fb722cb52b4aae16e8c9be395e8a&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://www.8next.com/archives/2879/feed</wfw:commentRss><description>buy wm-htc touch diamond......expensiv...&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=5c1ff3db6911887a409605e863397d4e&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=5c1ff3db6911887a409605e863397d4e&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=441cf3e8334d6f1edc42e431fdc890f1&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=441cf3e8334d6f1edc42e431fdc890f1&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=7d17013bde783679d1021c2c16547ef2&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=7d17013bde783679d1021c2c16547ef2&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=215eb28b2b6b630c3e8752c5f211662c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=215eb28b2b6b630c3e8752c5f211662c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=67b52d9cd9e33abec871927f95cff797&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=67b52d9cd9e33abec871927f95cff797&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=afbb44c3a53a6ffdb13f128635106711&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=afbb44c3a53a6ffdb13f128635106711&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=59b7b788c6f4c83c09fda857c0c8caf6&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=59b7b788c6f4c83c09fda857c0c8caf6&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=a643fb722cb52b4aae16e8c9be395e8a&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=a643fb722cb52b4aae16e8c9be395e8a&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>Other</category><pubDate>Thu, 02 Oct 2008 16:50:39 +0800</pubDate><author>neemem</author><comments>http://www.8next.com/archives/2879#comments</comments><guid isPermaLink="false">http://www.8next.com/?p=2879</guid><dc:creator>neemem</dc:creator><fs:srclink>http://www.8next.com/archives/2879</fs:srclink><fs:srcfeed>http://www.8next.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/neemem/~7060273/121736003/5136544</fs:itemid></item><item><title>php 取得某个自然周的第一天和最后一天的方法</title><link>http://item.feedsky.com/~feedsky/neemem/~7060273/121736004/5136544/1/item.html</link><content:encoded>&lt;div class=&quot;post-content&quot;&gt;
&lt;p&gt;&lt;span style=&quot;color: #000080;&quot;&gt;今天在写统计每周发帖情况的代码时，突然发觉在&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;语言里提供了那么多日期函数，但是真正要获得某个日期所在周的第一天和最后一天，还有点麻烦呢，上网搜索了一下，解决方案还真不多，不管怎么样，还是找了一个，稍微改装了一下，代码如下：&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #000080;&quot;&gt;function&lt;strong&gt; getFirstDateOfWeek&lt;/strong&gt;($dateStr){&lt;br /&gt;
$w = strftime(”%u”,strtotime($dateStr));&lt;br /&gt;
$sdate = strftime(”%Y-%m-%d”,strtotime($dateStr) - ($w-1)*86400) . ” 00:00:00″;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #000080;&quot;&gt;return $sdate;&lt;br /&gt;
}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #000080;&quot;&gt;function &lt;strong&gt;getLastDateOfWeek&lt;/strong&gt;($dateStr){&lt;br /&gt;
$w= strftime(”%u”,strtotime($dateStr));&lt;br /&gt;
$edate = strftime(”%Y-%m-%d”,strtotime($date_time) + (7-$w)*86400) . ” 23:59:59″;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #000080;&quot;&gt;return $edate;&lt;br /&gt;
}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #000080;&quot;&gt;提供2个函数，通过传入指定日期，获取指定日期所在自然周的第一天和最后一天。&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #000080;&quot;&gt;&lt;strong&gt;strftime&lt;/strong&gt;函数对timestamp进行格式输出， 其中%u - 星期几的十进制数表达 [1,7]，1 表示星期一，先通过strftime取得传入的指定日期在自然周中是第几天，然后再加上或减去一周中剩余的天数的总秒数即可。&lt;/span&gt;&lt;/div&gt;
No tags for this post.
	&lt;h4&gt;Related posts&lt;/h4&gt;
	&lt;ul class=&quot;st-related-posts&quot;&gt;
	&lt;li&gt;No related posts.&lt;/li&gt;
	&lt;/ul&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=a6cd232e1ae92487f4002905aa7eff86&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=a6cd232e1ae92487f4002905aa7eff86&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=f76fd18b684791383b453f94d47f77e6&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=f76fd18b684791383b453f94d47f77e6&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=ecd23e8af096c3527894c4d7758b03c6&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=ecd23e8af096c3527894c4d7758b03c6&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=d97e91cfa73a47ca34e0151f09838023&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=d97e91cfa73a47ca34e0151f09838023&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=83292fb031695f6ace822de100df4070&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=83292fb031695f6ace822de100df4070&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=61323338acc3a7b8db35e98995912f7b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=61323338acc3a7b8db35e98995912f7b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=f2caf2b70224bad04a2aeee48c4bd27c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=f2caf2b70224bad04a2aeee48c4bd27c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=7e252ad909f078206cef7346f1365c73&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=7e252ad909f078206cef7346f1365c73&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://www.8next.com/archives/2781/feed</wfw:commentRss><description>今天在写统计每周发帖情况的代码时，突然发觉在php语言里提供了那么多日期函数，但是真正要获得某个日期所在周的第一天和最后一天，还有点麻烦呢，上网搜索了一下，解决方案还真不...&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=a6cd232e1ae92487f4002905aa7eff86&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=a6cd232e1ae92487f4002905aa7eff86&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=f76fd18b684791383b453f94d47f77e6&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=f76fd18b684791383b453f94d47f77e6&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=ecd23e8af096c3527894c4d7758b03c6&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=ecd23e8af096c3527894c4d7758b03c6&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=d97e91cfa73a47ca34e0151f09838023&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=d97e91cfa73a47ca34e0151f09838023&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=83292fb031695f6ace822de100df4070&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=83292fb031695f6ace822de100df4070&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=61323338acc3a7b8db35e98995912f7b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=61323338acc3a7b8db35e98995912f7b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=f2caf2b70224bad04a2aeee48c4bd27c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=f2caf2b70224bad04a2aeee48c4bd27c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=7e252ad909f078206cef7346f1365c73&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=7e252ad909f078206cef7346f1365c73&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>PHP</category><pubDate>Fri, 26 Sep 2008 21:25:45 +0800</pubDate><author>neemem</author><comments>http://www.8next.com/archives/2781#comments</comments><guid isPermaLink="false">http://www.8next.com/?p=2781</guid><dc:creator>neemem</dc:creator><fs:srclink>http://www.8next.com/archives/2781</fs:srclink><fs:srcfeed>http://www.8next.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/neemem/~7060273/121736004/5136544</fs:itemid></item><item><title>Building an eZ publish module</title><link>http://item.feedsky.com/~feedsky/neemem/~7060273/121736005/5136544/1/item.html</link><content:encoded>&lt;div class=&quot;attribute-long&quot;&gt;
&lt;p&gt;The purpose of this rather short tutorial is to show users of eZ publish 3 willing to write some additional functions by exploiting the extensions functionality.&lt;/p&gt;
&lt;p&gt;In the following article where ever we will mention an absolute path it will mean the path from the eZ publish root. We also suppose, that URL for our eZ publish site is &lt;a href=&quot;http://www.example.com/path/index.php/mysite/&quot;&gt;http://www.example.com/path/index.php/mysite/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We will develop a simple &lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt; for accessing EUR exchange rates. Of course, we need some source of exchange rates in an usable format. In our tutorial, we will use a service provided by European Central Bank. You can have a look at &lt;a href=&quot;http://ez.no/tw&quot;&gt;http://www.ecb.int/stats/eurofxref/eurofxref-xml.html&lt;/a&gt; to see actual exchange rates as HTML page. (This information is updated every working day at 2.15pm CE(S)T.) We are lucky because the bank provides this information also in the XML format at &lt;a href=&quot;http://ez.no/tw&quot;&gt;http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s have a brief look at this file:&lt;/p&gt;
&lt;pre class=&quot;wordwrap&quot;&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;gesmes:Envelope xmlns:gesmes=&quot;http://www.gesmes.org/xml/2002-08-01&quot;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;xmlns=&quot;http://www.ecb.int/vocabulary/2002-08-01/eurofxref&quot;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;gesmes:subject&amp;gt;Reference rates&amp;lt;/gesmes:subject&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;gesmes:Sender&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;gesmes:name&amp;gt;European Central Bank&amp;lt;/gesmes:name&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;/gesmes:Sender&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;Cube&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;Cube time='2004-04-15'&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;Cube currency='USD' rate='1.1912'/&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;Cube currency='JPY' rate='129.39'/&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;Cube currency='DKK' rate='7.4443'/&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;Cube currency='ZAR' rate='7.8591'/&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;/Cube&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;/Cube&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;/gesmes:Envelope&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Perfect! We see that the most important information is stored in attributes of Cube tags: if the tag has the attribute named time, its value is the date, if it has the attribute named currency, its value is the currency symbol and the value of the attribute rate is the actual exchange rate. The format of the rate is suitable for us, so we do not need to do any post-processing.&lt;/p&gt;
&lt;p&gt;In this tutorial we develop an &lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt; named eurofxref which will contain one &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt; with the same name. We want to have the possibility of including exchange rates to our &lt;a href=&quot;http://www.8next.com/archives/tag/templates&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with templates&quot;&gt;templates&lt;/a&gt; and also we prepare an overview page like http://www.example.com/path/index.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;/mysite/eurofxref/overview to see the entire table of exchange rates.&lt;/p&gt;
&lt;p&gt;First, create the directory eurofxref under the /&lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt; directory located in the root directory of eZ publish. If the /&lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt; directory does not exist, then you have to create it. You must tell eZ publish that this &lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt; exists by adding ActiveExtensions[]=eurofxref in the [ExtensionSettings] section of site.ini files. Preferably, you should do this by adding the following lines in /settings/override/site.ini.append.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;. Please note that if you already have either [ExtensionSettings] or [RoleSettings] section in your site ini file, you have to add the line(s) to the corresponding section(s).&lt;/p&gt;
&lt;pre class=&quot;wordwrap&quot;&gt;&lt;span class=&quot;line&quot;&gt;site.ini.append.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; (partial content):&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;[ExtensionSettings]&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;ActiveExtensions[]=eurofxref&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;[RoleSettings]&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;PolicyOmitList[]=eurofxref&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The last line ensures that an anonymous user will be not prompted for a login name and a password, when accessing information through the eurofxref &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt;, for example by browsing http://www.example.com/path/index.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;/mysite/eurofxref/overview. The eurofxref in the URL represents the &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt; name, not the &lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt; name. Every &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt; can have an unlimited number of &amp;#8220;views&amp;#8221; - they represent different views of the data in the &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt;. You can choose which view you want to see by entering its name after the name of the &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt; (and the slash) in a URL.&lt;/p&gt;
&lt;p&gt;Now create the directories &lt;a href=&quot;http://www.8next.com/archives/tag/design&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with design&quot;&gt;design&lt;/a&gt;, modules and settings under /&lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt;/eurofxref. Under &lt;a href=&quot;http://www.8next.com/archives/tag/design&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with design&quot;&gt;design&lt;/a&gt; create the path /&lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt;/eurofxref/&lt;a href=&quot;http://www.8next.com/archives/tag/design&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with design&quot;&gt;design&lt;/a&gt;/standard/&lt;a href=&quot;http://www.8next.com/archives/tag/templates&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with templates&quot;&gt;templates&lt;/a&gt;/eurofxref (by creating one subdirectory in this path at a time). In this directory we will put our template files, hence the directory name &lt;a href=&quot;http://www.8next.com/archives/tag/design&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with design&quot;&gt;design&lt;/a&gt;. standard stands for the default &lt;a href=&quot;http://www.8next.com/archives/tag/design&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with design&quot;&gt;design&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/templates&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with templates&quot;&gt;templates&lt;/a&gt; is, as the name says, the directory used for storing &lt;a href=&quot;http://www.8next.com/archives/tag/templates&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with templates&quot;&gt;templates&lt;/a&gt; and eurofxref is our &amp;#8220;identifier&amp;#8221;. From now on, we can use an eZ publish URI like &lt;a href=&quot;http://www.8next.com/archives/tag/design&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with design&quot;&gt;design&lt;/a&gt;:eurofxref/name_of_template.tpl for accessing &lt;a href=&quot;http://www.8next.com/archives/tag/templates&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with templates&quot;&gt;templates&lt;/a&gt; stored in this directory.&lt;/p&gt;
&lt;div class=&quot;object-center&quot;&gt;
&lt;div class=&quot;content-view-embeddedmedia&quot;&gt;
&lt;div class=&quot;class-image&quot;&gt;
&lt;div class=&quot;attribute-image&quot;&gt;&lt;a href=&quot;http://ez.no/var/ezno/storage/images/images/documentation/extensions/diagram_eurofxref/149565-2-eng-GB/diagram_eurofxref.gif&quot; target=&quot;_blank&quot;&gt;&lt;img title=&quot;Directory structure&quot; src=&quot;http://ez.no/var/ezno/storage/images/images/documentation/extensions/diagram_eurofxref/149565-2-eng-GB/diagram_eurofxref.gif&quot; border=&quot;0&quot; alt=&quot;Directory structure&quot; width=&quot;351&quot; height=&quot;241&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;pre class=&quot;wordwrap&quot;&gt;&lt;span class=&quot;line&quot;&gt;Under /&lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt;/eurofxref/settings create the following two files:&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&lt;a href=&quot;http://www.8next.com/archives/tag/design&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with design&quot;&gt;design&lt;/a&gt;.ini.append.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; (Exact content)&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;[ExtensionSettings]&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;DesignExtensions[]=eurofxref&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;pre class=&quot;wordwrap&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt;.ini.append.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; (Exact content)&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;[ModuleSettings]&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;ExtensionRepositories[]=eurofxref&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you have probably found &lt;a href=&quot;http://www.8next.com/archives/tag/out&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with out&quot;&gt;out&lt;/a&gt;, the purpose of &lt;a href=&quot;http://www.8next.com/archives/tag/design&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with design&quot;&gt;design&lt;/a&gt;.ini.append.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; is to allow using of &lt;a href=&quot;http://www.8next.com/archives/tag/templates&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with templates&quot;&gt;templates&lt;/a&gt; located in our &lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt;, in &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt;.ini.append.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; we say to eZ publish we are having modules in this &lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now we are coming to the most important part: creating the &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt; eurofxref itself. Under /&lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt;/eurofxref/modules create a directory eurofxref (the name of the &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt;) and create the following files:&lt;/p&gt;
&lt;pre class=&quot;wordwrap&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt;.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; (Exact content)&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;?&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;$&lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;Module&lt;/a&gt; = array( 'name' =&amp;gt; 'Eurofxref' );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;$ViewList = array();&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;$ViewList['overview'] = array(&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;   'script' =&amp;gt; 'overview.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;',&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;   'params' =&amp;gt; array ( ) );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;wordwrap&quot;&gt;&lt;span class=&quot;line&quot;&gt;overview.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; (Exact content)&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;?&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;include_once( 'kernel/common/template.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;' );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;$tpl =&amp;amp; templateInit();&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;$Result = array();&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;$Result['content'] =&amp;amp; $tpl-&amp;gt;fetch( '&lt;a href=&quot;http://www.8next.com/archives/tag/design&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with design&quot;&gt;design&lt;/a&gt;:eurofxref/overview.tpl' );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;$Result['path'] = array( array( 'url' =&amp;gt; false,&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;                               'text' =&amp;gt; 'Euro Exchange Rates' ) );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;pre class=&quot;wordwrap&quot;&gt;&lt;span class=&quot;line&quot;&gt;function_definition.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; (Exact content)&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;?&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;$FunctionList = array();&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;$FunctionList['fxref'] = array(&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;'name' =&amp;gt; 'fxref',&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;'call_method' =&amp;gt; array( &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;'include_file' =&amp;gt; '&lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt;/eurofxref/modules/eurofxref/classes/eurofxref.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;',&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;'class' =&amp;gt; 'EuroFxRef',&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;'method' =&amp;gt; 'fetchFX' ),&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;'parameter_type' =&amp;gt; 'standard',&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;'parameters' =&amp;gt; array() );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt;.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; file is used to connect the different views in the &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt;, represented by keys in the $ViewList array (in our case &amp;#8216;overview&amp;#8217;) with the file names (overview.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;). We can see that overview.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; contains simple code to fetch and process the template file &lt;a href=&quot;http://www.8next.com/archives/tag/design&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with design&quot;&gt;design&lt;/a&gt;:eurofxref/overview.tpl. We will create this file later.&lt;/p&gt;
&lt;p&gt;If you have {let var_name=fetch( &amp;#8216;&lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt;&amp;#8217;, &amp;#8216;function&amp;#8217;, &amp;#8216;parameters&amp;#8217; )} in the template, eZ publish will call a method whose parameters are defined in the file function_definition.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; under the corresponding &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt;. Having a look in our function_definition.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; file, we see that if the template fetches the function fxref in our &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt; (eurofxref), eZ publish will call the method EuroFxRef::fetchFX() which will be defined in /&lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt;/eurofxref/modules/eurofxref/classes/eurofxref.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;. In our simple example, we do not have any parameters in the fetch.&lt;/p&gt;
&lt;p&gt;Create the directory classes under /&lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt;/eurofxref/modules/eurofxref and place the following file in it:&lt;/p&gt;
&lt;pre class=&quot;wordwrap&quot;&gt;&lt;span class=&quot;line&quot;&gt;eurofxref.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; (Exact content)&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;?&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;include_once( 'lib/ezxml/classes/ezxml.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;' );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;class EuroFxRef&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;{&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;   // static&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;   function fetchFX()&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;   {&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;       $result = array( 'date' =&amp;gt; false, 'fx' =&amp;gt; array() );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;       $fxXML = file_get_contents(&quot;http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml&quot;);&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;       $xml = new eZXML();&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;       $dom =&amp;amp; $xml-&amp;gt;domTree( $fxXML );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;       $fxArray =&amp;amp; $dom-&amp;gt;elementsByName( 'Cube' );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;       foreach ( $fxArray as $fxRate )&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;       {&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;           if ( !$fxRate-&amp;gt;hasAttributes() )&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;               continue;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;           $currency = $fxRate-&amp;gt;attributeValue( 'currency' );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;           if ( $currency === false )&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;           {&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;               if ( $fxRate-&amp;gt;attributeValue( 'time' ) != false )&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;               {&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;                   $datePieces = explode( '-', $fxRate-&amp;gt;attributeValue( 'time' ) );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;                   $result['date'] = mktime( 0, 0, 0, $datePieces[1], $datePieces[2], $datePieces[0] );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;               }&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;           }&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;           else&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;           {&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;               $value = $fxRate-&amp;gt;attributeValue( 'rate' );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;               $result['fx'][$currency] = $value;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;           }&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;       }&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;       return array( 'result' =&amp;gt; $result );&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;   }&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Note that we are returning our data ($result) in an array element with the key &amp;#8216;result&amp;#8217;.&lt;/p&gt;
&lt;p&gt;When the file is parsed and the result is returned, the $result array looks like:&lt;/p&gt;
&lt;pre class=&quot;wordwrap&quot;&gt;&lt;span class=&quot;line&quot;&gt;$result = array( 'date' =&amp;gt; 1081980000,&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;                    'fx' =&amp;gt; array( 'USD' =&amp;gt; 1.1912,&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;                                   'JPY' =&amp;gt; 129.39,&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;                                   'DKK' =&amp;gt; 7.4443,&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;                                   ...&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;                                   'ZAR' =&amp;gt; 7.8591 ) )&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The last file which we need to create before testing our new &lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt;, is the template file overview.tpl under /&lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt;/eurofxref/&lt;a href=&quot;http://www.8next.com/archives/tag/design&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with design&quot;&gt;design&lt;/a&gt;/standard/&lt;a href=&quot;http://www.8next.com/archives/tag/templates&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with templates&quot;&gt;templates&lt;/a&gt;/eurofxref. Put the following contents in it:&lt;/p&gt;
&lt;pre class=&quot;wordwrap&quot;&gt;&lt;span class=&quot;line&quot;&gt;overview.tpl (Exact content)&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;h1&amp;gt;Euro foreign exchange reference rates&amp;lt;/h1&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;{let rates=fetch( 'eurofxref', 'fxref' )}&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;Date: {$rates.date|l10n( 'date' )}&amp;lt;br /&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;br /&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;table border=&quot;1&quot;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt; Currency &amp;lt;/th&amp;gt;&amp;lt;th&amp;gt; Value &amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;{section loop=$rates.fx}&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; {$:key} &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; {$:item|l10n( 'number' )} &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;{/section}&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;{/let}&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;br /&amp;gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;Source: &amp;lt;a href=&quot;http://www.ecb.int&quot;&amp;gt;European Central Bank&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As outlined before, we use let rates=fetch( &amp;#8216;eurofxref&amp;#8217;, &amp;#8216;fxref&amp;#8217; ) to fetch data through the function EuroFxRef::fetchFX(). Using $rates.date we can output the date and we can cycle through elements of $rates.fx (with loop=$rates.fx).&lt;/p&gt;
&lt;p&gt;If you point your browser to http://www.example.com/path/index.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;/mysite/eurofxref/overview you should see a table with currency symbols and rates:&lt;/p&gt;
&lt;div class=&quot;object-center&quot;&gt;
&lt;div class=&quot;content-view-embeddedmedia&quot;&gt;
&lt;div class=&quot;class-image&quot;&gt;
&lt;div class=&quot;attribute-image&quot;&gt;&lt;a href=&quot;http://ez.no/var/ezno/storage/images-versioned/149568/1-eng-GB/screenshot_eurofxref1.gif&quot; target=&quot;_blank&quot;&gt;&lt;img title=&quot;Screenshot of module output&quot; src=&quot;http://ez.no/var/ezno/storage/images-versioned/149568/1-eng-GB/screenshot_eurofxref1.gif&quot; border=&quot;0&quot; alt=&quot;Screenshot of module output&quot; width=&quot;389&quot; height=&quot;594&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can print the current exchange rate of your currency in any template just by including the following code in it.&lt;/p&gt;
&lt;pre class=&quot;wordwrap&quot;&gt;&lt;span class=&quot;line&quot;&gt;(partial content)&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;{let rates=fetch( 'eurofxref', 'fxref' )}&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;1 EUR = {$rates.fx.USD|l10n( 'number' )} USD&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;{/let}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;If you want to use this code on pages which are frequently used then you may consider some optimization. The problem is that the code will download the XML document every time the fetch function is called. One possible solution is to store the values into a database and if we know the data is valid next fetches will use these stored values instead of downloading the XML document from &lt;a href=&quot;http://www.8next.com/archives/tag/web&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with Web&quot;&gt;web&lt;/a&gt; again and again.&lt;/p&gt;
&lt;p&gt;The second solution is much simpler but not so sophisticated. We can use the template function cache-block to cache a generated part of the page. Using this function is very simple:&lt;/p&gt;
&lt;pre class=&quot;wordwrap&quot;&gt;&lt;span class=&quot;line&quot;&gt;(partial content)&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;{cache-block expiry=3600}&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;{let rates=fetch( 'eurofxref', 'fxref' )}&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;1 EUR = {$rates.fx.USD|l10n( 'number' )} USD&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;{/let}&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;{/cache-block}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We set the expiration period by setting the expiry parameter to the maximum number of seconds the element might be in the cache. In our example we use one hour (3600 seconds). We should put the entire content of overview.tpl into a cache block as well. Please note that this will cache something like &amp;#8220;1 EUR = 1.1912 USD&amp;#8221; rather than the information about rates. If you will use the code elsewhere it will download the XML document again.&lt;/p&gt;
&lt;p&gt;If you want to create views that have parameters in an URL, (e.g. http://www.example.com/path/index.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;/mysite/eurofxref/history/EUR, where history is the name of a view and EUR is a parameter), you have to add additional code to &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt;.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;, for example:&lt;/p&gt;
&lt;pre class=&quot;wordwrap&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with module&quot;&gt;module&lt;/a&gt;.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; (partial content)&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;$ViewList['history'] = array(&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;   'script' =&amp;gt; 'history.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;',&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;   'params' =&amp;gt; array ( 'CurrencySymbol' ) );&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;You can retrieve the value of the parameters in your script with:&lt;/p&gt;
&lt;pre class=&quot;wordwrap&quot;&gt;&lt;span class=&quot;line&quot;&gt;history.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; (partial content)&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt; &lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;&amp;lt;?&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt;&lt;/span&gt;

&lt;span class=&quot;line&quot;&gt;   $currencySymbol = $Params['CurrencySymbol'];&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;A more complicated addition to our example is adding parameters to the fetch function called from a template. However this exceeds the scope of this article, we recommend to read the documentation and browse the eZ publish source code, for example have a look at /kernel/content/function_definition.&lt;a href=&quot;http://www.8next.com/archives/tag/php&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with PHP&quot;&gt;php&lt;/a&gt; and see the source code of any function defined with the call_method key.&lt;/p&gt;
&lt;p&gt;You can download the whole source code of the &lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with extension&quot;&gt;extension&lt;/a&gt; from this tutorial from     &lt;a href=&quot;http://ez.no/community/contributions/examples/euro_exchange_rates&quot;&gt;http://ez.no/community/contributions/examples/euro_exchange_rates&lt;/a&gt;.&lt;/div&gt;

	Tags: &lt;a href=&quot;http://www.8next.com/archives/tag/design&quot; title=&quot;design&quot; rel=&quot;tag&quot;&gt;design&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/extension&quot; title=&quot;extension&quot; rel=&quot;tag&quot;&gt;extension&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/ezpublish&quot; title=&quot;ezpublish&quot; rel=&quot;tag&quot;&gt;ezpublish&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/module&quot; title=&quot;module&quot; rel=&quot;tag&quot;&gt;module&lt;/a&gt;, &lt;a href=&quot;http://www.8next.com/archives/tag/templates&quot; title=&quot;templates&quot; rel=&quot;tag&quot;&gt;templates&lt;/a&gt;&lt;br /&gt;

	&lt;h4&gt;Related posts&lt;/h4&gt;
	&lt;ul class=&quot;st-related-posts&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.8next.com/archives/2883&quot; title=&quot;eZ Publish 4.1 adds native support for Sun Solaris 10 and Oracle Database (October 8, 2008)&quot;&gt;eZ Publish 4.1 adds native support for Sun Solaris 10 and Oracle Database&lt;/a&gt; (0)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=ea1b6d685b8851a481958bd3955376c0&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=ea1b6d685b8851a481958bd3955376c0&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=ba969c9411934aee22a66839fb484a3c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=ba969c9411934aee22a66839fb484a3c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=46e8712648f13cc0b6f2e4c38dae9329&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=46e8712648f13cc0b6f2e4c38dae9329&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=68f762060fa92d8d9f1849ef34bc988f&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=68f762060fa92d8d9f1849ef34bc988f&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=2feaa926a99ab2c9b21ee61f57283f3f&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=2feaa926a99ab2c9b21ee61f57283f3f&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=17c6c89700c6687605aaed88d947bc33&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=17c6c89700c6687605aaed88d947bc33&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=90799ad9be38d6f12e409f9434e01539&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=90799ad9be38d6f12e409f9434e01539&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=19fd4a95e401c2c006e1d343f4aa4049&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=19fd4a95e401c2c006e1d343f4aa4049&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://www.8next.com/archives/2779/feed</wfw:commentRss><description>The purpose of this rather short tutorial is to show users of eZ publish 3 willing to write some additional functions by exploiting the extensions functionality.

In the following article where .....&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=ea1b6d685b8851a481958bd3955376c0&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=ea1b6d685b8851a481958bd3955376c0&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=ba969c9411934aee22a66839fb484a3c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=ba969c9411934aee22a66839fb484a3c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=46e8712648f13cc0b6f2e4c38dae9329&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=46e8712648f13cc0b6f2e4c38dae9329&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=68f762060fa92d8d9f1849ef34bc988f&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=68f762060fa92d8d9f1849ef34bc988f&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=2feaa926a99ab2c9b21ee61f57283f3f&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=2feaa926a99ab2c9b21ee61f57283f3f&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=17c6c89700c6687605aaed88d947bc33&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=17c6c89700c6687605aaed88d947bc33&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=90799ad9be38d6f12e409f9434e01539&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=90799ad9be38d6f12e409f9434e01539&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/neemem?a=19fd4a95e401c2c006e1d343f4aa4049&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/neemem?i=19fd4a95e401c2c006e1d343f4aa4049&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>templates</category><category>extension</category><category>PHP</category><category>ezpublish</category><category>module</category><category>design</category><pubDate>Mon, 22 Sep 2008 11:55:58 +0800</pubDate><author>neemem</author><comments>http://www.8next.com/archives/2779#comments</comments><guid isPermaLink="false">http://www.8next.com/?p=2779</guid><dc:creator>neemem</dc:creator><fs:srclink>http://www.8next.com/archives/2779</fs:srclink><fs:srcfeed>http://www.8next.com/?feed=rss2</fs:srcfeed><fs:itemid>feedsky/neemem/~7060273/121736005/5136544</fs:itemid></item><item><title>nagios的安装和配置</title><link>http://item.feedsky.com/~feedsky/neemem/~7060273/121736006/5136544/1/item.html</link><content:encoded>&lt;p&gt;&lt;span class=&quot;f14&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;什么是&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;？&lt;br /&gt;
&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;是一款网络管理软件，开源的软件。能够对网络内的主机和硬件设备进行状态监控。 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;f14&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;的优势：&lt;br /&gt;
免费；开源；高扩展性。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;f14&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;能实现的功能：&lt;br /&gt;
1. 状态监控&lt;br /&gt;
2. 预警处理&lt;br /&gt;
3. 集中，规模化管理&lt;br /&gt;
4. 可视化显示方式&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;f14&quot;&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;的实现方式：&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;采用分布-集中的管理模式。在&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;服务器上安装&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;主程序，&lt;br /&gt;
在被监控主机上安装&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;代理程序。通过&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;主程序和&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;代理程序之间的通讯，监视&lt;br /&gt;
主机状态。&lt;br /&gt;
主程序和代理程序之间有两种工作方式，一种是主程序&amp;#8211;&amp;gt;Active&amp;#8211;&amp;gt;代理程序；另一种是&lt;br /&gt;
主程序&amp;#8211;&amp;gt;passive&amp;#8211;&amp;gt;代理程序；顾名思义，是以一方向另一方主动提出通讯需求来划分的。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;的安装：&lt;br /&gt;
&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;服务器上需要安装以下包，&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;主程序，&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;的plugin程序，check_nrpe程序，imagepak包；&lt;br /&gt;
1、&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;安装&lt;br /&gt;
tar –xvzf &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-2.0.tar.gz&lt;br /&gt;
mkdir /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;&lt;br /&gt;
pw useradd &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt; –d /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;&lt;br /&gt;
pw addgroup root&lt;br /&gt;
chmod 755 /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;&lt;br /&gt;
cd &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-2.0&lt;br /&gt;
./configure &amp;#8211;prefix=/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt; &amp;#8211;with-gd-lib=/usr/local/lib &amp;#8211;with-gd-inc=/usr/local/include&lt;br /&gt;
make all&lt;br /&gt;
make install&lt;br /&gt;
make install-init          ##This installs the init script in /usr/local/etc/rc.d&lt;br /&gt;
make install-commandmode&lt;br /&gt;
make install-config        ##将初始的配置文件安装到/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;/etc&lt;br /&gt;
注:在makeinstall-init这一步的时候可能会进行不下去，这时只要加个root组即可。&lt;br /&gt;
pw addgroup root&lt;br /&gt;
2、&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-plugins的安装&lt;br /&gt;
tar –xvzf &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-plugins-1.4.tar&lt;br /&gt;
mkdir /usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-plugins&lt;br /&gt;
cd &lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag&quot; title=&quot;Posts tagged with nagios&quot;&gt;nagios&lt;/a&gt;-plugins-1.4&lt;br /&gt;
./configure &amp;#8211;prefix=/usr/local/&lt;a href=&quot;http://www.8next.com/archives/tag/nagios&quot; class=&quot;st_tag internal_tag&quot; rel=&quot;tag