<?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>The Lazy Sys Admin&#187; vmstat</title>
	<atom:link href="http://www.thelazysysadmin.net/tag/vmstat/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thelazysysadmin.net</link>
	<description>Why do things the hard way?</description>
	<lastBuildDate>Mon, 07 Jun 2010 22:24:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Monitoring Linux Disk Statistics with Cacti</title>
		<link>http://www.thelazysysadmin.net/2009/06/monitoring-linux-disk-statistics-with-cacti/</link>
		<comments>http://www.thelazysysadmin.net/2009/06/monitoring-linux-disk-statistics-with-cacti/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 01:40:32 +0000</pubDate>
		<dc:creator>Jon Smith</dc:creator>
				<category><![CDATA[Cacti]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Disk Stats]]></category>
		<category><![CDATA[Graphing]]></category>
		<category><![CDATA[iostat]]></category>
		<category><![CDATA[sysstat]]></category>
		<category><![CDATA[vmstat]]></category>

		<guid isPermaLink="false">http://www.thelazysysadmin.net/?p=234</guid>
		<description><![CDATA[Cacti Monitoring of Disk Statistics with iostat and vmstat that will show the disk mount point on the graph with details similar to what is found in Windows PerfMon.]]></description>
			<content:encoded><![CDATA[<p>I firstly want to acknowledge the work of Mark Round and <a href="http://www.markround.com/archives/48-Linux-iostat-monitoring-with-Cacti.html" target="_blank">Linux iostat monitoring with Cacti</a>. The following work was inspired and based on the ideas found in Mark&#8217;s post.</p>
<p>My main objective when I started looking into disk monitoring was to get some similar stats into Cacti for Linux that can be found with the Windows PerfMon utility. I found Mark&#8217;s post and didn&#8217;t quite like the way it used cron to collect its statistics, and wanted something that I could easily add to snmpd.conf without needing to change much more. I was also keen on obtaining the mount point data for each partition as looking at &#8220;cciss/c0d0p3&#8243; doesn&#8217;t mean as much to management (and sometimes to me) and hopefully &#8220;/home&#8221; does.</p>
<p><span id="more-234"></span>So I wrote a script which uses the output from &#8220;df -l&#8221;, &#8220;vmstat -d&#8221;, &#8220;iostat -dk&#8221;, &#8220;iostat -xdk&#8221; to produce the results I wanted. This script only looks at the individual partition on the disk. Some of the stats don&#8217;t work with Software RAID, and some stats are missing for some older versions of the kernel when used with a HP Hardware RAID card (this is all I have tested with). These are the results.</p>
<p><img class="alignnone size-full wp-image-239" title="Disk Stats - Data Transferred" src="http://www.thelazysysadmin.net/wp-content/uploads/2009/06/data-transferred.png" alt="Disk Stats - Data Transferred" width="603" height="270" /></p>
<p><img class="alignnone size-full wp-image-243" title="Disk Stats - Operations" src="http://www.thelazysysadmin.net/wp-content/uploads/2009/06/operations.png" alt="Disk Stats - Operations" width="603" height="242" /></p>
<p><img class="alignnone size-full wp-image-240" title="Disk Stats - Disk Queue Size" src="http://www.thelazysysadmin.net/wp-content/uploads/2009/06/disk-queue-size.png" alt="Disk Stats - Disk Queue Size" width="603" height="228" /></p>
<p><img class="alignnone size-full wp-image-244" title="Disk Stats - Time On Disk" src="http://www.thelazysysadmin.net/wp-content/uploads/2009/06/time-on-disk.png" alt="Disk Stats - Time On Disk" width="603" height="242" /></p>
<p><img class="alignnone size-full wp-image-241" title="Disk Stats - Disk Utilisation" src="http://www.thelazysysadmin.net/wp-content/uploads/2009/06/disk-utilisation.png" alt="Disk Stats - Disk Utilisation" width="603" height="228" /></p>
<p><img class="alignnone size-full wp-image-242" title="Disk Stats - Disk Wait Times" src="http://www.thelazysysadmin.net/wp-content/uploads/2009/06/disk-wait-times.png" alt="Disk Stats - Disk Wait Times" width="603" height="242" /></p>
<h3>Requirements:</h3>
<ul>
<li>sysstat package</li>
<li>Net-SNMP</li>
<li>Tie::IxHash perl module</li>
<li>Cacti (Ver 0.8.7d minimum)</li>
</ul>
<h3>Installation:</h3>
<ol>
<li>Make sure you have the requirements installed.<br />
Tie::IxHash comes as a package on both Debian/Ubuntu and OpenSUSE and at the very least you could install it using CPAN.<br />
Sysstat also should come prepackaged for most Linux Distros.</li>
<li>Copy the &#8220;<em>disk_stats.xml</em>&#8221; file from the archive into the &#8220;<em>resource/snmp_queries</em>&#8221; folder of your Cacti installation.</li>
<li>Copy the &#8220;<em>disk_stats.pl</em>&#8221; file to your &#8220;<em>/usr/local/bin</em>&#8221; directory and run &#8220;<em>chmod +x /usr/local/bin/disk_stats.pl</em>&#8220;.</li>
<li>Edit your &#8220;<em>snmpd.conf</em>&#8221; file and add the following line &#8220;<em>pass .1.3.6.1.4.1.2021.51 /usr/bin/perl /usr/local/bin/disk_stats.pl</em>&#8221; (If that OID conflicts with another OID on your system you need to change the value used both in your snmpd.conf file and in the disk_stats.pl file. You will need to restart SNMPD after this change.</li>
<li>Import the &#8220;<em>cacti_data_query_snmp_-_disk_stats.xml</em>&#8221; file into your Cacti installation using the &#8220;<em>Import Templates</em>&#8221; menu option.</li>
</ol>
<p>You should now be able to open a device and add the &#8220;SNMP &#8211; Disk Stats&#8221; in the &#8220;Associated Data Queries&#8221; section.</p>
<h3>Download:</h3>
<ul>
<li><a href="http://www.thelazysysadmin.net/file-downloads/" target="_self">Monitoring Linux Disk Stats with Cacti</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.thelazysysadmin.net/2009/06/monitoring-linux-disk-statistics-with-cacti/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
