<?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>Jetpack Flight Log &#187; cpanel</title>
	<atom:link href="http://jetpackweb.com/blog/topics/cpanel/feed/" rel="self" type="application/rss+xml" />
	<link>http://jetpackweb.com/blog</link>
	<description>Rock{et}ing the interweb</description>
	<lastBuildDate>Sun, 12 Jun 2011 17:51:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Munin Graphs for Phusion Passenger (a.k.a. mod_rails)</title>
		<link>http://jetpackweb.com/blog/2009/09/29/munin-graphs-for-phusion-passenger-a-k-a-mod_rails/</link>
		<comments>http://jetpackweb.com/blog/2009/09/29/munin-graphs-for-phusion-passenger-a-k-a-mod_rails/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 16:54:05 +0000</pubDate>
		<dc:creator>Brian Racer</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[munin]]></category>

		<guid isPermaLink="false">http://jetpackweb.com/blog/?p=408</guid>
		<description><![CDATA[The goal of this article is to get fairly nice looking graphs of Phusion Passenger&#8217;s performance and memory metrics: This specific setup focuses on CentOS (on cPanel none the less) &#8211; but instructions should apply for most linux distros. It assumes you already have Passenger and Munin successfully setup. See my previous article on getting [...]]]></description>
			<content:encoded><![CDATA[<p>The goal of this article is to get fairly nice looking graphs of <a href="http://www.modrails.com/" target="_blank">Phusion Passenger&#8217;s</a> performance and memory metrics:</p>
<p><img src="http://jetpackweb.com/blog/wp-content/uploads/2009/09/passenger_memory_stats.png" /><br />
<img src="http://jetpackweb.com/blog/wp-content/uploads/2009/09/passenger_status.png" /></p>
<p>This specific setup focuses on CentOS (on cPanel none the less) &#8211; but instructions should apply for most linux distros. It assumes you already have Passenger and Munin successfully setup. See my <a href="http://jetpackweb.com/blog/2009/07/21/install-phusion-passenger-a-k-a-mod_rails-on-cpanel-server/">previous article</a> on getting Phusion Passenger setup if you have not already. </p>
<p>First we need to allow the <strong>munin</strong> user sudo privileges for a few passenger related commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash">$ <span class="kw2">sudo</span> <span class="sy0">/</span>usr<span class="sy0">/</span>sbin<span class="sy0">/</span>visudo
&nbsp;
<span class="co0"># Add the following line to the file</span>
munin <span class="re2">ALL</span>=<span class="br0">&#40;</span>ALL<span class="br0">&#41;</span> NOPASSWD:<span class="sy0">/</span>usr<span class="sy0">/</span>bin<span class="sy0">/</span>passenger-status, <span class="sy0">/</span>usr<span class="sy0">/</span>bin<span class="sy0">/</span>passenger-memory-stats
&nbsp;
<span class="co0"># Depending on your setup, you may also have to comment out the following line:</span>
Defaults requiretty</pre></div></div>

<p>If you see the error <strong>sorry, you must have a tty to run sudo</strong> in <strong>/var/log/munin/munin-node.log</strong>, comment out the final line shown above.</p>
<p>The following two files will glean some performance and memory statistics.</p>
<p><strong>Passenger Status:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">sudo</span> <span class="kw2">vi</span> <span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>munin<span class="sy0">/</span>plugins<span class="sy0">/</span>passenger_status</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="ruby"><span class="co1">#!/usr/bin/env ruby</span>
&nbsp;
<span class="kw1">def</span> output_config
  <span class="kw3">puts</span> <span class="sy0">&lt;&lt;-</span><span class="kw1">END</span>
graph_category App
graph_title passenger status
graph_vlabel count
&nbsp;
sessions.<span class="me1">label</span> sessions
max.<span class="me1">label</span> max processes
running.<span class="me1">label</span> running processes
active.<span class="me1">label</span> active processes
<span class="kw1">END</span>
  <span class="kw3">exit</span> <span class="nu0">0</span>
<span class="kw1">end</span>
&nbsp;
<span class="kw1">def</span> output_values
  status = <span class="st0">`sudo /usr/bin/passenger-status`</span>
  <span class="kw1">unless</span> $?.<span class="me1">success</span>?
    <span class="re0">$stderr</span>.<span class="kw3">puts</span> <span class="st0">&quot;failed executing passenger-status&quot;</span>
    <span class="kw3">exit</span> <span class="nu0">1</span>
  <span class="kw1">end</span>
  status =~ <span class="sy0">/</span>max\s<span class="sy0">+</span>=\s<span class="sy0">+</span><span class="br0">&#40;</span>\d<span class="sy0">+</span><span class="br0">&#41;</span><span class="sy0">/</span>
  <span class="kw3">puts</span> <span class="st0">&quot;max.value #{$1}&quot;</span>
&nbsp;
  status =~ <span class="sy0">/</span>count\s<span class="sy0">+</span>=\s<span class="sy0">+</span><span class="br0">&#40;</span>\d<span class="sy0">+</span><span class="br0">&#41;</span><span class="sy0">/</span>
  <span class="kw3">puts</span> <span class="st0">&quot;running.value #{$1}&quot;</span>
&nbsp;
  status =~ <span class="sy0">/</span>active\s<span class="sy0">+</span>=\s<span class="sy0">+</span><span class="br0">&#40;</span>\d<span class="sy0">+</span><span class="br0">&#41;</span><span class="sy0">/</span>
  <span class="kw3">puts</span> <span class="st0">&quot;active.value #{$1}&quot;</span>
&nbsp;
  total_sessions = <span class="nu0">0</span>
  status.<span class="me1">scan</span><span class="br0">&#40;</span><span class="sy0">/</span>Sessions: <span class="br0">&#40;</span>\d<span class="sy0">+</span><span class="br0">&#41;</span><span class="sy0">/</span><span class="br0">&#41;</span>.<span class="me1">flatten</span>.<span class="me1">each</span> <span class="br0">&#123;</span> <span class="sy0">|</span>count<span class="sy0">|</span> total_sessions <span class="sy0">+</span>= count.<span class="me1">to_i</span> <span class="br0">&#125;</span>
  <span class="kw3">puts</span> <span class="st0">&quot;sessions.value #{total_sessions}&quot;</span>
<span class="kw1">end</span>
&nbsp;
<span class="kw1">if</span> ARGV<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> == <span class="st0">&quot;config&quot;</span>
  output_config
<span class="kw1">else</span>
  output_values
<span class="kw1">end</span></pre></div></div>

<p><strong>Memory Stats:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">sudo</span> <span class="kw2">vi</span> <span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>munin<span class="sy0">/</span>plugins<span class="sy0">/</span>passenger_memory_status</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="ruby"><span class="co1">#!/usr/bin/env ruby</span>
<span class="co1"># put in /etc/munin/plugins and restart munin-node</span>
<span class="co1"># by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin</span>
<span class="co1"># NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats</span>
&nbsp;
<span class="kw1">def</span> output_config
  <span class="kw3">puts</span> <span class="sy0">&lt;&lt;-</span><span class="kw1">END</span>
graph_category App
graph_title Passenger memory stats
graph_vlabel count
&nbsp;
memory.<span class="me1">label</span> memory
<span class="kw1">END</span>
  <span class="kw3">exit</span> <span class="nu0">0</span>
<span class="kw1">end</span>
&nbsp;
<span class="kw1">def</span> output_values
  status = <span class="st0">`sudo /usr/bin/passenger-memory-stats | tail -1`</span>
  <span class="kw1">unless</span> $?.<span class="me1">success</span>?
    <span class="re0">$stderr</span>.<span class="kw3">puts</span> <span class="st0">&quot;failed executing passenger-memory-stats&quot;</span>
    <span class="kw3">exit</span> <span class="nu0">1</span>
  <span class="kw1">end</span>
  status =~ <span class="sy0">/</span><span class="br0">&#40;</span>\d<span class="sy0">+</span>\.\d<span class="sy0">+</span><span class="br0">&#41;</span><span class="sy0">/</span>
  <span class="kw3">puts</span> <span class="st0">&quot;memory.value #{$1}&quot;</span>
<span class="kw1">end</span>
&nbsp;
<span class="kw1">if</span> ARGV<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> == <span class="st0">&quot;config&quot;</span>
  output_config
<span class="kw1">else</span>
  output_values
<span class="kw1">end</span></pre></div></div>

<p>Now we will link these to the active plugins, and make them executable:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">sudo</span> <span class="kw2">chmod</span> +x <span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>munin<span class="sy0">/</span>plugins<span class="sy0">/</span>passenger_status
<span class="kw2">sudo</span> <span class="kw2">chmod</span> +x <span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>munin<span class="sy0">/</span>plugins<span class="sy0">/</span>passenger_memory_status
<span class="kw2">sudo</span> <span class="kw2">ln</span> <span class="re5">-s</span> <span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>munin<span class="sy0">/</span>plugins<span class="sy0">/</span>passenger_status <span class="sy0">/</span>etc<span class="sy0">/</span>munin<span class="sy0">/</span>plugins<span class="sy0">/</span>passenger_status
<span class="kw2">sudo</span> <span class="kw2">ln</span> <span class="re5">-s</span> <span class="sy0">/</span>usr<span class="sy0">/</span>share<span class="sy0">/</span>munin<span class="sy0">/</span>plugins<span class="sy0">/</span>passenger_memory_status <span class="sy0">/</span>etc<span class="sy0">/</span>munin<span class="sy0">/</span>plugins<span class="sy0">/</span>passenger_memory_status</pre></div></div>

<p>Last thing we need to do is make sure those scripts run as the munin user:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">sudo</span> <span class="kw2">vi</span> <span class="sy0">/</span>etc<span class="sy0">/</span>munin<span class="sy0">/</span>plugin-conf.d<span class="sy0">/</span>munin-node</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash"><span class="br0">&#91;</span>passenger_<span class="sy0">*</span><span class="br0">&#93;</span>
user munin
<span class="kw3">command</span> ruby <span class="sy0">%</span>c</pre></div></div>

<p>Restart the munin node, and wait and you should see the graphs start to propagate.</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">sudo</span> <span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>munin-node restart</pre></div></div>

<p>For even more detailed performance analytics, checkout <a href="http://www.newrelic.com/" target="_blank">NewRelic</a> monitoring. And thanks to <a href="http://www.dcmanges.com/blog/rails-application-visualization-with-munin" target="_blank">Dan Mange</a> for the munin scripts.</p>
]]></content:encoded>
			<wfw:commentRss>http://jetpackweb.com/blog/2009/09/29/munin-graphs-for-phusion-passenger-a-k-a-mod_rails/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Clean Webalizer Referrer Stats in cPanel</title>
		<link>http://jetpackweb.com/blog/2009/09/21/clean-webalizer-referrer-stats-in-cpanel/</link>
		<comments>http://jetpackweb.com/blog/2009/09/21/clean-webalizer-referrer-stats-in-cpanel/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 17:35:42 +0000</pubDate>
		<dc:creator>Brian Racer</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[cpanel]]></category>

		<guid isPermaLink="false">http://jetpackweb.com/blog/?p=394</guid>
		<description><![CDATA[I find it useful to override some of cPanel&#8217;s default webalizer configurations. There can be a lot of misleading or unnecessary data when you don&#8217;t ignore traffic that is being referred to from your own site. Create the following file: vi /home/username/tmp/webalizer/webalizer.conf HideSite *example.com HideSite localhost HideReferrer example.com/ MangleAgents 4 &#160; TopSites 10 TopKSites 10 [...]]]></description>
			<content:encoded><![CDATA[<p>I find it useful to override some of cPanel&#8217;s default webalizer configurations. There can be a lot of misleading or unnecessary data when you don&#8217;t ignore traffic that is being referred to from your own site.</p>
<p>Create the following file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">vi</span> <span class="sy0">/</span>home<span class="sy0">/</span>username<span class="sy0">/</span>tmp<span class="sy0">/</span>webalizer<span class="sy0">/</span>webalizer.conf</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text">HideSite *example.com
HideSite localhost
HideReferrer example.com/
MangleAgents 4
&nbsp;
TopSites        10
TopKSites       10
TopURLs         10
TopKURLs        50
TopReferrers    250
TopAgents       15
TopCountries    10
TopEntry        10
TopExit         10
TopSearch       20
TopUsers        20
&nbsp;
# Usually you want to hide these
HideURL         *.gif
HideURL         *.GIF
HideURL         *.jpg
HideURL         *.JPG
HideURL         *.png
HideURL         *.PNG
HideURL         *.bmp
HideURL         *.BMP</pre></div></div>

<p>Replace <strong>example.com</strong> with the domain you are working on. The next time webalizer runs it will not be clogged with useless referrers generated by your site. To force webalizer to run(in a cPanel environment), execute:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="sy0">/</span>scripts<span class="sy0">/</span>runweblogs username</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://jetpackweb.com/blog/2009/09/21/clean-webalizer-referrer-stats-in-cpanel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Install Phusion Passenger (a.k.a. mod_rails) on cPanel Server</title>
		<link>http://jetpackweb.com/blog/2009/07/21/install-phusion-passenger-a-k-a-mod_rails-on-cpanel-server/</link>
		<comments>http://jetpackweb.com/blog/2009/07/21/install-phusion-passenger-a-k-a-mod_rails-on-cpanel-server/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 18:06:56 +0000</pubDate>
		<dc:creator>Brian Racer</dc:creator>
				<category><![CDATA[cpanel]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[passenger]]></category>

		<guid isPermaLink="false">http://jetpackweb.com/blog/?p=129</guid>
		<description><![CDATA[Although cPanel has built in support for running Ruby or Rails apps, it uses Mongrel as the server and doesn&#8217;t allow more than one instance per user. That makes it pretty useless for any application that gets even a moderate amount of traffic. Instead we can install]]></description>
			<content:encoded><![CDATA[<p>Although cPanel has built in support for running Ruby or Rails apps, it uses <a href="http://mongrel.rubyforge.org/" target="_blank">Mongrel</a> as the server and doesn&#8217;t allow more than one instance per user. That makes it pretty useless for any application that gets even a moderate amount of traffic. Instead we can install <a href="http://www.modrails.com/" target=_blank" />Phusion Passenger</a> (a.k.a mod_rails), which in my opinion is a much nicer solution anyway.</p>
<p>First we need to make sure Ruby is installed via a cpanel script:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">sudo</span> <span class="sy0">/</span>script<span class="sy0">/</span>installruby</pre></div></div>

<p>Now we can install the passenger gem:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">sudo</span> gem <span class="kw2">install</span> passenger</pre></div></div>

<p>Next, compile the apache2 module</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">sudo</span> passenger-install-apache2-module</pre></div></div>

<p>The installer may tell you that the the Apache development headers are needed and will suggest &#8216;yum install httpd-devel&#8217;. Since cPanel compiles it&#8217;s own version of apache, yum is configured to ignore that package. That is OK, because the program we need is already installed, we just have to tell Passenger where to find it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="re2">APXS2</span>=<span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>apache<span class="sy0">/</span>bin<span class="sy0">/</span>apxs <span class="re2">PATH</span>=<span class="re1">$PATH</span>:<span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>apache<span class="sy0">/</span>bin passenger-install-apache2-module</pre></div></div>

<p>Everything should go OK this time, and the installer will give you a few lines to add to your apache config file. It&#8217;s best practice with cPanel not to put these in your main httpd.conf, but rather the pre_main_global.conf:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">vi</span> <span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>apache<span class="sy0">/</span>conf<span class="sy0">/</span>includes<span class="sy0">/</span>pre_main_global.conf
&nbsp;
LoadModule passenger_module <span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>ruby<span class="sy0">/</span>gems<span class="sy0">/</span><span class="nu0">1.8</span><span class="sy0">/</span>gems<span class="sy0">/</span>passenger-X.X.X<span class="sy0">/</span>ext<span class="sy0">/</span>apache2<span class="sy0">/</span>mod_passenger.so
PassengerRoot <span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>ruby<span class="sy0">/</span>gems<span class="sy0">/</span><span class="nu0">1.8</span><span class="sy0">/</span>gems<span class="sy0">/</span>passenger-X.X.X
PassengerRuby <span class="sy0">/</span>usr<span class="sy0">/</span>bin<span class="sy0">/</span>ruby</pre></div></div>

<p>Now we need to setup passenger to run on a per virtual host basis. Open up the httpd.conf file and find the virtual host you want to run a Rails app and add this line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash">Include <span class="st0">&quot;/usr/local/apache/conf/userdata/std/2/username/domain_name/*.conf&quot;</span></pre></div></div>

<p>Replace <i>username</i> with the username of the account.</p>
<p>Now we need to create the directory we just specified, and also create a configuration file letting passenger know it should load for this host:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">mkdir</span> <span class="re5">-p</span> <span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>apache<span class="sy0">/</span>conf<span class="sy0">/</span>userdata<span class="sy0">/</span>std<span class="sy0">/</span><span class="nu0">2</span><span class="sy0">/</span>username<span class="sy0">/</span>domain_name<span class="sy0">/</span>
<span class="kw2">vi</span> <span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>apache<span class="sy0">/</span>conf<span class="sy0">/</span>userdata<span class="sy0">/</span>std<span class="sy0">/</span><span class="nu0">2</span><span class="sy0">/</span>username<span class="sy0">/</span>domain_name<span class="sy0">/</span>rails.conf
&nbsp;
RailsBaseURI <span class="sy0">/</span></pre></div></div>

<p>To make sure those files load, run this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="sy0">/</span>scripts<span class="sy0">/</span>ensure_vhost_includes <span class="re5">--user</span>=username</pre></div></div>

<p>We need to make sure cPanel records the changes we have for when it rebuilds those files, so run the following two commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>cpanel<span class="sy0">/</span>bin<span class="sy0">/</span>apache_conf_distiller <span class="re5">--update</span>
<span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>cpanel<span class="sy0">/</span>bin<span class="sy0">/</span>build_apache_conf</pre></div></div>

<p>We can now restart apache:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>httpd restart</pre></div></div>

<p>Since by default the Apache Document Root for each host is /home/username/public_html, you will probably need to symlink that to your applications public directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">ln</span> <span class="re5">-s</span> <span class="sy0">/</span>home<span class="sy0">/</span>username<span class="sy0">/</span>railsapp<span class="sy0">/</span>public <span class="sy0">/</span>home<span class="sy0">/</span>username<span class="sy0">/</span>public_html</pre></div></div>

<p>To restart that application, you just need to touch the restart.txt file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">touch</span> <span class="sy0">/</span>home<span class="sy0">/</span>username<span class="sy0">/</span>railsapp<span class="sy0">/</span>tmp<span class="sy0">/</span>restart.txt</pre></div></div>

<p>And there you have it, a working high performance rail application server on cPanel! For more information on tuning the Passenger configuration, read the <a href="http://www.modrails.com/documentation/Users%20guide%20Apache.html" target="_blank">complete docs</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jetpackweb.com/blog/2009/07/21/install-phusion-passenger-a-k-a-mod_rails-on-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>How to fix Munin&#8217;s MySQL Graph on cPanel</title>
		<link>http://jetpackweb.com/blog/2009/07/16/how-to-fix-munins-mysql-graph-on-cpanel/</link>
		<comments>http://jetpackweb.com/blog/2009/07/16/how-to-fix-munins-mysql-graph-on-cpanel/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 16:54:51 +0000</pubDate>
		<dc:creator>Brian Racer</dc:creator>
				<category><![CDATA[cpanel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[munin]]></category>

		<guid isPermaLink="false">http://jetpackweb.com/blog/?p=105</guid>
		<description><![CDATA[We have a few cPanel servers deployed and to visually monitor performance we use the Munin monitoring tool. We were having issues where the MySQL graphs would stop updating. The bug has to do with one of the perl libraries the script uses, which causes the MySQL plugin to have problems location the mysqladmin program. [...]]]></description>
			<content:encoded><![CDATA[<p>We have a few cPanel servers deployed and to visually monitor performance we use the Munin monitoring tool. We were having issues where the MySQL graphs would stop updating. The bug has to do with one of the perl libraries the script uses, which causes the MySQL plugin to have problems location the <b>mysqladmin</b> program.</p>
<p>To fix these, create or edit the following file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">vi</span> <span class="sy0">/</span>etc<span class="sy0">/</span>munin<span class="sy0">/</span>plugin-conf.d<span class="sy0">/</span>cpanel.conf</pre></div></div>

<p>It should contain the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="br0">&#91;</span>mysql<span class="sy0">*</span><span class="br0">&#93;</span>
user root
group wheel
env.mysqladmin <span class="sy0">/</span>usr<span class="sy0">/</span>bin<span class="sy0">/</span>mysqladmin
env.mysqlopts <span class="re5">--defaults-extra-file</span>=<span class="sy0">/</span>root<span class="sy0">/</span>.my.cnf</pre></div></div>

<p>This would load the username and password from root&#8217;s mysql config. If that file doesn&#8217;t exist you can create it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">sudo</span> <span class="kw2">vi</span> <span class="sy0">/</span>root<span class="sy0">/</span>.my.cnf</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash"><span class="br0">&#91;</span>client<span class="br0">&#93;</span>
<span class="re2">user</span>=<span class="st0">&quot;root&quot;</span>
<span class="re2">pass</span>=<span class="st0">&quot;secret!password&quot;</span></pre></div></div>

<p>Now just restart Munin, wait a a little bit, and the graphs should start populating again!</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw2">sudo</span> <span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>munin-node restart</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://jetpackweb.com/blog/2009/07/16/how-to-fix-munins-mysql-graph-on-cpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

