<?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>BenV&#039;s notes &#187; cacti</title>
	<atom:link href="http://notes.benv.junerules.com/tag/cacti/feed/" rel="self" type="application/rss+xml" />
	<link>http://notes.benv.junerules.com</link>
	<description>Rants and notes</description>
	<lastBuildDate>Wed, 28 Jul 2010 13:36:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Net-snmp and lmSensors (and Cacti)</title>
		<link>http://notes.benv.junerules.com/all/software/net-snmp-and-lmsensors-and-cacti/</link>
		<comments>http://notes.benv.junerules.com/all/software/net-snmp-and-lmsensors-and-cacti/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 23:53:59 +0000</pubDate>
		<dc:creator>BenV</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[snmp]]></category>

		<guid isPermaLink="false">http://notes.benv.junerules.com/?p=482</guid>
		<description><![CDATA[In order to get some disk and sensor stats I decided to recompile Net-SNMP on Xenbro. Since I did this before on my server at home (32 bit slackware-current) I figured it would be a breeze. Was I in for a surprise. Since I use quite a big configure string that slackbuild doesn&#8217;t handle yet [...]]]></description>
			<content:encoded><![CDATA[<p>In order to get some disk and sensor stats I decided to recompile Net-SNMP on Xenbro. Since I did this before on my server at home (32 bit slackware-current) I figured it would be a breeze. Was I in for a surprise. Since I use quite a big configure string that slackbuild doesn&#8217;t handle yet I have it handy in a &#8216;bla&#8217; file:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>net-snmp-<span style="color: #000000;">5.5</span><span style="color: #666666; font-style: italic;"># cat bla </span><br />
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-defaults</span> <span style="color: #660033;">--localstatedir</span>=<span style="color: #000000; font-weight: bold;">/</span>var <span style="color: #660033;">--sysconfdir</span>=<span style="color: #000000; font-weight: bold;">/</span>etc <span style="color: #660033;">--with-sys-contact</span>=<span style="color: #ff0000;">&quot;Jemoeder&quot;</span> <span style="color: #660033;">--with-mib-modules</span>=<span style="color: #ff0000;">&quot;host disman/event-mib mibII/mta_sendmail smux ucd_snmp ucd-snmp/lmSensors ucd-snmp/diskio&quot;</span> <span style="color: #660033;">--enable-shared</span> <span style="color: #660033;">--with-perl-modules</span>=<span style="color: #ff0000;">&quot;PREFIX=<span style="color: #007800;">$PKG</span>/usr INSTALLDIRS=vendor&quot;</span> <span style="color: #660033;">--enable-embedded-perl</span> <span style="color: #660033;">--with-cflags</span>=<span style="color: #ff0000;">&quot;-O2&quot;</span> <span style="color: #660033;">--with-libwrap</span> &nbsp;<span style="color: #660033;">--with-python-modules</span> &nbsp;<span style="color: #660033;">--with-ldflags</span>=-lsensors &nbsp; <span style="color: #660033;">--enable-ipv6</span> <span style="color: #660033;">--disable-debugging</span> <span style="color: #660033;">--enable-static</span>=no</div></div>
<p>However, when compiling like this both v5.5 and v5.4.2.1 of net-snmp gave me:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ucd-snmp<span style="color: #000000; font-weight: bold;">/</span>.libs<br />
&nbsp;<span style="color: #c20cb9; font-weight: bold;">gcc</span> -I..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>include -I. -I..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>agent -I..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>agent<span style="color: #000000; font-weight: bold;">/</span>mibgroup -I..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>snmplib <span style="color: #660033;">-O2</span> <span style="color: #660033;">-Ulinux</span> <span style="color: #660033;">-Dlinux</span>=linux -I<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>rpm -D_REENTRANT -D_GNU_SOURCE <span style="color: #660033;">-fno-strict-aliasing</span> <span style="color: #660033;">-pipe</span> -I<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=<span style="color: #000000;">64</span> -I<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>perl5<span style="color: #000000; font-weight: bold;">/</span>5.10.0<span style="color: #000000; font-weight: bold;">/</span>x86_64-linux-thread-multi<span style="color: #000000; font-weight: bold;">/</span>CORE <span style="color: #660033;">-c</span> ucd-snmp<span style="color: #000000; font-weight: bold;">/</span>lmSensors.c &nbsp;<span style="color: #660033;">-fPIC</span> <span style="color: #660033;">-DPIC</span> <span style="color: #660033;">-o</span> ucd-snmp<span style="color: #000000; font-weight: bold;">/</span>.libs<span style="color: #000000; font-weight: bold;">/</span>lmSensors.o<br />
ucd-snmp<span style="color: #000000; font-weight: bold;">/</span>lmSensors.c: In <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #ff0000;">'_sensor_load'</span>:<br />
ucd-snmp<span style="color: #000000; font-weight: bold;">/</span>lmSensors.c:<span style="color: #000000;">943</span>: error: expected <span style="color: #ff0000;">'='</span>, <span style="color: #ff0000;">','</span>, <span style="color: #ff0000;">';'</span>, <span style="color: #ff0000;">'asm'</span> or <span style="color: #ff0000;">'__attribute__'</span> before <span style="color: #ff0000;">'*'</span> token<br />
ucd-snmp<span style="color: #000000; font-weight: bold;">/</span>lmSensors.c:<span style="color: #000000;">943</span>: error: <span style="color: #ff0000;">'data'</span> undeclared <span style="color: #7a0874; font-weight: bold;">&#40;</span>first use <span style="color: #000000; font-weight: bold;">in</span> this <span style="color: #000000; font-weight: bold;">function</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ucd-snmp<span style="color: #000000; font-weight: bold;">/</span>lmSensors.c:<span style="color: #000000;">943</span>: error: <span style="color: #7a0874; font-weight: bold;">&#40;</span>Each undeclared identifier is reported only once<br />
ucd-snmp<span style="color: #000000; font-weight: bold;">/</span>lmSensors.c:<span style="color: #000000;">943</span>: error: <span style="color: #000000; font-weight: bold;">for</span> each <span style="color: #000000; font-weight: bold;">function</span> it appears in.<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ucd-snmp<span style="color: #000000; font-weight: bold;">/</span>lmSensors.c:<span style="color: #000000;">964</span>: warning: passing argument <span style="color: #000000;">1</span> of <span style="color: #ff0000;">'sensors_get_detected_chips'</span> from incompatible pointer <span style="color: #7a0874; font-weight: bold;">type</span><br />
ucd-snmp<span style="color: #000000; font-weight: bold;">/</span>lmSensors.c:<span style="color: #000000;">964</span>: error: too few arguments to <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #ff0000;">'sensors_get_detected_chips'</span><br />
ucd-snmp<span style="color: #000000; font-weight: bold;">/</span>lmSensors.c:<span style="color: #000000;">973</span>: error: <span style="color: #ff0000;">'SENSORS_NO_MAPPING'</span> undeclared <span style="color: #7a0874; font-weight: bold;">&#40;</span>first use <span style="color: #000000; font-weight: bold;">in</span> this <span style="color: #000000; font-weight: bold;">function</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ucd-snmp<span style="color: #000000; font-weight: bold;">/</span>lmSensors.c:<span style="color: #000000;">974</span>: error: incompatible <span style="color: #7a0874; font-weight: bold;">type</span> <span style="color: #000000; font-weight: bold;">for</span> argument <span style="color: #000000;">1</span> of <span style="color: #ff0000;">'sensors_get_label'</span><br />
ucd-snmp<span style="color: #000000; font-weight: bold;">/</span>lmSensors.c:<span style="color: #000000;">974</span>: error: too many arguments to <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #ff0000;">'sensors_get_label'</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000; font-weight: bold;">***</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>ucd-snmp<span style="color: #000000; font-weight: bold;">/</span>lmSensors.lo<span style="color: #7a0874; font-weight: bold;">&#93;</span> Error <span style="color: #000000;">1</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Leaving directory <span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>net-snmp-5.4.2.1<span style="color: #000000; font-weight: bold;">/</span>agent<span style="color: #000000; font-weight: bold;">/</span>mibgroup<span style="color: #ff0000;">'<br />
make[1]: *** [subdirs] Error 1<br />
make[1]: Leaving directory `/usr/src/net-snmp-5.4.2.1/agent'</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span>: <span style="color: #000000; font-weight: bold;">***</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>subdirs<span style="color: #7a0874; font-weight: bold;">&#93;</span> Error <span style="color: #000000;">1</span></div></div>
<p>Google was as useless as ever (only 1 thread about this who solved it installing some ancient version of lmsensors or something), so I had to dick around to get this to work.<br />
First I wondered what was different about my server at home and Xenbro. 32 vs 64 bits obviously, but otherwise&#8230; not that much.<br />
So I tried upgrading libtool from version 1.5 to 2.2.6a. Recompile wasted another 5 minutes of my life.<br />
Then I read something about ucd-snmp/lmSensors vs ucd-snmp/lmsensorsMib. I have no idea what this is supposed to do, but I&#8217;d be better of not having read about it. Both options won&#8217;t compile because of the same compilation error above.</p>
<p>Finally after hours of cursing I installed lm_sensors 2.10 to /usr/local and hinted net-snmp to compile using -L/usr/local/lib, doing that made it it compile. You just have to push it a bit when it breaks&#8230; (and yes, I found out some older lm_sensors stuff was still lingering around on that home server). It kinda went like this:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># cd net-snmp-5.5/</span><br />
<span style="color: #666666; font-style: italic;"># bash bla</span><br />
<span style="color: #666666; font-style: italic;"># make</span><br />
<span style="color: #666666; font-style: italic;"># cd agent/</span><br />
<span style="color: #666666; font-style: italic;"># vim Makefile # change LD_FLAGS to include -L/usr/local/lib</span><br />
<span style="color: #666666; font-style: italic;"># make</span><br />
<span style="color: #666666; font-style: italic;"># cd ..</span><br />
<span style="color: #666666; font-style: italic;"># make</span><br />
<span style="color: #666666; font-style: italic;"># vim apps/Makefile # same edit as above</span><br />
<span style="color: #666666; font-style: italic;"># make</span></div></div>
<p>Amazing enough it even works now. You&#8217;d expect it to crash and barf all over the place&#8230;. or at least I did.</p>
<p>Now finally back to what I wanted to do: SENSOR GRAPHS in Cacti!!!<br />
A pretty much excellent description on how to do this is here: <a href="http://www.eric-a-hall.com/software/cacti-netsnmp-lmsensors/">Eric A. Hall&#8217;s on Cacti and lmsensor readings</a>.<br />
His steps summarized: </p>
<ol>
<li>Get net-snmp to return sensor readings</li>
<li>Download <a href="http://www.eric-a-hall.com/software/cacti-netsnmp-lmsensors/cacti-netsnmp-lmsensors.0.8.tar.gz">Cacti-netsnmp-lmsensors.tar.gz</a> which I mirrored here: <a href="http://notes.benv.junerules.com/wp-content/plugins/download-monitor/download.php?id=cacti-netsnmp-lmsensors.0.8.tar.gz" title="Downloaded 84 times">Cacti lmsensors</a> - Version 0.8 - SHA: f9c3f8b4d172cce9e63fa3fa0c0bbf7a58c17e7c</li>
<li>Untar, put files in right place, import templates in Cacti</li>
<li>Add data queries and graphs to hosts</li>
</ol>
<p>For more details check out his page, it has a detailed explanation. Thanks for building it Eric!</p>
<p>Then there&#8217;s disk stats. Half the links on the forums are hard to find or dead, so I&#8217;ll just take my own downloads. Easier for the next time I need it <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
<a href="http://forums.cacti.net/about12742-0-asc-0.html">This is the original thread for snmpdiskio</a> with <a href="http://forums.cacti.net/download.php?id=5233">the templates in here</a>. Then there&#8217;s a missing download for a copy/paste version of <a href="http://forums.cacti.net/viewtopic.php?p=124793#124793">this post</a>. I&#8217;ll save the copy/pasting for you, just leech it if you need it (only for when your net-snmp fails!):<br />
<a href="http://notes.benv.junerules.com/wp-content/plugins/download-monitor/download.php?id=snmpdiskio" title="Downloaded 89 times">snmpdiskio</a> - Version 0.9.6 - SHA: 0a4229c35a879240ea4c5128adbd1cb60b745757<br />
Finally there&#8217;s a script that fetches the stuff <a href="http://forums.cacti.net/download.php?id=12881">here</a>. Put that script in resource/snmp_queries/partition.xml<br />
Import the two templates from the snmpdiskio-v0.9.4 tarball.<br />
Next add the new snmp query (&#8220;Get Device I/O&#8221;) to your device (Devices -> $yourdevice -> at bottom select it from the pulldown menu). Create graphs for this device -> have fun.</p>
<p>I was going to add some images, but I&#8217;m too tired now. Hope you can get it to work, good luck <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://notes.benv.junerules.com/all/software/net-snmp-and-lmsensors-and-cacti/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Pretty graphs!</title>
		<link>http://notes.benv.junerules.com/all/software/pretty-graphs/</link>
		<comments>http://notes.benv.junerules.com/all/software/pretty-graphs/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 15:59:30 +0000</pubDate>
		<dc:creator>BenV</dc:creator>
				<category><![CDATA[Boring]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[munin]]></category>
		<category><![CDATA[rrdtool]]></category>
		<category><![CDATA[snmp]]></category>

		<guid isPermaLink="false">http://notes.benv.junerules.com/?p=443</guid>
		<description><![CDATA[Everyone loves them (except for idiots of course), pretty graphs that show fancy lines and stuff. Especially stuff. For instance stuff like this: Why make these graphs? Because you can. Because they can show you gradual changes that you normally wouldn&#8217;t notice because the change per day is only very little. Because they&#8217;re fancy. Because [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone loves them (except for idiots of course), pretty graphs that show fancy lines and stuff. Especially stuff.<br />
For instance stuff like this:<br />
<div id="attachment_444" class="wp-caption alignleft" style="width: 310px"><a href="http://notes.benv.junerules.com/wp-content/uploads/2009/09/iejoor-traffic-week.png"><img src="http://notes.benv.junerules.com/wp-content/uploads/2009/09/iejoor-traffic-week-300x129.png" alt="Traffic graph" title="Traffic graph" width="300" height="129" class="size-medium wp-image-444" /></a><p class="wp-caption-text">Traffic graph</p></div><br />
<div id="attachment_445" class="wp-caption aligncenter" style="width: 310px"><a href="http://notes.benv.junerules.com/wp-content/uploads/2009/09/uil-disk-month.png"><img src="http://notes.benv.junerules.com/wp-content/uploads/2009/09/uil-disk-month-300x94.png" alt="Disk I/O" title="Disk I/O" width="300" height="94" class="size-medium wp-image-445" /></a><p class="wp-caption-text">Disk I/O</p></div><br />
<div id="attachment_448" class="wp-caption alignright" style="width: 310px"><a href="http://notes.benv.junerules.com/wp-content/uploads/2009/09/uil-hddtemp-month.png"><img src="http://notes.benv.junerules.com/wp-content/uploads/2009/09/uil-hddtemp-month-300x129.png" alt="HDD temperature" title="HDD temperature" width="300" height="129" class="size-medium wp-image-448" /></a><p class="wp-caption-text">HDD temperature</p></div></p>
<p>Why make these graphs? Because you can. Because they can show you gradual changes that you normally wouldn&#8217;t notice because the change per day is only very little. Because they&#8217;re fancy. Because they can give an indication on how hot stuff runs. Because they can kill your mother while you sleep. Because they got all the legendary items that you&#8217;ll never have. Tons of reasons.<br />
But mainly because they&#8217;re pretty <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <span id="more-443"></span></p>
<div id="attachment_450" class="wp-caption alignleft" style="width: 310px"><a href="http://notes.benv.junerules.com/wp-content/uploads/2009/09/fileserver-schuur.png"><img src="http://notes.benv.junerules.com/wp-content/uploads/2009/09/fileserver-schuur-300x225.jpg" alt="Fileserver in the barn" title="Fileserver in the barn" width="300" height="225" class="size-medium wp-image-450" /></a><p class="wp-caption-text">Fileserver in the barn</p></div><br />
(Thanks to the <a href="http://archive.org/">waybackmachine</a> for this foto on the left, I had lost it!)<br />
Years ago when my fileserver was hanging on a wall in the barn (who needs cases anyway) where it would sometimes literally freeze, and sometimes be a whopping 30-40 degrees I decided it would be interesting to graph these temperatures etc. I dove into <a href="http://www.lm-sensors.org/">lm_sensors</a> and managed to get temperature information from my motherboard sensors. But where do you stick them?</p>
<p>These days there are plenty of options, but back the option that I liked best was write some scripts that hack together a bunch of <span style="color:#FF00FF">rrdtool</span> commands and run those from cron every 5 minutes. For those who don&#8217;t know rrdtool, <a href="http://oss.oetiker.ch/rrdtool/">RRDtool</a> is a neat tool that creates round robin databases that you can feed data into based on an interval of your choosing. After feeding it information you can pull graphs out of it as shown in the top images with a ton of options.<br />
Hacking these scripts together was fun the first time, but after a while it gets tedious. Especially when you lose the scripts to a harddisk crash or have to rewrite them because of different output etc. So what some people do is use a tool that takes data from a source (still a script in most cases, but very tiny scripts) and stashes it into a rrdtool database for them. Some of them even generate the graphs for you with a nice little (web)interface. </p>
<p>So after losing the entire fileserver after moving (guess it didn&#8217;t like being removed from the barn) I checked out several tools. </p>
<ul>
<li><a href="http://oss.oetiker.ch/mrtg/">MRTG</a> is well known for making those router datatraffic graphs. People (ab)use it for generating tons of other graphs as well these days. Nice and simple if you want to generate those data traffic graphs, but if you want a tool that is a little more versatile you probably do not want MRTG. It&#8217;s cool though, and made by the same author as RRDtool.</li>
<li><a href="http://munin.projects.linpro.no/">Munin</a> is a bigger project aimed at monitoring pretty much everything. There&#8217;s a ton of plugins for this beast that do just that. However, when playing around with it I found out that it also sucked a ton of CPU out of my machine while generating the graphs every time. It has a CGI mode where it&#8217;s supposed to only generate those when requested, but I couldn&#8217;t get it working (dead image links and everything). Cute toy, but it&#8217;s still very rough around the edges. Too much for my liking, so I ditched it after toying with it for a few months.</li>
<li>Then we have <a href="http://www.cacti.net/">Cacti</a>, the tool I still use today. You can read more about it below.</li>
<li>Of course there are also a ton of commercial solutions for this, but I don&#8217;t like commercial stuff. I&#8217;ve heard a few good things about <a href="http://www.zenoss.com/product/systems-management">ZenOSS</a> though&#8230; but I can&#8217;t get through their commercial site. No info, only marketing bullshit. So no go. (and no sale)</li>
</ul>
<h2>Cacti</h2>
<p>Right now I&#8217;m back to Cacti again for the pretty graphs solution. Why Cacti?</p>
<ul>
<li>Relatively nice web interface to configure and view your data sources, devices to monitor, and of course your graphs</li>
<li>Comes with a bunch of good default graphs and tools. Templates are good.</li>
<li>Doesn&#8217;t suck the life out of my CPU, although obviously all monitoring solutions waste a bunch of CPU. One reason is that it generates graphs on demand, not every 5 minutes.</li>
<li>Easy installation (Apache + PHP + MySQL), doesn&#8217;t require much on other devices that you want to monitor. (SNMP is enough most of the times)</li>
</ul>
<p>What sucks about Cacti?</p>
<ul>
<li>It can be a bitch to get a graph working. One of the reasons I switched to other products was that I couldn&#8217;t get Cacti to work for some very simple graphs, but I couldn&#8217;t figure out why it wouldn&#8217;t work.</li>
<li>Interface could use a redesign. It works, but the steps to generate a graph are confusing, there are several ways to do it and half of them don&#8217;t work as you&#8217;d expect. Maybe some wizards could fix this though.</li>
<li>Development isn&#8217;t dead, but it sure as hell isn&#8217;t going anywhere soon. When I quit using Cacti it pretty much looked and worked the same as it does now. That&#8217;s been 3 years I think.</li>
</ul>
<p>Installing Cacti is something you&#8217;ll manage yourself. Just trash it in the webdir, point your browser at it and walk through the installation steps. Easy enough. Just make sure your server has net-snmp installed. Now for adding some basic graphs.</p>
<p>The easiest way of generating graphs is by getting your data through <a href="http://en.wikipedia.org/wiki/Simple_Network_Management_Protocol">SNMP</a>. Most (not too cheap) routers and managed switches respond to it, and on all *nix systems you can get it running. Configuring SNMP can be a little more annoying though, since it&#8217;s one of those products that are really confusing to start with. Either walk through <span style="color:#00FFFF">snmpconf -g basic_setup</span> to generate your <span style="color:#FFFF00">snmpd.conf</span>, or take mine for some defaults. Be sure to close SNMP from outside your network of trust (the internet), they don&#8217;t need that access. SNMP is one of those protocols that can&#8217;t convince me of being secure. There are 3 versions of it, version 1 basically has no security, version 2 has no security with added layers of obscurity and with version 3 it becomes impossible to operate while having user/password/network combinations of &#8220;security&#8221;. So I don&#8217;t trust it, but that&#8217;s what a firewall is for. Since I don&#8217;t trust it anyway, I have the configuration pretty much open for reading anything by anyone as long as you can reach it. (I&#8217;m sure the SNMP experts disagree with my vision. You can link your tutorials on how to set it up below).<br />
<a href="http://notes.benv.junerules.com/wp-content/plugins/download-monitor/download.php?id=snmpd.conf" title="Downloaded 41 times">snmpd.conf</a> - Version  - SHA: 2312cae8b385d02864094427db75696857d16a32<br />
Oh yeah, another beauty: smnpd and its configuration depend on how it was compiled. So sometimes you do get disk stats, sometimes you don&#8217;t. Sensor statistics usually isn&#8217;t included, but if you recompile net-snmp and add <code class="codecolorer text vibrant"><span class="text">--with-mib-modules=&quot;ucd-snmp/lmSensors&quot;</span></code> (and your other modules!!!) you at least have a chance of getting it working.<br />
If you want to test or check the information that your snmp daemon returns, try <code class="codecolorer text vibrant"><span class="text">snmpwalk -v1 -c public $YOURHOSTNAME</span></code>.</p>
<p>Now that we&#8217;ve got that out of the way, let&#8217;s walk through the steps of creating fancy graphs.</p>
<ol>
<li value="0">On your device that you want to make graphs of, install snmpd and put the snmpd.conf in /etc/snmp. Oh, and start snmpd.</li>
<li>In the webinterface (as admin), go to <span style="color:#00FFFF">Console</span> -> <span style="color:#00FFFF">Devices</span> and click <span style="color:#00FFFF">add</span> in the upper right corner</li>
<li>Fill out information that&#8217;s obvious (hostname, description) and pick <span style="color:#FF0055">ucd/net SNMP host</span> for template. I always pick SNMP version 2 (since 3 is so much more hassle to setup) and hit create. It should return <span style="color:#FF00FF">Save Successful.</span>If it mentions <span style="color:#FF1111">SNMP error</span> then your snmp daemon could not be reached or returned bad information. Fix it! For pokemon os check out <span style="color:#FFFF00">/etc/default/snmpd</span> where they run it only on 127.0.0.1 by default. Either remove it or add your internal network IP address there. If you think it&#8217;s fixed OR want some debug info, scroll down to <span style="color:#00FF00">Associated Data Queries</span> and click <span style="color:#FF00FF">verbose query</span> (any one will do).  Once SNMP information doesn&#8217;t moan about errors anymore but gives you some decent info, it&#8217;s good.</li>
<li>Click <span style="color:#FF00FF">Create Graphs for this Host</span>. You should now get a selection screen where you can check boxes of things you want graphs from. If because of your constant failing the SNMP queries failed to get results in the previous step and therefore show you no options in the <span style="color:#FFFFFF; background:#3333FF"><b>Data Query</b></span> boxes, you might have to click the <span style="color:#00FF00">green circle</span> in the blue bar to reload that query. If it&#8217;s still empty your snmpd probably doesn&#8217;t supply that information.</li>
<li>Enable the checkboxes for lines that sound like they would make an interesting graph. CPU, Memory, and Load usually work and if you have interface statistics pick one that has a reasonable IP address. Hit <span style="color:#00FF00">Create</span> when you&#8217;ve enabled all checkboxes that sound good.</li>
<li>This is enough to let Cacti generate graphs, but you also want to be able to view those graphs. Go to <span style="color:#00FF00">Graph Trees</span> in the left menu and click <span style="color:#00FF00">Default Tree</span> on the rigth pane. Click <span style="color:#00FF00">Add</span>, then for <span style="color:#00FF00">Tree Item Type</span> take <span style="color:#00FF00">Host</span>. Select your newly created device and hit <span style="color:#00FF00">Create</span>. Now go fix yourself a cup of coffee while the graphs are being manufactured.</li>
</ol>
<p>&#8220;<span style="color:#00CF3F">But my graphs are empty! Images missing! My head exploding!</span>&#8221;<br />
Yeah, I know that feeling. First of all: WAIT! First the graphs have to be generated and collect some data before something appears. This will take a few cycles, and a cycle is 5 minutes. In other words: go fish for half an hour, play a game, do a rain dance. Now there should be pretty graphs!<br />
Like this:<br />
<div id="attachment_465" class="wp-caption alignnone" style="width: 310px"><a href="http://notes.benv.junerules.com/wp-content/uploads/2009/09/23.png"><img src="http://notes.benv.junerules.com/wp-content/uploads/2009/09/23-300x182.png" alt="Cacti new graphs" title="Cacti new graphs" width="300" height="182" class="size-medium wp-image-465" /></a><p class="wp-caption-text">Cacti new graphs</p></div>
<p>Now go add your other devices!<br />
If you feel like trying out some more advanced stuff, check out some of the scripts/templates on <a href="http://forums.cacti.net/forum-12.html">the cacti forums</a> . For instance the Disk IO graphs I can be made with <a href="http://forums.cacti.net/about12742.html">this snmpdiskio</a> package.</p>
<p>Well, enough for now, thanks for reading!</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.benv.junerules.com/all/software/pretty-graphs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
