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

<channel>
	<title>Running Systems&#187; monitor</title>
	<atom:link href="http://run.tournament.org.il/tag/monitor/feed/" rel="self" type="application/rss+xml" />
	<link>http://run.tournament.org.il</link>
	<description>(and me chasing them)</description>
	<lastBuildDate>Wed, 02 Jun 2010 13:50:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Centreon and batch-adding hosts</title>
		<link>http://run.tournament.org.il/centreon-and-batch-adding-hosts/</link>
		<comments>http://run.tournament.org.il/centreon-and-batch-adding-hosts/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 10:51:09 +0000</pubDate>
		<dc:creator>ez-aton</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting/Programing]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[centreon]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nagios]]></category>

		<guid isPermaLink="false">http://run.tournament.org.il/?p=447</guid>
		<description><![CDATA[Centreon is a nice GUI wrapper for Nagios. It is using MySQL as its configuration engine, and it functions quite well. One thing Cacti can do but Centreon can&#8217;t is mass automatic addition of servers. I have had a new site with an installed Centreon, and I wanted to add about 40 servers to be [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.centreon.com/" target="_blank">Centreon</a> is a nice GUI wrapper for <a href="http://www.nagios.org" target="_blank">Nagios</a>. It is using MySQL as its configuration engine, and it functions quite well. One thing <a href="http://www.cacti.net" target="_blank">Cacti</a> can do but Centreon can&#8217;t is mass automatic addition of servers. I have had a new site with an installed Centreon, and I wanted to add about 40 servers to be monitored. This is a tedious work, and I was searching for some semi-automatic method of doing it.<br />
This is not perfect, but it worked for me.<br />
In this case I do not replicate service-group relationship, but only add a mass of servers.</p>
<p>First &#8211; create a text file containing a list of servers and IPs. It should look like this:<br />
serv1:1.2.3.4<br />
serv2:10.2.1.3<br />
new_srv:2.3.4.1<br />
&#8230;</p>
<p>I have placed in in /tmp/machines</p>
<p>Second &#8211; find the last host entry. In my case the DB name is Centreon, so I run the following command:</p>
<blockquote><p>mysql -u root -p centreon -e&#8217;select host_id from host&#8217;</p></blockquote>
<p>This should return a colum with numbers. Find the largest one and increment it by one. In my example the last one was 19, so my initial host_id will be 20.</p>
<p>You should now find the host_template_model_html_id you are to use. There are few methods for that, but the easiest way is to find another host information which matches to some level your desired information. In my case it was called &#8220;DB1&#8243;, so this looks like this:</p>
<blockquote><p>mysql -u root -p centreon -e&#8221;select host_template_model_htm_id from host where host_name=&#8217;DB1&#8242;&#8221;</p></blockquote>
<p>Please note that my blog formatting might change the quote character. You might not want to copy/paste it, but type it yourselves.</p>
<p>The result of the above query should give us a template ID. In my case it was &#8220;2&#8243;, which is fine by me.</p>
<p>If you want a better reference for the values entered, you can do a whole select for a single host to verify your values match mine:</p>
<blockquote><p>mysql -u root -p centreon -e&#8221;select * from host where host_name=&#8217;DB1&#8242;\G&#8221;</p></blockquote>
<p>This should give you long listing and information of the host, as a reference.</p>
<p>My script goes like this, based on the assumptions made above:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://run.tournament.org.il/wp-content/plugins/wp-codebox/wp-codebox.php?p=447&amp;download=populate_oreon.sh">populate_oreon.sh</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4472"><td class="code" id="p447code2"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #007800;">HOST</span>=<span style="color: #000000;">20</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>machines<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">do</span>
   <span style="color: #007800;">NAME</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$i</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-f1</span> -d:<span style="color: #000000; font-weight: bold;">`</span>
   <span style="color: #007800;">IP</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$2</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-f2</span> -d:<span style="color: #000000; font-weight: bold;">`</span>
   <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;insert into host values ('<span style="color: #007800;">$HOST</span>',2,NULL,NULL,1,NULL,NULL,NULL,NULL,'<span style="color: #007800;">$NAME</span>','<span style="color: #007800;">$NAME</span>','<span style="color: #007800;">$IP</span>',NULL,NULL,'2','2','2','2','2',NULL,'2',NULL,NULL,'2','2','2','2',NULL,NULL,'2',NULL,NULL,'0',NULL,'1','1');&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>insert_sql.sql
   <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;insert into extended_host_information values('',<span style="color: #007800;">$HOST</span>,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>insert_sql.sql
   <span style="color: #7a0874; font-weight: bold;">let</span> HOST++
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<p>This should create a file called /tmp/insert_sql.sql which then should be first reviewed, and then inserted into your database.</p>
<p>Needless to say &#8211; back up your database first, just in case:</p>
<blockquote><p>mysqldump -u root -p &#8211;opt -B centreon &gt; /tmp/centreon_backup.sql</p></blockquote>
<p>and then insert the newly created data:</p>
<blockquote><p>mysql -u root -p centreon &lt; /tmp/insert_sql.sql</p></blockquote>
<p>Notice &#8211; at this point, no service relationship is created. I think it is quite a chore only to create the nodes. Adding the service relationships complicates things a bit, and I did not want to go there at this specific stage. However, for few tenths of monitored hosts, this is quite a lifesaver.</p>
<p>Notice that this is only Centreon configuration, and you will be required to apply it (through the GUI) to Nagios.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://run.tournament.org.il/centreon-and-batch-adding-hosts/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Xen VMs performance collection</title>
		<link>http://run.tournament.org.il/xen-vms-performance-collection/</link>
		<comments>http://run.tournament.org.il/xen-vms-performance-collection/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 18:58:43 +0000</pubDate>
		<dc:creator>ez-aton</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting/Programing]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[SNMP]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.tournament.org.il/run/?p=486</guid>
		<description><![CDATA[Unlike VMware Server, Xen&#8217;s HyperVisor does not allow an easy collection of performance information. The management machine, called &#8220;Domain-0&#8243; is actually a privileged virtual machine, and thus &#8211; get its own small share of CPUs and RAM. Collecting performance information on it will lead to, well, collecting performance information for a single VM, and not [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Unlike VMware Server, Xen&#8217;s HyperVisor does not allow an easy collection of performance information. The management machine, called &#8220;Domain-0&#8243; is actually a privileged virtual machine, and thus &#8211; get its own small share of CPUs and RAM. Collecting performance information on it will lead to, well, collecting performance information for a single VM, and not the whole bunch.</p>
<p>Local tools, such as &#8220;<em>xentop</em>&#8221; allows collection of information, however, combining this with <a href="http://www.cacti.net/" target="_blank">Cacti</a>, or any other SNMP-based collection tool is a bit tricky.</p>
<p>A great solution is provided by Ian P. Christian in his blog post about <a href="http://pookey.co.uk/blog/archives/53-Monitoring-Xen-via-SNMP-update.html" target="_blank">Xen monitoring</a>. He has created a Perl script to collect information. I have taken the liberty to fix several minor things with his permission. The modified scripts are presented below. Name the script (according to your version of Xen) &#8220;<em>/usr/local/bin/xen_stats.pl</em>&#8221; and set it to be executable:</p>
<p><strong>For Xen 3.1</strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://run.tournament.org.il/wp-content/plugins/wp-codebox/wp-codebox.php?p=216&amp;download=xen_stats.pl">xen_stats.pl</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2165"><td class="code" id="p216code5"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl -w</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># declare...</span>
<span style="color: #000000; font-weight: bold;">sub</span> trim<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$)</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#&lt;a href=&quot;/blog/files/xen_cloud.tar.gz&quot; title=&quot;xen_cloud.tar.gz&quot; target=&quot;_blank&quot;&gt;xen_cloud.tar.gz&lt;/a&gt;</span>
<span style="color: #666666; font-style: italic;"># we need to run 2 iterations because CPU stats show 0% on the first, and I'm putting .1 second betwen them to speed it up</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@result</span> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/split.html"><span style="color: #000066;">split</span></a><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\n/</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">`xentop -b -i 2 -d.1`</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># remove the first line</span>
<a href="http://perldoc.perl.org/functions/shift.html"><span style="color: #000066;">shift</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<a href="http://perldoc.perl.org/functions/shift.html"><span style="color: #000066;">shift</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@result</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">while</span> <span style="color: #0000ff;">@result</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #0000ff;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!~</span> <span style="color: #009966; font-style: italic;">/^xentop - /</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># the next 3 lines are headings..</span>
<a href="http://perldoc.perl.org/functions/shift.html"><span style="color: #000066;">shift</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/shift.html"><span style="color: #000066;">shift</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/shift.html"><span style="color: #000066;">shift</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/shift.html"><span style="color: #000066;">shift</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$line</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@result</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@xenInfo</span> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/split.html"><span style="color: #000066;">split</span></a><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/[\t ]+/</span><span style="color: #339933;">,</span> trim<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <a href="http://perldoc.perl.org/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;name: %s, cpu_sec: %d, cpu_percent: %.2f, vbd_rd: %d, vbd_wr: %d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">$xenInfo</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">$xenInfo</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">$xenInfo</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">$xenInfo</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">14</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">$xenInfo</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">15</span><span style="color: #009900;">&#93;</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># trims leading and trailing whitespace</span>
<span style="color: #000000; font-weight: bold;">sub</span> trim<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$)</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$string</span> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/shift.html"><span style="color: #000066;">shift</span></a><span style="color: #339933;">;</span>
  <span style="color: #0000ff;">$string</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/^\s+//</span><span style="color: #339933;">;</span>
  <span style="color: #0000ff;">$string</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/\s+$//</span><span style="color: #339933;">;</span>
  <a href="http://perldoc.perl.org/functions/return.html"><span style="color: #000066;">return</span></a> <span style="color: #0000ff;">$string</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><strong>For Xen 3.2 and Xen 3.3</strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://run.tournament.org.il/wp-content/plugins/wp-codebox/wp-codebox.php?p=216&amp;download=xen_stats.pl">xen_stats.pl</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2166"><td class="code" id="p216code6"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl -w</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># declare…</span>
<span style="color: #000000; font-weight: bold;">sub</span> trim<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$)</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># we need to run 2 iterations because CPU stats show 0% on the first, and I’m putting .1 second between them to speed it up</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@result</span> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/split.html"><span style="color: #000066;">split</span></a><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\n/</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">`/usr/sbin/xentop -b -i 2 -d.1`</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># remove the first line</span>
<a href="http://perldoc.perl.org/functions/shift.html"><span style="color: #000066;">shift</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/shift.html"><span style="color: #000066;">shift</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@result</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">while</span> <span style="color: #0000ff;">@result</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #0000ff;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!~</span> <span style="color: #009966; font-style: italic;">/^[\t ]+NAME/</span><span style="color: #339933;">;</span>
<a href="http://perldoc.perl.org/functions/shift.html"><span style="color: #000066;">shift</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$line</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@result</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@xenInfo</span> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/split.html"><span style="color: #000066;">split</span></a><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/[\t ]+/</span><span style="color: #339933;">,</span> trim<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <a href="http://perldoc.perl.org/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span>“name<span style="color: #339933;">:</span> <span style="color: #339933;">%</span><a href="http://perldoc.perl.org/functions/s.html"><span style="color: #000066;">s</span></a><span style="color: #339933;">,</span> cpu_sec<span style="color: #339933;">:</span> <span style="color: #0000ff;">%d</span><span style="color: #339933;">,</span> cpu_percent<span style="color: #339933;">:</span> <span style="color: #339933;">%.</span>2f<span style="color: #339933;">,</span> vbd_rd<span style="color: #339933;">:</span> <span style="color: #0000ff;">%d</span><span style="color: #339933;">,</span> vbd_wr<span style="color: #339933;">:</span> <span style="color: #0000ff;">%d</span><span style="color: #0000ff;">\n</span>“<span style="color: #339933;">,</span>
        <span style="color: #0000ff;">$xenInfo</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">$xenInfo</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">$xenInfo</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">$xenInfo</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">14</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">$xenInfo</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">15</span><span style="color: #009900;">&#93;</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;"># trims leading and trailing whitespace</span>
<span style="color: #000000; font-weight: bold;">sub</span> trim<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$)</span>
<span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$string</span> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/shift.html"><span style="color: #000066;">shift</span></a><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$string</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/^\s+//</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$string</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/\s+$//</span><span style="color: #339933;">;</span>
        <a href="http://perldoc.perl.org/functions/return.html"><span style="color: #000066;">return</span></a> <span style="color: #0000ff;">$string</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><strong>Cron settings for Domain-0</strong></p>
<p>Create a file &#8220;<em>/etc/cron.d/xenstat</em>&#8221; with the following contents:</p>
<blockquote><p># This will run xen_stats.pl every minute<br />
*/1 * * * * root /usr/local/bin/xen_stats.pl &gt; /tmp/xen-stats.new &amp;&amp; cat /tmp/xen-stats.new &gt; /var/run/xen-stats</p></blockquote>
<p><strong>SNMP settings for Domain-0</strong></p>
<p>Add the line below to &#8220;<em>/etc/snmp/snmpd.conf</em>&#8221; and then restart the snmpd service</p>
<blockquote>
<pre>extend xen-stats   /bin/cat /var/run/xen-stats</pre>
</blockquote>
<p><strong>Cacti</strong></p>
<p>I reduced Ian Cacti script to be based on a per-server setup, meaning this script gets the host (dom-0) name from Cacti, but cannot support live migrations. I will try to deal with combining live migrations with Cacti in the future.</p>
<p>Download and extract my modified <a href="http://run.tournament.org.il/files/2008/10/xen_cloud.tar.gz">xen_cloud.tar.gz</a> file. Extract it, place the script and config in its relevant location, and import the template into <a href="http://www.cacti.net/" target="_blank">Cacti</a>. It should work like charm.</p>
<p>A note &#8211; the PHP script will work only on PHP5 and above. Works flawlessly on Centos5.2 for me.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://run.tournament.org.il/xen-vms-performance-collection/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>It has been a while&#8230; Today &#8211; Monitor I/O in AIX</title>
		<link>http://run.tournament.org.il/it-has-been-a-while-today-monitor-io-in-aix/</link>
		<comments>http://run.tournament.org.il/it-has-been-a-while-today-monitor-io-in-aix/#comments</comments>
		<pubDate>Sat, 25 Nov 2006 23:21:22 +0000</pubDate>
		<dc:creator>ez-aton</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[I/O]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.tournament.org.il/run-new/?p=110</guid>
		<description><![CDATA[It is a question I&#8217;ve been asked a while back, and didn&#8217;t find the time to search for it.

I have searched for an answer just now, and got to an answer given by one of the old-time gurus (most likely) in news servers (where the gurus lurk, usually). The answer is to use the command [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>It is a question I&#8217;ve been asked a while back, and didn&#8217;t find the time to search for it.</p>
<p>
<p>I have searched for an answer just now, and got to an answer given by one of the old-time gurus (most likely) in news servers (where the gurus lurk, usually). The answer is to use the command &quot;<i>filemon</i>&quot; in a syntax such as this:</p>
<p>
<p><i>filemon -O lf -o outputfile.txt</i></p>
<p>
<p>To stop the monitoring session, run &quot;<i>trcstop</i>&quot;. Review the output file generated by this command, and you will be able to view the I/O interactions which happened during that time on the system.</p>
<p />


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://run.tournament.org.il/it-has-been-a-while-today-monitor-io-in-aix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
