<?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>RedHatVN Network &#187; mrtg</title>
	<atom:link href="http://redhatvn.net/tag/mrtg/feed" rel="self" type="application/rss+xml" />
	<link>http://redhatvn.net</link>
	<description>Shared Linux problems</description>
	<lastBuildDate>Mon, 31 Oct 2011 07:10:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Centos Install and Configure MRTG</title>
		<link>http://redhatvn.net/centos-install-and-configure-mrtg</link>
		<comments>http://redhatvn.net/centos-install-and-configure-mrtg#comments</comments>
		<pubDate>Tue, 04 Aug 2009 12:00:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mrtg]]></category>

		<guid isPermaLink="false">http://redhatvn.net/blog/?p=75</guid>
		<description><![CDATA[How do I install and configure MRTG under Fedora Linux or CentOS Linux v5.x server to monitor the traffic load on network-links including routers? The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network-links. MRTG generates HTML pages containing PNG images which provide a LIVE visual representation of this [...]]]></description>
			<content:encoded><![CDATA[<div class="google_plus_one"><g:plusone size="medium" count="true" url="http://redhatvn.net/centos-install-and-configure-mrtg"></g:plusone></div><p><span>H</span>ow do I install and configure MRTG under Fedora Linux or CentOS Linux v5.x server to monitor the traffic load on network-links including routers?</p>
<p>The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network-links.</p>
<div style="float: right; margin-top: 0px; margin-left: 5px;"><a title="See all Fedora Linux related FAQ" href="http://www.cyberciti.biz/faq/category/fedora-linux/"><img src="http://c.cyberciti.biz/cbzcache/3rdparty/fedora-logo.png" border="0" alt="" /></a></div>
<p>MRTG generates HTML pages containing PNG images which provide a LIVE visual representation of this traffic. You need the following packages:</p>
<ul>
<li><strong>mrtg</strong> : Multi Router Traffic Grapher</li>
<li><strong>net-snmp</strong> and <strong>net-snmp-utils</strong> : SNMP (Simple Network Management Protocol) is a protocol used for network management. The NET-SNMP project includes various SNMP tools. net-snmp package contains the snmpd and snmptrapd daemons, documentation, etc. You also want to install the net-snmp-utils package, which contains NET-SNMP utilities.</li>
</ul>
<p>This FAQ works with RHEL / CentOS and Fedora Linux.</p>
<h2><span id="more-75"></span>Step # 1: Install MRTG</h2>
<p>Type the following command to install packages using <a href="http://www.cyberciti.biz/faq/rhel-centos-fedora-linux-yum-command-howto/">yum command</a> under CentOS / Fedora Linux:<br />
<code># yum install mrtg net-snmp net-snmp-utils</code></p>
<h2>Step # 2: Configure snmpd</h2>
<p>If you need to monitor localhost including interface and other stuff such as CPU, memory etc, configure snmpd. Open /etc/snmpd/snmpd.conf, enter:<br />
<code># vi /etc/snmpd/snmpd.conf</code><br />
Update it as follows to only allow access from localhost:</p>
<blockquote><p>com2sec local     localhost           public<br />
group MyRWGroup v1         local<br />
group MyRWGroup v2c        local<br />
group MyRWGroup usm        local<br />
view all    included  .<span>1</span>                               <span>80</span><br />
access MyRWGroup <span style="color: #993333;">&#8220;&#8221;</span>      any       noauth    exact  all    all    none<br />
syslocation VSNL, India<br />
syscontact Root &lt;vivek@nixcraft.tld&gt;</p></blockquote>
<p>Save and close the file. Restart snmpd:<br />
<code># chkconfig snmpd on<br />
# service snmpd restart</code><br />
Make sure you see interface IP, by running the following command:<br />
<code>#  snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex</code><br />
Sample Outputs:</p>
<blockquote><p>IP-MIB::ipAdEntIfIndex.123.xx.yy.zzz = INTEGER: 2<br />
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1</p></blockquote>
<h3>Step # 3: Configure MRTG</h3>
<p>Use cfgmaker command to creates /etc/mrtg/mrtg.cfg file, enter:<br />
<code># cfgmaker --global 'WorkDir: /var/www/mrtg' --output /etc/mrtg/mrtg.cfg public@localhost</code></p>
<ul>
<li><strong>&#8211;global &#8216;WorkDir: /var/www/mrtg&#8217;</strong> :  add global config entries i.e. set workdir to store MRTG graphs.</li>
<li><strong>&#8211;output /etc/mrtg/mrtg.cfg</strong>: configr output filename</li>
<li><strong>public@localhost</strong> : public is the community name of the device you want to create a configuration for. If you are using the wrong community name you will get no response from the device. localhost is the DNS name or the IP number of an SNMP-managable device i.e. our local server.</li>
</ul>
<p>Finally, run indexmaker to  create web pages which display the status of an array of mrtg interface status pages:<br />
<code># indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg</code></p>
<h3>Step # 4: Verify Cron Job</h3>
<p>/etc/cron.d/mrtg runs mrtg command to  monitor the traffic load on network links:<br />
<code># cat /etc/cron.d/mrtg</code><br />
Sample Output:</p>
<blockquote><p>*/<span style="color: #000000;">5</span> * * * * root <span style="color: #007800;">LANG=</span>C <span style="color: #007800;">LC_ALL=</span>C /usr/bin/mrtg /etc/mrtg/mrtg.cfg &#8211;lock-<span style="color: #c20cb9; font-weight: bold;">file</span> /var/lock/mrtg/mrtg_l &#8211;confcache-<span style="color: #c20cb9; font-weight: bold;">file</span> /var/lib/mrtg/mrtg.ok</p></blockquote>
<p>Just make sure crond is running and you are done with configuration:<br />
<code># <a href="http://www.cyberciti.biz/faq/check-running-services-in-rhel-redhat-fedora-centoslinux/">chkconfig --list crond</a></code><br />
If it is off in run level # 3, just run the following to turn on <a href="http://www.cyberciti.biz/faq/howto-linux-unix-start-restart-cron/">crond service</a>:<br />
<code># chkconfig  crond on<br />
# <a href="http://www.cyberciti.biz/faq/howto-linux-unix-start-restart-cron/">service  crond on</a></code></p>
<h4>How do I view mrtg graphs?</h4>
<p>You need Apache web server to view graphs, simply type the following to install httpd:<br />
<code># yum install httpd<br />
# chkconfig httpd on<br />
# service httpd on</code><br />
Fire a webbrowser and type the url:<br />
<code>http://your-ip.add.ress/mrtg/</p>
<p>http://192.168.1.5/mrtg/</code></p>
<div id="attachment_4569" style="width: 542px;"><a rel="attachment wp-att-4569" href="http://redhatvn.net/?attachment_id=4569"><img title="Sample MRTG Graph" src="http://files.cyberciti.biz/uploads/faq/2009/07/MRTG_Index_Page.png" alt="Fig.01:Sample MRTG Graph" width="532" height="335" /></a>Fig.01:Sample MRTG Graph</div>
]]></content:encoded>
			<wfw:commentRss>http://redhatvn.net/centos-install-and-configure-mrtg/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
