<?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>ASP.NET MSSQL Webhosting Blog &#187; RRDTool</title>
	<atom:link href="http://www.mywebhostingblog.net/tag/rrdtool/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mywebhostingblog.net</link>
	<description>ASP.NET, MSSQL and Windows dedicated server articles</description>
	<lastBuildDate>Tue, 10 Nov 2009 19:53:03 +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>Monitoring IIS Web Server with Logparser and the RRDtool</title>
		<link>http://www.mywebhostingblog.net/hosting-security/monitoring-iis-web-server-with-logparser-and-the-rrdtool/</link>
		<comments>http://www.mywebhostingblog.net/hosting-security/monitoring-iis-web-server-with-logparser-and-the-rrdtool/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 15:03:04 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Hosting Security]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Window Hosting]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Graph]]></category>
		<category><![CDATA[IIS Web Server]]></category>
		<category><![CDATA[logparser]]></category>
		<category><![CDATA[MRTG]]></category>
		<category><![CDATA[MRTGbundle]]></category>
		<category><![CDATA[RRDTool]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://www.mywebhostingblog.net/?p=67</guid>
		<description><![CDATA[Introduction We read allot of articles on how one can use MRTG as an Intrusion detection tool or to creating traffic graph for a particular network subnet or a single IP address on Linux platform with Apache web server. But we find very few that allow us to have graphs on Windows Dedicated server with [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>We read allot of articles on how one can use <strong>MRTG</strong> as an Intrusion detection <strong>tool </strong>or to creating<strong> traffic graph </strong>for a particular network subnet or a single IP address on<strong> Linux platform</strong> with <strong>Apache web server</strong>. But we find very few that allow us to have graphs on<strong> Windows</strong> <strong>Dedicated server </strong>with <strong>IIS Web Server</strong>.</p>
<p>Here are some steps that can be used to create graphs on <strong>Windows Dedicated server</strong> with <strong>IIS </strong>as the <strong>web servers</strong>. And there is no need to take all the efforts to configure <strong>MRTG </strong>as we can simply have graphs with the use of <strong>logparser </strong>and the <strong>RRDtool </strong>from Tobias Oetiker and you can use the <strong>RRDtool </strong>perfectly without the rest of <strong>MRTG</strong>.</p>
<p><span id="more-67"></span></p>
<p><strong>Logparser</strong></p>
<p><strong>Logparser </strong>is a great free tool from <strong>Microsoft</strong>. It is written by Gabriele Giuseppini a Software Design Engineer from the test department. The first version of <strong>logparser </strong>was an internal testing tool inside <strong>Microsoft</strong>. Version 2 was made publicly available at the website, version 2.1 was a part of the <strong>IIS resource tools kit </strong>and version 2.2 was made available in January 2005.</p>
<p><strong>Here is a brief introduction how logparser works:</strong></p>
<p>Logparser need three things, an input format, an output format and a sort of <strong>SQL query</strong>. The <strong>SQL query</strong> is a dialect of <strong>SQL</strong>.</p>
<p>There are few very interesting articles on Microsoft’s website, one written by the Author himself:<br />
<a title="Details on how to use LogParser" href="http://www.microsoft.com/technet/community/columns/profwin/pw0505.mspx"><strong>How to use Logparser</strong></a><br />
<a title="Another link on &quot;How to use Logparser&quot;" href="http://www.microsoft.com/technet/community/columns/scripts/sg0105.mspx"><strong>Another one from Scripting Guys:</strong></a></p>
<p>The article from the scripting guys shows you how to use the logparser directly in a script with a com object.</p>
<p>You can download Logparser from the link below:<br />
<a title="Download LogParser" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;displaylang=en"><strong>DOWNLOAD LOAGPARSER</strong></a></p>
<p>The above download has portable help file in the application directory. This help file give you the parameters of all the properties of the <strong>logparser</strong>.<br />
There is also an unofficial website specially for logparser:<br />
www.logparser.com</p>
<p><strong>About RRDtool.</strong></p>
<p><strong>What is the RRDtool:</strong></p>
<p>The <strong>RRDtool </strong>or <strong>Round Robin Database tool</strong> is a tool that can store date in a <strong>database </strong>and create graphs with it. The really great thing about <strong>RDDTool </strong>is that the database does not growing. It will stay almost the same size as when it was created.</p>
<p>On the RRD website<br />
<a title="RRDTool Official Website" href="http://www.people.ee.ethz.ch/~oetiker/webtools/rrdtool/index.en.html"><strong>RRDTool Website</strong></a><br />
there are some really good <strong>tutorials</strong>, and it is recommended to read them before you use the <strong>RRDtool</strong>.<br />
From this website you can also download the <strong>RRDtool</strong>, the only problem is that you need to compile it but if you download it with the <strong>MRTGbundle </strong>from the link below, it has a completed version of the <strong>RRDtool </strong>in the packet. If you unpack the MRTGbundle, you can copy the RRDtool directory to your scripting directory or your application directory and start using it.<br />
<a title="Compiled version of RRDTool" href="http://www.openinnovations.com/mrtgbundle.html"><strong>DOWNLOAD RDDTool Compiled Version</strong></a></p>
<p><strong>Create Database.</strong></p>
<p>Before you can use the <strong>RRDtool </strong>you need to create the database.<br />
The link below has all the information on how and why to create a database along with the parameters.<br />
<a title="How and why to create a database" href="http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/tut/rrdtutorial.en.html"><strong>How to create a database</strong></a><br />
<strong><a title="This link defines its parameters." href="http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/doc/rrdcreate.en.html">Parameters</a></strong></p>
<p>You can also use a script to do that.</p>
<p><code><br />
‘#start script.<br />
Set WshShell = WScript.CreateObject("WScript.Shell")<br />
strCMD = ".binrrdtool.exe create Eservicing.rrd"<br />
strCMD = strCMD &amp; " --start N "<br />
strCMD = strCMD &amp; " -s 300"<br />
strCMD = strCMD &amp; " DS:Hits:GAUGE:600:0:2000000"<br />
strCMD = strCMD &amp; " DS:Error400:GAUGE:600:0:2000000"<br />
strCMD = strCMD &amp; " DS:Error500:GAUGE:600:0:2000000"<br />
strCMD = strCMD &amp; " RRA:AVERAGE:0.5:1:288"<br />
strCMD = strCMD &amp; " RRA:AVERAGE:0.5:2:2016"<br />
strCMD = strCMD &amp; " RRA:AVERAGE:0.5:4:2232"<br />
strCMD = strCMD &amp; " RRA:AVERAGE:0.5:12:8760"</code></p>
<p>WshShell.Run strCMD<br />
‘#end script.</p>
<p>Here is an explanation of every command in the script:</p>
<p><code>Set WshShell = WScript.CreateObject("WScript.Shell")</code><br />
This line create a shell object you need to run the RRDtool .<br />
In the next 10 lines I create the command line that I run in the last line.</p>
<p><code>strCMD = ".binrrdtool.exe create Eservicing.rrd"</code><br />
this starts the RRDtool with the create function and give the name of the database.</p>
<p><code>strCMD = strCMD &amp; " --start N "</code><br />
&#8211;start set the start time of the database and N is the current time. The RRDtool works with Unixtime, this are the seconds from 1 January 1970.</p>
<p><code>strCMD = strCMD &amp; " -s 300"</code><br />
-s is the seconds between a database update.</p>
<p><code>strCMD = strCMD &amp; " DS:Hits:GAUGE:600:0:2000000"<br />
strCMD = strCMD &amp; " DS:Error400:GAUGE:600:0:2000000"<br />
strCMD = strCMD &amp; " DS:Error500:GAUGE:600:0:2000000"</code><br />
with this three lines I create three data sources. DS stands for data source, Hits is the name of the data source GAUGE is one of the four type’s of data sources, 600 are the seconds between the records if there is no input after 600 the value is NULL, 0 is the minimum value of the record and 200000 is the maximum value.</p>
<p><code>strCMD = strCMD &amp; " RRA:AVERAGE:0.5:1:288"<br />
strCMD = strCMD &amp; " RRA:AVERAGE:0.5:2:2016"<br />
strCMD = strCMD &amp; " RRA:AVERAGE:0.5:4:2232"<br />
strCMD = strCMD &amp; " RRA:AVERAGE:0.5:12:8760"</code><br />
this four lines create four Round Robin Archives. RRA stands for Round Robin Archive, AVERAGE is one of the four consolidation functions, 0.5 is the consolidation interval, 1 is the number of data sources that are consolidate in one record in the Round Robin Archive. If every 600 seconds a DS is created and the value is 4 instead of 1 every 2400 seconds there will be a record add to the archive, the last value is the number of records the archive contains.<br />
The first line create a Round Robin Archive with a consolidation interval of 0.5. every data source gets a record in the archive and the archive is 288 records long.</p>
<p><code>WshShell.Run strCMD</code><br />
And with this line the command is executed.</p>
<p><strong>Update database.</strong></p>
<p>With the next script we use logparser to evaluate the logfile from a IIS server. We can run this script every 5 minutes. To write the results in RRD database.</p>
<p><code>‘#start script<br />
Const ForReading = 1, ForWriting = 2, ForAppending = 8<br />
'-------------------------------------------------------------------------<br />
LogDir = "serverd$logsyswwwsiteW3SVC1"<br />
Set WSHShell = CreateObject("Wscript.Shell")<br />
Set fso = CreateObject("Scripting.FileSystemObject")<br />
Set objLogParser = CreateObject("MSUtil.LogQuery")<br />
Set objDictIISlogslist = CreateObject("Scripting.Dictionary")</code></p>
<p>Dim strDate<br />
Dim count<br />
Error400 = 0<br />
Error500 = 0<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Main<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Sub Main<br />
Call MakeStrDate<br />
Call GetUniqueHits<br />
Call GetStatus<br />
Call UpdateRRD<br />
End Sub<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8216; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Sub MakeStrDate<br />
strMonth = Month(Now)<br />
If Len(strMonth) = 1 Then<br />
strMonth = &#8220;0&#8243; &amp; CStr(strMonth)<br />
End If<br />
strDay = Day(Now)<br />
If Len(strDay) = 1 Then<br />
strDay = &#8220;0&#8243; &amp; CStr(strDay)<br />
End If<br />
strYear =Right(Year(Now),2)<br />
strDate = strYear &amp; strMonth &amp; strDay<br />
End Sub<br />
&#8216; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Sub GetUniqueHits<br />
Set objInputFormat = CreateObject(&#8220;MSUtil.LogQuery.IISW3CInputFormat&#8221;)<br />
objInputFormat.recurse = -1<br />
objInputFormat.iCheckPoint = strDate &amp; &#8220;.lpc&#8221;<br />
strQuery = &#8220;SELECT count(*) as UniqueHits FROM &#8216;&#8221; &amp; _<br />
LogDir &amp; &#8220;ex&#8221; &amp; strDate &amp; &#8220;.log&#8217;&#8221;<br />
Set objRecordSet = objLogParser.Execute(strQuery, objInputFormat)<br />
Do While Not objRecordSet.AtEnd<br />
Set objRecord = objRecordSet.GetRecord<br />
count = objRecord.GetValue(&#8220;UniqueHits&#8221;)<br />
objRecordSet.MoveNext<br />
Loop<br />
End Sub<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Sub GetStatus<br />
Set objInputFormat = CreateObject(&#8220;MSUtil.LogQuery.IISW3CInputFormat&#8221;)<br />
objInputFormat.recurse = -1<br />
objInputFormat.iCheckPoint = strDate &amp; &#8220;Error.lpc&#8221;<br />
strQuery = &#8220;SELECT sc-status , COUNT(*) as Hits FROM &#8216;&#8221; &amp; LogDir &amp; &#8220;ex&#8221; &amp; strDate &amp; &#8220;.log&#8217; WHERE sc-status &gt; 399 GROUP BY sc-status ORDER BY Hits DESC&#8221;<br />
Set objRecordSet = objLogParser.Execute(strQuery, objInputFormat)<br />
Do While Not objRecordSet.AtEnd<br />
Set objRecord = objRecordSet.GetRecord<br />
If  objRecord.GetValue(&#8220;sc-status&#8221;) &gt; 399 And objRecord.GetValue(&#8220;sc-status&#8221;) &lt; 500  Then<br />
Error400 = Error400 + objRecord.GetValue(&#8220;Hits&#8221;)<br />
End If<br />
If  objRecord.GetValue(&#8220;sc-status&#8221;) &gt; 499 And objRecord.GetValue(&#8220;sc-status&#8221;) &lt; 600  Then<br />
Error500 = Error500 + objRecord.GetValue(&#8220;Hits&#8221;)<br />
End If<br />
objRecordSet.MoveNext<br />
Loop</p>
<p>End Sub<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Sub UpdateRRD<br />
strRun = &#8220;.binrrdtool update Eservicing.rrd N:&#8221; &amp; count &amp; &#8220;:&#8221; &amp; Error400 &amp; &#8220;:&#8221; &amp; Error500<br />
X = WshShell.Run(strRun,0,True)<br />
End Sub<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
‘#end script</p>
<p>We will not explain this script line by line as it is a pretty simple script.</p>
<p><strong>Creating a Graphic with the RRDtool.</strong></p>
<p>With the next script I create a graphic with the RRDtool.</p>
<p><code>Set WshShell = WScript.CreateObject("WScript.Shell")</code></p>
<p>strCMD = &#8220;.binrrdtool graph .graphintranetNLweek.gif&#8221;<br />
strCMD = strCMD &amp; &#8221; &#8211;start N-1w &#8211;end N&#8221;<br />
strCMD = strCMD &amp; &#8221; &#8211;vertical-label &#8221; &amp; Chr(34) &amp; &#8220;Hits &#8221; &amp; Chr(34)<br />
strCMD = strCMD &amp; &#8221; &#8211;title INTRANET&#8221;<br />
strCMD = strCMD &amp; &#8221; DEF:Xhits=.databaseintranetNL.rrd:Hits:AVERAGE&#8221;<br />
strCMD = strCMD &amp; &#8221; DEF:Xerror400=.databaseintranetNL.rrd:Error400:AVERAGE&#8221;<br />
strCMD = strCMD &amp; &#8221; DEF:Xerror500=.databaseintranetNL.rrd:Error500:AVERAGE&#8221;<br />
strCMD = strCMD &amp; &#8221; LINE2:Xhits#FF0000:&#8221; &amp; Chr(34) &amp; &#8220;Hits&#8221; &amp; Chr(34)<br />
strCMD = strCMD &amp; &#8221; LINE2:Xerror400#00FF00:&#8221; &amp; Chr(34) &amp; &#8220;400 Errors&#8221; &amp; Chr(34)<br />
strCMD = strCMD &amp; &#8221; LINE2:Xerror500#0000FF:&#8221; &amp; Chr(34) &amp; &#8220;500 Errors&#8221; &amp; Chr(34)</p>
<p>WshShell.Run strCMD</p>
<p>You will make a note of 2 important thing in this script:<br />
1.    The DEF line: this line defines the Data Sources you use.<br />
2.    The LINE2: This defines the line in the graphic.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywebhostingblog.net/hosting-security/monitoring-iis-web-server-with-logparser-and-the-rrdtool/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Install RRDTool On Windows Server</title>
		<link>http://www.mywebhostingblog.net/window-hosting/install-rrdtool-on-windows-server/</link>
		<comments>http://www.mywebhostingblog.net/window-hosting/install-rrdtool-on-windows-server/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 13:53:32 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Window Hosting]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[RRDTool]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows Server]]></category>

		<guid isPermaLink="false">http://www.mywebhostingblog.net/?p=63</guid>
		<description><![CDATA[We all have an impressions that it is very difficult to install RRDTool on a Windows Server but that is not the case. There are few very Simple Steps to install RRDTool on a Windows server: STEPS: 1. Create a Folder on any of your drives with name RRDTool. 2. Download the latest version of [...]]]></description>
			<content:encoded><![CDATA[<p>We all have an impressions that it is very difficult to <strong>install</strong> <strong>RRDTool</strong> on a Windows Server but that is not the case. There are few very Simple Steps to install <strong>RRDTool</strong> on a <strong>Windows server</strong>:<strong></strong></p>
<p><strong>STEPS:</strong></p>
<p>1. Create a Folder on any of your drives with name <strong>RRDTool</strong>.</p>
<p>2. Download the latest version of RRDTool from the link below:</p>
<p><a title="Link To Download RRDTool" href="http://www.cacti.net/downloads/rrdtool/win32/" target="_blank"><strong>DOWNLOAD RRDTool</strong></a></p>
<p>3. Extract the ZIP in RRDTool folder.</p>
<p>4. Open START &gt;&gt; Run &gt;&gt; type <strong>cmd</strong> to open Windows command prompt.</p>
<p>5. Type following command on prompt to use the RRDTool.</p>
<p><strong>cd C:\RRDTool\</strong></p>
<p><strong>That is it&#8230;!!!! </strong>You are ready to use your RRDTool on your <strong>Windows machine</strong>.</p>
<p>These steps are applicable to all <strong>Windows versions</strong> including <strong>Windows XP, Windows Vista, Windows NT and Winsdows 2003/2008 Servers.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywebhostingblog.net/window-hosting/install-rrdtool-on-windows-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Monitoring Bandwidth usage with SNMP and RRDtool for Linux</title>
		<link>http://www.mywebhostingblog.net/hosting-linux/monitoring-bandwidth-usage-with-snmp-and-rrdtool-for-linux/</link>
		<comments>http://www.mywebhostingblog.net/hosting-linux/monitoring-bandwidth-usage-with-snmp-and-rrdtool-for-linux/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 20:52:43 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Linux Server Hosting]]></category>
		<category><![CDATA[Bandwidth]]></category>
		<category><![CDATA[Monitor]]></category>
		<category><![CDATA[net-snmp]]></category>
		<category><![CDATA[RRDTool]]></category>
		<category><![CDATA[SNMP]]></category>

		<guid isPermaLink="false">http://www.mywebhostingblog.net/?p=27</guid>
		<description><![CDATA[Before monitor any server you need to install SNMP and RRDTool packages on monitor server and net-snmp package on server which you want to monitor. lets assume server which has SNMP and RRDTool means monitor server has ip address 10.10.10.1 and server which you want to monitor has IP address 99.99.99.99 SNMP Installation SNMP packages [...]]]></description>
			<content:encoded><![CDATA[<p>Before monitor any server you need to install SNMP and RRDTool packages on monitor server and net-snmp package on server which you want to monitor.</p>
<p>lets assume server which has SNMP and RRDTool means monitor server has ip address 10.10.10.1<br />
and server which you want to monitor has IP address 99.99.99.99</p>
<p><strong>SNMP Installation</strong><br />
SNMP packages require for querring .</p>
<p>- type command at the prompt<br />
#yum search snmp<br />
It will show you different snmp packages.<br />
You neet to install 2 packages<br />
net-snmp<br />
net-snmp-devel<br />
type command<br />
#yum install net-snmp<br />
#yum install net-snmp-devel</p>
<p><strong>RRDTool Installation</strong></p>
<p>RRD store and display time-series data (i.e. network bandwidth, server load average). It stores the data in a very compact way that will not expand over time, and it presents useful graphs by processing the data to enforce a certain data density.</p>
<p>RRDTool 1.2.x has dependancies ,hence you need to install following packages.</p>
<p>* libart_lgpl-2.3.11-2.i386.rpm<br />
* <a title="Download RPM" href="ftp://rpmfind.net/linux/ASPLinux/i386/RPMS.9/libart_lgpl-devel-2.3.11-2.i386.rpm" target="_blank">libart_lgpl-devel-2.3.11-2.i386.rpm</a></p>
<p><span id="more-27"></span><br />
* freetype-2.1.3-6.i386.rpm<br />
* freetype-devel-2.1.3-6.i386.rpm<br />
* zlib-1.1.4-8.i386.rpm<br />
* zlib-devel-1.1.4-8.i386.rpm<br />
* libpng-1.2.2-16.i386.rpm<br />
* libpng-devel-1.2.2-16.i386.rpm</p>
<p>Download RRDTool from <a href="http://ftp.idilis.ro/mirrors/rrdtool/">http://ftp.idilis.ro/mirrors/rrdtool/</a></p>
<p>lets assume you have rrdtool-1.2.12.tar.gz</p>
<p>To extract RRDTool run this command:</p>
<p>#tar -xzvf rrdtool-1.2.12.tar.gz</p>
<p>then change directory:<br />
#cd rrdtool-1.2.12</p>
<p>to compile ans install RRDTool type:<br />
#./configure &#8211;disable-tcl<br />
#make<br />
#make install</p>
<p><strong>Apply following step on server which you want to monitor means 99.99.99.99</strong><br />
Install net-snmp<br />
Type following commands<br />
#yum search snmp<br />
#yum install net-snmp</p>
<p>then edit snmpd.conf file and create readonly community<br />
#vi /etc/snmp/snmpd.conf</p>
<p>add following line in snmpd.conf file<br />
rocommunity  community_name ip_address_of_monitor_server</p>
<p>start snmpd service<br />
/etc/init.d/snmpd start</p>
<p><strong>Apply following step on monitor server means 10.10.10.1</strong><br />
To monitor bandwidth you need to create RRD file,which will store bandwidth data.</p>
<p><strong>step 1</strong><br />
Create RRD file.<br />
rrdtool create bandwidth.rrd -s 60 \<br />
DS:in:COUNTER:300:U:U \<br />
DS:out:COUNTER:300:U:U \<br />
RRA:AVERAGE:0.5:1:10080</p>
<p><strong>step 2</strong><br />
Update RRD file.</p>
<p>/usr/bin/rrdupdate bandwidth.rrd \<br />
N:`/usr/bin/snmpget -v 1 -c community_name -Oqv 9.99.99.99 IF-MIB::ifInOctets.2`: \<br />
`/usr/bin/snmpget -v 1 -c community_name -Oqv 99.99.99.99 IF-MIB::ifOutOctets.2`</p>
<p>Above command should be run with 1 or 5 minute interval as per your need,hence add above command in cronjob.</p>
<p><strong>step 3</strong><br />
Generate graph from bandwidth.rrd file</p>
<p>rrdtool graph bandwidth.png \<br />
&#8211;end now &#8211;start end-30h &#8211;width 400 \<br />
&#8211;x-grid HOUR:1:HOUR:6:HOUR:2:0:%H \<br />
&#8211;imgformat=PNG \<br />
&#8211;title=&#8221;your title&#8221; \<br />
&#8211;rigid \<br />
&#8211;base=1000 \<br />
&#8211;height=120 \<br />
&#8211;width=500 \<br />
&#8211;alt-autoscale-max \<br />
&#8211;lower-limit=0 \<br />
&#8211;vertical-label=&#8221;bits per second&#8221; \<br />
DEF:a=bandwidth.rrd:in:AVERAGE \<br />
DEF:b=bandwidth.rrd:out:AVERAGE \<br />
VDEF:totin=a,TOTAL \<br />
VDEF:totout=b,TOTAL \<br />
CDEF:cdefa=a,8,* \<br />
CDEF:cdeff=b,8,* \<br />
AREA:cdefa#00CF00:&#8221;Incoming&#8221;  \<br />
GPRINT:cdefa:LAST:&#8221;Cur\:%6.2lf %sb/s&#8221;  \<br />
GPRINT:cdefa:AVERAGE:&#8221;Avg\:%6.2lf %sb/s&#8221;  \<br />
GPRINT:cdefa:MAX:&#8221;Max\:%6.2lf %sb/s&#8221;  \<br />
GPRINT:cdefa:MIN:&#8221;MIN\:%6.2lf %sb/s\l&#8221;  \<br />
LINE1.3:cdeff#0000FF:&#8221;Outgoing&#8221;  \<br />
GPRINT:cdeff:LAST:&#8221;Cur\:%6.2lf %sb/s&#8221;  \<br />
GPRINT:cdeff:AVERAGE:&#8221;Avg\:%6.2lf %sb/s&#8221;  \<br />
GPRINT:cdeff:MAX:&#8221;Max\:%6.2lf %sb/s&#8221;  \<br />
GPRINT:cdeff:MIN:&#8221;MIN\:%6.2lf %sb/s\l&#8221;  \<br />
GPRINT:totin:&#8221;Total IN\:%6.2lf %sb/s&#8221;  \<br />
GPRINT:totout:&#8221;Total OUT\:%6.2lf %sb/s&#8221;  \<br />
VRULE:1084777200#FF0000:&#8221;"</p>
<p>After firing  above command, a file bandwidth.png will be in current direcoty which is bandwidth graph for server 99.99.99.99</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywebhostingblog.net/hosting-linux/monitoring-bandwidth-usage-with-snmp-and-rrdtool-for-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
