<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-81071254749765631</id><updated>2009-09-29T08:25:45.357-07:00</updated><title type='text'>Development &amp; Technical Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sagarbirari.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/81071254749765631/posts/default'/><link rel='alternate' type='text/html' href='http://sagarbirari.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>sagar</name><uri>http://www.blogger.com/profile/07861844902725518998</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-81071254749765631.post-1949588845311154067</id><published>2008-09-29T05:21:00.000-07:00</published><updated>2008-09-29T05:22:16.023-07:00</updated><title type='text'>HOW to install java on Linux</title><content type='html'>&lt;p&gt;Download the JDK from  &lt;a href="http://java.sun.com/j2se/1.5.0/download.jsp"&gt;http://java.sun.com/j2se/1.5.0/download.jsp&lt;/a&gt;&lt;br /&gt;(A)  install jdk by running the RPM or bin file.&lt;/p&gt; &lt;p&gt;Installation Instructions&lt;/p&gt; &lt;p&gt;Install formats - JDK 5.0 is available in two installation formats.&lt;/p&gt; &lt;ul&gt;&lt;li&gt; &lt;strong&gt;Self-extracting Binary File&lt;/strong&gt; - This file can be used to install the JDK in a location chosen by the user. This one can be installed by anyone (not only root users), and it can easily be installed in any location. As long as you are not root user, it cannot displace the system version of the Java platform suppled by Linux. To use this file, see Installation of Self-Extracting Binary below.&lt;/li&gt;&lt;/ul&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt; RPM Packages&lt;/strong&gt; - A rpm.bin file containing RPM packages, installed with the rpm utility. Requires root access to install, and installs by default in a location that replaces the system version of the Java platform supplied by Linux. To use this bundle, see Installation of RPM File below.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Choose the install format that is most suitable to your needs.&lt;/p&gt; &lt;p&gt;Note: For any text on this page containing the following notation, you must substitute the appropriate JDK update version number for the notation.&lt;/p&gt; &lt;p&gt;&lt;version&gt;&lt;/p&gt; &lt;p&gt;For example, if you are downloading update 1.5.0_01, the following command:&lt;/p&gt; &lt;p&gt;]# ./jdk-1_5_0_&lt;version&gt;-linux-i586.bin&lt;/p&gt; &lt;p&gt;would become:&lt;/p&gt; &lt;p&gt;]# ./jdk-1_5_0_01-linux-i586.bin&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Installation of Self-Extracting Binary&lt;/strong&gt;&lt;br /&gt;Use these instructions if you want to use the self-extracting binary file to install the JDK.&lt;/p&gt; &lt;p&gt;1. Download and check the download file size to ensure that you have downloaded the full, uncorrupted software bundle.You can download to any directory you choose; it does not have to be the directory where you want to install the JDK.&lt;/p&gt; &lt;p&gt;Before you download the file, notice its byte size provided on the download page on the web site. Once the download has completed, compare that file size to the size of the downloaded file to make sure they are equal.&lt;/p&gt; &lt;p&gt;2. Make sure that execute permissions are set on the self-extracting binary.&lt;/p&gt; &lt;p&gt;Run this command:&lt;br /&gt;chmod +x jdk-1_5_0_&lt;version&gt;-linux-i586.bin&lt;/p&gt; &lt;p&gt;3. Change directory to the location where you would like the files to be installed.&lt;/p&gt; &lt;p&gt;The next step installs the JDK into the current directory.&lt;/p&gt; &lt;p&gt;4. Run the self-extracting binary.&lt;/p&gt; &lt;p&gt;Execute the downloaded file, prepended by the path to it. For example, if the file is in the current directory, prepend it with “./” (necessary if “.” is not in the PATH environment variable):&lt;/p&gt; &lt;p&gt;]# ./jdk-1_5_0_&lt;version&gt;-linux-i586.bin&lt;/p&gt; &lt;p&gt;The binary code license is displayed, and you are prompted to agree to its terms.&lt;/p&gt; &lt;p&gt;The JDK files are installed in a directory called jdk1.5.0_&lt;version&gt; in the current directory. The JDK documentation is a separate download.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Installation of RPM Packages&lt;/strong&gt;&lt;br /&gt;Use these instructions, If you want to install RPM packages.&lt;/p&gt; &lt;p&gt;1. Download and check the download file size to ensure that you have downloaded the full, uncorrupted software bundle.&lt;/p&gt; &lt;p&gt;Before you download the file, notice its byte size provided on the download page on the web site. Once the download has completed, compare that file size to the size of the downloaded file to make sure they are equal.&lt;/p&gt; &lt;p&gt;2. Make sure that execute permissions are set on the RPM Packages.&lt;/p&gt; &lt;p&gt;Run this command:&lt;br /&gt;chmod +x jdk-1_5_0_&lt;version&gt;-linux-i586-rpm.bin&lt;br /&gt;3. Start the installation process. Type:&lt;br /&gt;]# ./jdk-1_5_0_&lt;version&gt;-linux-i586-rpm.bin&lt;/p&gt; &lt;p&gt;The binary code license is displayed, and you are prompted to agree to its terms.&lt;/p&gt; &lt;p&gt;4. The installation file creates jdk-1_5_0_&lt;version&gt;-linux-i586.rpm file in the current directory.&lt;/p&gt; &lt;p&gt;5. Run the RPM command at the terminal to install the packages. Type:&lt;br /&gt;rpm -iv jdk-1_5_0_&lt;version&gt;-linux-i586.rpm&lt;/p&gt; &lt;p&gt;6. The JDK is installed in jdk-1_5_0_&lt;version&gt; sub-directory under the current directory.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Note about Root Access:&lt;/strong&gt; Unbundling the software automatically creates a directory called jdk1.5.0_&lt;version&gt;. Note that if you choose to install the JDK into system-wide location such as /usr/local, you must first become root to gain the necessary permissions. If you do not have root access, simply install the JDK into your home directory, or a sub directory that you have permission to write to.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Note about Overwriting Files:&lt;/strong&gt; If you unpack the software in a directory that contains a subdirectory named jdk1.5.0_&lt;version&gt;, the new software overwrites files of the same name in that jdk1.5.0_&lt;version&gt; directory. Please be careful to rename the old directory if it contains files you would like to keep.&lt;/p&gt; &lt;p&gt;(B)  Create links for the JDK by entering the following commands:&lt;br /&gt;]# ln -s /usr/java/jdk1.5.0_06 /usr/local/jdk1.5.0_06&lt;br /&gt;]# ln -s /usr/local/jdk1.5.0_06 /usr/local/jdk&lt;/p&gt; &lt;p&gt;(C)  Stack components like JBoss and Tomcat need JAVA_HOME set properly before prior to operation. Create the system files: /etc/profile.d/java.sh and java.csh to export the following environment variables:&lt;br /&gt;JAVA_HOME=/usr/local/jdk&lt;br /&gt;PATH=$JAVA_HOME/bin:$PATH&lt;/p&gt; &lt;p&gt;NOTE:&lt;br /&gt;The shells bash and cshell use a different syntax for setting environment variables.&lt;/p&gt; &lt;p&gt;- For java.sh include the lines:&lt;br /&gt;export JAVA_HOME=/usr/local/jdk&lt;br /&gt;export PATH=$JAVA_HOME/bin:$PATH&lt;/p&gt; &lt;p&gt;- For java.csh include the lines:&lt;br /&gt;setenv JAVA_HOME /usr/local/jdk&lt;br /&gt;setenv PATH $JAVA_HOME/bin:$PATH&lt;/p&gt; &lt;p&gt;You can either use setenv or declare -x to declare the path in .csh file.&lt;br /&gt;If you get any error like bad discriptor after running that .csh file, you can directly declare the path using following command.&lt;br /&gt;]# export PATH=”$PATH:/usr/local/jdk-version”&lt;/p&gt; &lt;p&gt;(D) To verify that the installation was successful, at the prompt enter:&lt;br /&gt;]# java –version&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/81071254749765631-1949588845311154067?l=sagarbirari.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagarbirari.blogspot.com/feeds/1949588845311154067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=81071254749765631&amp;postID=1949588845311154067' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/81071254749765631/posts/default/1949588845311154067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/81071254749765631/posts/default/1949588845311154067'/><link rel='alternate' type='text/html' href='http://sagarbirari.blogspot.com/2008/09/how-to-install-java-on-linux.html' title='HOW to install java on Linux'/><author><name>sagar</name><uri>http://www.blogger.com/profile/07861844902725518998</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12291998442269855416'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-81071254749765631.post-4384562700880305144</id><published>2008-09-29T05:18:00.000-07:00</published><updated>2008-09-29T05:19:34.370-07:00</updated><title type='text'>MySQL Database Indexing</title><content type='html'>&lt;span style="font-weight: bold;"&gt;What is Database Indexing?&lt;/span&gt;&lt;br /&gt;Database index is like data structure that improve the performance of a database.&lt;br /&gt;Index on table can be created one or more column on databse table, which improves random access of any records and efficient access of ordered records.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Types of Indexes in MySql&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. Normal Indexes :-&lt;br /&gt;Normal Index have not restriction like Uniqueness,it is a basic index.&lt;br /&gt;&lt;br /&gt;2. Unique Indexes :–&lt;br /&gt;It is like a Normal index but only one difference, all values of the indexed columns must only occur once.&lt;br /&gt;&lt;br /&gt;3.Primary Keys :-&lt;br /&gt;Primary keys are basically unique index and must be add "PRIMARY KEY" in specific column.&lt;br /&gt;&lt;br /&gt;How to Create Index in Mysql at time of table creation.&lt;br /&gt;&lt;br /&gt;CREATE TABLE student (&lt;br /&gt;    fname VARCHAR(30),&lt;br /&gt;    lname VARCHAR(30),&lt;br /&gt;    studID INT, INDEX (studID)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;You can create index on existing table used following MySQL Statement&lt;br /&gt;&lt;br /&gt;CREATE INDEX index_studID ON student(student)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Advantages of database index&lt;/span&gt;&lt;br /&gt;1. Database indexes speed up the database selection operation.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Advantages of database index&lt;/span&gt;&lt;br /&gt;1. Database indexes slow down the database insert,update,delete operations.&lt;br /&gt;2. Database Index takes more space.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/81071254749765631-4384562700880305144?l=sagarbirari.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagarbirari.blogspot.com/feeds/4384562700880305144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=81071254749765631&amp;postID=4384562700880305144' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/81071254749765631/posts/default/4384562700880305144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/81071254749765631/posts/default/4384562700880305144'/><link rel='alternate' type='text/html' href='http://sagarbirari.blogspot.com/2008/09/mysql-database-indexing.html' title='MySQL Database Indexing'/><author><name>sagar</name><uri>http://www.blogger.com/profile/07861844902725518998</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12291998442269855416'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-81071254749765631.post-6981820751631259319</id><published>2008-09-29T05:13:00.001-07:00</published><updated>2008-09-29T05:16:33.146-07:00</updated><title type='text'>Thread Safety in JSP &amp; Servlet</title><content type='html'>&lt;p&gt;You can thread safe your jsp (java server pages) pages in two ways&lt;/p&gt; &lt;p&gt;&lt;strong&gt;1. By implementing the SingleThreadModel interface.&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;This is done by adding the directive to your jsp page&lt;/p&gt; &lt;p&gt;&lt;%@ page isThreadSafe=”false” %&gt;&lt;/p&gt; &lt;p&gt;Within your jsp page.&lt;/p&gt; &lt;p&gt;When you implement SingleThreadModel interface instead of a single instance of the servlet generated for your jsp page loaded in memory, jsp engine creates new instance of that jsp page for each client request.&lt;br /&gt;but avoid this method because, this methods has some performance issue and there are many pitfalls.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;2. By using synchronized block or synchronized method&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;(a) synchronized block&lt;/strong&gt;&lt;br /&gt;when you expect that more than 2 threads may operate on your code (means om jsp page) and they may inconsistent your data then used synchronized block on particular object&lt;br /&gt;e.g.&lt;/p&gt; &lt;p&gt;import javax.servlet.*;&lt;br /&gt;import javax.servlet.http.*;&lt;br /&gt;import java.math.*;&lt;br /&gt;import java.io.*;&lt;/p&gt; &lt;p&gt;public class testServlet extends HttpServlet&lt;br /&gt;{&lt;br /&gt;//A variable that is NOT thread-safe!&lt;br /&gt;private int cnt = 0;&lt;br /&gt;private String str = “”;&lt;/p&gt; &lt;p&gt;public void doPost(HttpServletRequest req, HttpServletResponse resp)&lt;br /&gt;throws ServletException, IOException&lt;br /&gt;{&lt;br /&gt;resp.getWriter().println(”");&lt;br /&gt;resp.getWriter().println(this + “:&lt;br /&gt;“);&lt;br /&gt;synchronized (str)&lt;br /&gt;{&lt;br /&gt;for (int c = 0; c &lt; counter =" ”"&gt; &lt;p&gt;This string is called a str and is shared among all threads, thus ensure that at time one thread can access code block, if another thread want to enter code block then 1st thread must leave that block.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;(b) Synchronized method&lt;/strong&gt;&lt;br /&gt;A whole method can be synchronized, just you need to add synchronized keyword in method signature.&lt;/p&gt; &lt;p&gt;e.g.&lt;br /&gt;public synchronized void show()&lt;br /&gt;{&lt;br /&gt;// your code&lt;br /&gt;}&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Other precautions &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;To be thread safe in your JSP, do not declared variables in &lt;%! %&gt; tags. variables that declared in declaration tag are not thread safe.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Attributes.&lt;/strong&gt;&lt;br /&gt;Page level attributes are threadsafe.&lt;br /&gt;Request level attributes are threadsafe, as long as you forward in a linear fashion. i.e. forward from servlet to JSP, and ensure that no more code runs in the servlet after forwarding.&lt;br /&gt;Session level attributes: potentially not thread safe if one user makes multiple requests (eg clicks twice on a link/button)&lt;br /&gt;application level attributes: not thread safe at all.&lt;/p&gt; &lt;p&gt;Also consider any resources that you pick up from session attributes/singletons etc as potentially not threadsafe.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/81071254749765631-6981820751631259319?l=sagarbirari.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagarbirari.blogspot.com/feeds/6981820751631259319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=81071254749765631&amp;postID=6981820751631259319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/81071254749765631/posts/default/6981820751631259319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/81071254749765631/posts/default/6981820751631259319'/><link rel='alternate' type='text/html' href='http://sagarbirari.blogspot.com/2008/09/thread-safety-in-jsp-servlet.html' title='Thread Safety in JSP &amp; Servlet'/><author><name>sagar</name><uri>http://www.blogger.com/profile/07861844902725518998</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12291998442269855416'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-81071254749765631.post-8582882341163687455</id><published>2008-09-29T05:03:00.000-07:00</published><updated>2008-09-29T22:57:51.065-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rrdtool'/><category scheme='http://www.blogger.com/atom/ns#' term='rrdupdate'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='snmp'/><category scheme='http://www.blogger.com/atom/ns#' term='CDEF'/><category scheme='http://www.blogger.com/atom/ns#' term='DEF'/><category scheme='http://www.blogger.com/atom/ns#' term='bandwidth.net-snmp'/><title type='text'>Monitoring Bandwidth usage with SNMP and RRDtool for Linux</title><content type='html'>&lt;p&gt;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.&lt;/p&gt; &lt;p&gt;lets assume server which has SNMP and RRDTool means monitor server has ip address 10.10.10.1&lt;br /&gt;and server which you want to monitor has IP address 99.99.99.99&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SNMP Installation&lt;/strong&gt;&lt;br /&gt;SNMP packages require for querring .&lt;/p&gt; &lt;p&gt;- type command at the prompt&lt;br /&gt;#yum search snmp&lt;br /&gt;It will show you different snmp packages.&lt;br /&gt;You neet to install 2 packages&lt;br /&gt;net-snmp&lt;br /&gt;net-snmp-devel&lt;br /&gt;type command&lt;br /&gt;#yum install net-snmp&lt;br /&gt;#yum install net-snmp-devel&lt;/p&gt; &lt;p&gt;&lt;strong&gt;RRDTool Installation&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;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.&lt;/p&gt; &lt;p&gt;RRDTool 1.2.x has dependancies ,hence you need to install following packages.&lt;/p&gt; &lt;p&gt;* libart_lgpl-2.3.11-2.i386.rpm&lt;br /&gt;* libart_lgpl-devel-2.3.11-2.i386.rpm&lt;br /&gt;* freetype-2.1.3-6.i386.rpm&lt;br /&gt;* freetype-devel-2.1.3-6.i386.rpm&lt;br /&gt;* zlib-1.1.4-8.i386.rpm&lt;br /&gt;* zlib-devel-1.1.4-8.i386.rpm&lt;br /&gt;* libpng-1.2.2-16.i386.rpm&lt;br /&gt;* libpng-devel-1.2.2-16.i386.rpm&lt;/p&gt; &lt;p&gt;Download RRDTool from &lt;a href="http://ftp.idilis.ro/mirrors/rrdtool/"&gt;http://ftp.idilis.ro/mirrors/rrdtool/&lt;/a&gt;&lt;/p&gt; &lt;p&gt;lets assume you have rrdtool-1.2.12.tar.gz&lt;/p&gt; &lt;p&gt;To extract RRDTool run this command:&lt;/p&gt; &lt;p&gt;#tar -xzvf rrdtool-1.2.12.tar.gz&lt;/p&gt; &lt;p&gt;then change directory:&lt;br /&gt;#cd rrdtool-1.2.12&lt;/p&gt; &lt;p&gt;to compile ans install RRDTool type:&lt;br /&gt;#./configure –disable-tcl&lt;br /&gt;#make&lt;br /&gt;#make install&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Apply following step on server which you want to monitor means 99.99.99.99&lt;/strong&gt;&lt;br /&gt;Install net-snmp&lt;br /&gt;Type following commands&lt;br /&gt;#yum search snmp&lt;br /&gt;#yum install net-snmp&lt;/p&gt; &lt;p&gt;then edit snmpd.conf file and create readonly community&lt;br /&gt;#vi /etc/snmp/snmpd.conf&lt;/p&gt; &lt;p&gt;add following line in snmpd.conf file&lt;br /&gt;rocommunity  community_name ip_address_of_monitor_server&lt;/p&gt; &lt;p&gt;start snmpd service&lt;br /&gt;/etc/init.d/snmpd start&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Apply following step on monitor server means 10.10.10.1&lt;/strong&gt;&lt;br /&gt;To monitor bandwidth you need to create RRD file,which will store bandwidth data.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;step 1&lt;/strong&gt;&lt;br /&gt;Create RRD file.&lt;br /&gt;rrdtool create bandwidth.rrd -s 60 \&lt;br /&gt;DS:in:COUNTER:300:U:U \&lt;br /&gt;DS:out:COUNTER:300:U:U \&lt;br /&gt;RRA:AVERAGE:0.5:1:10080&lt;/p&gt; &lt;p&gt;&lt;strong&gt;step 2&lt;/strong&gt;&lt;br /&gt;Update RRD file.&lt;/p&gt; &lt;p&gt;/usr/bin/rrdupdate bandwidth.rrd \&lt;br /&gt;N:`/usr/bin/snmpget -v 1 -c community_name -Oqv 9.99.99.99 IF-MIB::ifInOctets.2`: \&lt;br /&gt;`/usr/bin/snmpget -v 1 -c community_name -Oqv 99.99.99.99 IF-MIB::ifOutOctets.2`&lt;/p&gt; &lt;p&gt;Above command should be run with 1 or 5 minute interval as per your need,hence add above command in cronjob.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;step 3&lt;/strong&gt;&lt;br /&gt;Generate graph from bandwidth.rrd file&lt;/p&gt; &lt;p&gt;rrdtool graph bandwidth.png \&lt;br /&gt;–end now –start end-30h –width 400 \&lt;br /&gt;–x-grid HOUR:1:HOUR:6:HOUR:2:0:%H \&lt;br /&gt;–imgformat=PNG \&lt;br /&gt;–title=”your title” \&lt;br /&gt;–rigid \&lt;br /&gt;–base=1000 \&lt;br /&gt;–height=120 \&lt;br /&gt;–width=500 \&lt;br /&gt;–alt-autoscale-max \&lt;br /&gt;–lower-limit=0 \&lt;br /&gt;–vertical-label=”bits per second” \&lt;br /&gt;DEF:a=bandwidth.rrd:in:AVERAGE \&lt;br /&gt;DEF:b=bandwidth.rrd:out:AVERAGE \&lt;br /&gt;VDEF:totin=a,TOTAL \&lt;br /&gt;VDEF:totout=b,TOTAL \&lt;br /&gt;CDEF:cdefa=a,8,* \&lt;br /&gt;CDEF:cdeff=b,8,* \&lt;br /&gt;AREA:cdefa#00CF00:”Incoming”  \&lt;br /&gt;GPRINT:cdefa:LAST:”Cur\:%6.2lf %sb/s”  \&lt;br /&gt;GPRINT:cdefa:AVERAGE:”Avg\:%6.2lf %sb/s”  \&lt;br /&gt;GPRINT:cdefa:MAX:”Max\:%6.2lf %sb/s”  \&lt;br /&gt;GPRINT:cdefa:MIN:”MIN\:%6.2lf %sb/s\l”  \&lt;br /&gt;LINE1.3:cdeff#0000FF:”Outgoing”  \&lt;br /&gt;GPRINT:cdeff:LAST:”Cur\:%6.2lf %sb/s”  \&lt;br /&gt;GPRINT:cdeff:AVERAGE:”Avg\:%6.2lf %sb/s”  \&lt;br /&gt;GPRINT:cdeff:MAX:”Max\:%6.2lf %sb/s”  \&lt;br /&gt;GPRINT:cdeff:MIN:”MIN\:%6.2lf %sb/s\l”  \&lt;br /&gt;GPRINT:totin:”Total IN\:%6.2lf %sb/s”  \&lt;br /&gt;GPRINT:totout:”Total OUT\:%6.2lf %sb/s”  \&lt;br /&gt;VRULE:1084777200#FF0000:”"&lt;/p&gt; &lt;p&gt;After firing  above command, a file bandwidth.png will be in current direcoty which is bandwidth graph for server 99.99.99.99&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/81071254749765631-8582882341163687455?l=sagarbirari.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagarbirari.blogspot.com/feeds/8582882341163687455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=81071254749765631&amp;postID=8582882341163687455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/81071254749765631/posts/default/8582882341163687455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/81071254749765631/posts/default/8582882341163687455'/><link rel='alternate' type='text/html' href='http://sagarbirari.blogspot.com/2008/09/monitoring-bandwidth-usage-with-snmp.html' title='Monitoring Bandwidth usage with SNMP and RRDtool for Linux'/><author><name>sagar</name><uri>http://www.blogger.com/profile/07861844902725518998</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12291998442269855416'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>