<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>KOTAK</title>
	<atom:link href="http://katulis.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://katulis.wordpress.com</link>
	<description>sekedar Webblog catatan pribadi</description>
	<lastBuildDate>Mon, 04 Aug 2008 20:24:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='katulis.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>KOTAK</title>
		<link>http://katulis.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://katulis.wordpress.com/osd.xml" title="KOTAK" />
	<atom:link rel='hub' href='http://katulis.wordpress.com/?pushpress=hub'/>
		<item>
		<title>SNMP</title>
		<link>http://katulis.wordpress.com/2008/08/04/snmp/</link>
		<comments>http://katulis.wordpress.com/2008/08/04/snmp/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 20:12:46 +0000</pubDate>
		<dc:creator>katulis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://katulis.wordpress.com/?p=85</guid>
		<description><![CDATA[Introduction You can monitor your system&#8217;s Web performance quite easily with graphical Linux tools. You&#8217;ll learn how to use several in this chapter, including MRTG, which is based on SNMP and monitors raw network traffic, and Webalizer, which tracks Web site hits. SNMP Most servers, routers and firewalls keep their operational statistics in object identifiers [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=85&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Introduction</span></span></span><span style="font-size:12pt;"></span></h1>
<p>You can monitor your system&#8217;s Web performance quite easily with graphical Linux tools. You&#8217;ll learn how to use several in this chapter, including MRTG, which is based on SNMP and monitors raw network traffic, and Webalizer, which tracks Web site hits.</p>
<h1><a name="SNMP"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">SNMP </span></span></span><span style="font-size:12pt;"></span></h1>
<p>Most servers, routers and firewalls keep their operational statistics in object identifiers (OIDs) that you can remotely retrieve via the Simple Network Management Protocol (SNMP). For ease of use, equipment vendors provide Management Information Base (MIB) files for their devices that define the functions of the OIDs they contain. That&#8217;s a lot of new terms to digest in two sentences, so take a moment to look more closely.<span id="more-85"></span></p>
<h2><a name="OIDs_And_MIBs"></a><span class="mw-headline"><span style="font-size:12pt;"><span style="color:#008000;">OIDs And MIBs</span> </span></span><span style="font-size:12pt;"></span></h2>
<p>OIDs are arranged in a structure of management information (SMI) tree defined by the SNMP standard. The tree starts from a root node, which then descends through branches and leaves that each add their own reference value to the path separated by a period.. Figure 22-1 shows an OID structure in which the path to the enterprises OID branch passes through the org, dod, internet, and private branches first. The OID path for enterprises is, therefore, 1.3.6.1.4.1.</p>
<h3><a name="Figure_22-1_SNMP_OID_Structure"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Figure 22-1 SNMP OID Structure</span></span></span><span style="font-size:12pt;"></span></h3>
<p><a title="Snmp.gif" href="http://www.linuxhomenetworking.com/wiki/index.php/Image:Snmp.gif"><span style="text-decoration:none;"><!--[if gte vml 1]&gt;                    &lt;![endif]--><!--[if !vml]--><span><img src="/DOCUME~1/KURNIA~1/LOCALS~1/Temp/msohtml1/04/clip_image001.gif" border="0" alt="Snmp.gif" width="314" height="580" /></span><!--[endif]--></span></a></p>
<p>Management Information Bases (MIBs) are text definitions of each of the OID branches. Table 22-1 shows how some commonly used OIDs map to their MIB definitions. For example, the SMI org MIB defines all the topmost OIDs found at the next layer, which is named dod; the internet MIB under dod defines the function of the topmost OIDs in the directory, mgmt, experimental, and private branches. This MIB information is very useful for SNMP management programs, enabling you to click on an OID and see its value, type, and description.</p>
<h3><a name="Table_22-1_OIDs_And_Their_Equivalent_MIB"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Table 22-1 OIDs And Their Equivalent MIBs</span></span></span><span style="font-size:12pt;"></span></h3>
<div>
<table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="background:green none repeat scroll 0;padding:3.75pt;">
<p class="MsoNormal" style="text-align:center;" align="center"><strong><span style="color:white;">OID </span></strong></p>
</td>
<td style="background:green none repeat scroll 0;padding:3.75pt;">
<p class="MsoNormal" style="text-align:center;" align="center"><strong><span style="color:white;">MIB </span></strong></p>
</td>
</tr>
<tr>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">1.3</p>
</td>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">org</p>
</td>
</tr>
<tr>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">1.3.6</p>
</td>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">dod</p>
</td>
</tr>
<tr>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">1.3.6.1</p>
</td>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">internet</p>
</td>
</tr>
<tr>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">1.3.6.1.1</p>
</td>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">directory</p>
</td>
</tr>
<tr>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">1.3.6.1.2</p>
</td>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">mgmt</p>
</td>
</tr>
<tr>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">1.3.6.1.3</p>
</td>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">experimental</p>
</td>
</tr>
<tr>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">1.3.6.1.4</p>
</td>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">private</p>
</td>
</tr>
<tr>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">1.3.6.1.4.1</p>
</td>
<td style="padding:3.75pt;" valign="top">
<p class="MsoNormal">enterprises</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>You can refer to an OID by substituting the values in a branch with one of these more readable MIB aliases. For example, you can reference the OID 1.3.6.1.4.1.9.9.109.1.1.1.1.5 as enterprises.9.9.109.1.1.1.1.5.1 by substituting the branch name (enterprises) for its OID numbers (1.3.6.1.4.1).</p>
<p>Remember, only the OID value at the very tip of a branch, the leaf, actually has a readable value. Think of OIDs like the directory structure on a hard disk. Each branch is equivalent to a subdirectory, and the very last value at the tip (the leaf) correlates to a file containing data.</p>
<p>The Linux snmpget command outputs the value of a single leaf, and the snmpwalk command provides the values of all leaves under a branch. I&#8217;ll discuss these commands later; for now, all you need to know is that the command output frequently doesn&#8217;t list the entire OID, just the MIB file in which it was found and the alias within the MIB. For example</p>
<pre><span style="font-size:12pt;font-family:&quot;">SNMPv2-MIB::sysUpTime.0</span></pre>
<p>Here the OID value was found in the SNMPv2-MIB file and occupies position zero in the sysUpTime alias.</p>
<p>Equipment manufacturers are usually assigned their own dedicated OID branch under the enterprises MIB, and they must also provide information in universally accepted OIDs for ease of manageability. For example, NIC interface data throughput values must always be placed in a predefined location in the general tree, but a memory use value on a customized processor card may be defined in a MIB under the manufacturer&#8217;s own OID branch.</p>
<h2><a name="SNMP_Community_Strings"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">SNMP Community Strings</span></span></span><span style="font-size:12pt;"></span></h2>
<p>As a security measure, you need to know the SNMP password, or community string, to query OIDs. There are a number of types of community strings, the most commonly used ones are the Read Only or &#8220;get&#8221; community string that only provides access for viewing statistics and system parameters. In many cases the Read Only community string or password is set to the word &#8220;public;&#8221; you should change it from this easy-to-guess value whenever possible. The Read/Write or &#8220;set&#8221; community string is for not only viewing statistics and system parameters but also for updating the parameters.</p>
<h2><a name="SNMP_Versions"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">SNMP Versions</span></span></span><span style="font-size:12pt;"></span></h2>
<p>There are currently three versions of SNMP.</p>
<ol type="1">
<li class="MsoNormal">SNMP Version 1: The first      version of SNMP to be implemented, version 1 was designed to be a protocol      to provide device statistics and error reporting without consuming a lot      of system resources. Security was limited to community strings and access      controls based on the IP address of the querying server. Data communication      wasn&#8217;t encrypted.</li>
<li class="MsoNormal">SNMP Version 2: The second      version of SNMP, often referred to as v2c, expanded the number of      supported error codes, increased the size of counters used to track data,      and had the ability to do bulk queries that more efficiently loaded      response packets with data. SNMP v2c is backward compatible with version      1.</li>
<li class="MsoNormal">SNMP Version 3: This version      provides greater security and remote configuration capabilities than its      predecessors. Access isn&#8217;t limited to a single community string for      read-only and read/write access, as usernames and passwords have been      introduced. Views of OIDs in a MIB can also be limited on a per-user      basis. Support for encrypted SNMP data transfer and transfer error      detection is also provided.</li>
</ol>
<p>Remember their differences, because you will need to specify the version number when doing SNMP queries.</p>
<h2><a name="Doing_SNMP_Queries"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Doing SNMP Queries</span></span></span><span style="font-size:12pt;"></span></h2>
<p>Configuring SNMP on a server isn&#8217;t hard, but it does require a number of detailed steps.</p>
<h3><a name="Installing_SNMP_Utilities_on_a_Linux_Ser"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Installing SNMP Utilities on a Linux Server</span></span></span><span style="font-size:12pt;"></span></h3>
<p>If you intend to use your Linux box to query your network devices, other servers or even itself using MRTG or any other tool, you need to have the SNMP utility tools package net-snmp-utils installed. This package may also require pre-requisite packages, so it is best to use an automated package updater such yum or apt to do this.</p>
<p>When searching for these packages the filenames will start with the package name followed by a version number, as in net-snmp-utils-5.1.1-2.i386.rpm. (If you need an installation refresher, see Chapter 6, &#8220;<a title="Installing Linux Software" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch06_:_Installing_Linux_Software">Installing Linux Software</a>&#8220;).</p>
<h3><a name="SNMP_Utilities_Command_Syntax"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">SNMP Utilities Command Syntax</span></span></span><span style="font-size:12pt;"></span></h3>
<p>The SNMP utility tools package installs a number of new commands on your system for doing SNMP queries, most notably snmpget for individual OIDs and snmpwalk for obtaining the contents of an entire MIB. Both commands require you to specify the community string with a -c operator. They also require you to specify the version of the SNMP query to be used with a -v 1, -v 2c, or -v 3 operator for versions 1, 2, and 3, respectively. The first argument is the name or IP address of the target device and all other arguments list the MIBs to be queried.</p>
<p>This example gets all the values in the interface MIB of the local server using SNMP version 1 and the community string of craz33guy.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# snmpwalk -v 1 -c craz33guy localhost interface</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">IF-MIB::ifDescr.1 = STRING: lo</span>
<span style="font-size:12pt;font-family:&quot;">IF-MIB::ifDescr.2 = STRING: eth0</span>
<span style="font-size:12pt;font-family:&quot;">IF-MIB::ifDescr.3 = STRING: eth1</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">IF-MIB::ifPhysAddress.1 = STRING:</span>
<span style="font-size:12pt;font-family:&quot;">IF-MIB::ifPhysAddress.2 = STRING: 0:9:5b:2f:9e:d5</span>
<span style="font-size:12pt;font-family:&quot;">IF-MIB::ifPhysAddress.3 = STRING: 0:b0:d0:46:32:71</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span></pre>
<p>Upon inspecting the output of the snmpwalk command, you can see that the second interface seems to have the name eth0 and the MAC address 0:9:5b:2f:9e:d5. You can now retrieve the individual MAC address using the snmpget command.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# snmpget -v 1 -c const1payted localhost ifPhysAddress.2</span>
<span style="font-size:12pt;font-family:&quot;">IF-MIB::ifPhysAddress.2 = STRING: 0:9:5b:2f:9e:d5</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span></pre>
<p>You can confirm this information using the ifconfig command for interface eth0; the very first line shows a matching MAC address.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# ifconfig -a eth0</span>
<span style="font-size:12pt;font-family:&quot;">eth0<span>      </span>Link encap:Ethernet<span>  </span>HWaddr 00:09:5B:2F:9E:D5<span>  </span></span>
<span style="font-size:12pt;font-family:&quot;"><span>          </span>inet addr:216.10.119.244<span>  </span>Bcast:216.10.119.255<span>   </span>Mask:255.255.255.240</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span></pre>
<p>You&#8217;ll now see how you can configure SNMP on your Linux server to achieve these results.</p>
<h3><a name="Configuring_Simple_SNMP_on_a_Linux_Serve"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Configuring Simple SNMP on a Linux Server</span></span></span><span style="font-size:12pt;"></span></h3>
<p>By default Fedora, installs the net-snmp package as its SNMP server product. This package uses a configuration file named /etc/snmp/snmpd.conf in which the community strings and other parameters may be set. The version of the configuration file that comes with net-snmp is quite complicated. I suggest archiving it and using a much simpler version with only a single line containing the keyword rocommunity followed by the community string. Here is an example.</p>
<p>1) Save the old configuration file</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# cd /etc/snmp/</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy snmp]# mv snmpd.conf snmpd.conf.old</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy snmp]# vi snmpd.conf</span>
<span style="font-size:12pt;font-family:&quot;"> </span></pre>
<p>2) Enter the following line in the new configuration file to set the Read Only community string to craz33guy.</p>
<pre><span style="font-size:12pt;font-family:&quot;">rocommunity craz33guy</span></pre>
<p>3) Configure Linux to start SNMP services on each reboot with the chkconfig command:</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy root]# chkconfig snmpd on</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy root]#</span></pre>
<p>4) Start SNMP to load the current configuration file.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy root]# service snmpd start</span>
<span style="font-size:12pt;font-family:&quot;">Starting snmpd: [ OK ]</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy root]#</span></pre>
<p>5) Test whether SNMP can read the system and interface MIBs using the snmpwalk command.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy snmp]# snmpwalk -v 1 -c craz33guy localhost system</span>
<span style="font-size:12pt;font-family:&quot;">SNMPv2-MIB::sysDescr.0 = STRING: Linux bigboy 2.4.18-14 #1 Wed Sep 4 11:57:57 EDT 2002 i586</span>
<span style="font-size:12pt;font-family:&quot;">SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10</span>
<span style="font-size:12pt;font-family:&quot;">SNMPv2-MIB::sysUpTime.0 = Timeticks: (425) 0:00:04.25</span>
<span style="font-size:12pt;font-family:&quot;">SNMPv2-MIB::sysContact.0 = STRING: root@localhost</span>
<span style="font-size:12pt;font-family:&quot;">SNMPv2-MIB::sysName.0 = STRING: bigboy</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy snmp]# snmpwalk -v 1 -c craz33guy localhost interface</span>
<span style="font-size:12pt;font-family:&quot;">IF-MIB::ifNumber.0 = INTEGER: 3</span>
<span style="font-size:12pt;font-family:&quot;">IF-MIB::ifIndex.1 = INTEGER: 1</span>
<span style="font-size:12pt;font-family:&quot;">IF-MIB::ifIndex.2 = INTEGER: 2</span>
<span style="font-size:12pt;font-family:&quot;">IF-MIB::ifIndex.3 = INTEGER: 3</span>
<span style="font-size:12pt;font-family:&quot;">IF-MIB::ifDescr.1 = STRING: lo</span>
<span style="font-size:12pt;font-family:&quot;">IF-MIB::ifDescr.2 = STRING: wlan0</span>
<span style="font-size:12pt;font-family:&quot;">IF-MIB::ifDescr.3 = STRING: eth0 </span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy snmp]# </span></pre>
<p>Now that you know SNMP is working correctly on your Linux server, you can configure SNMP statistics gathering software, such as MRTG, to create online graphs of your traffic flows.</p>
<h3><a name="SNMP_On_Other_Devices"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">SNMP On Other Devices</span></span></span><span style="font-size:12pt;"></span></h3>
<p>In the example, you were polling localhost. You can poll any SNMP-aware network device that has SNMP enabled. All you need is the IP address and SNMP Read Only string and you&#8217;ll be able to get similar results. Here is an example of a query of a device with an IP address of 192.168.1.1.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy snmp]# snmpwalk -v 1 -c chir1qui 192.168.1.1 interface</span></pre>
<p>Note: When issuing snmpwalk and snmpget commands, remember to use the proper version switch (-v 1, -v 2c, or -v 3) for the version of SNMP you&#8217;re using.</p>
<h2><a name="Basic_SNMP_Security"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Basic SNMP Security</span></span></span><span style="font-size:12pt;"></span></h2>
<p>The security precautions that need to be taken with SNMP vary depending on the version you are using. This section outlines the basic steps for protecting your MIB data.</p>
<h3><a name="SNMP_Versions_1_and_2"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">SNMP Versions 1 and 2</span></span></span><span style="font-size:12pt;"></span></h3>
<p>The most commonly supported versions of SNMP don&#8217;t encrypt your community string password so you shouldn&#8217;t do queries over insecure networks, such as the Internet. You should also make sure that you use all reasonable security measures to allow queries only from trusted IP addresses either via a firewall or the SNMP security features available in the snmp.conf file. You can also configure your server to use the TCP wrappers feature outlined in Appendix I, &#8220;Miscellaneous Linux Topics,&#8221; to limit access to specific servers without the need of a firewall.</p>
<p>In case you need it, the snmpd.conf file can support limiting MIB access to trusted hosts and networks.</p>
<p>The snmpd.conf file has two security sections; a section with very restrictive access sits at the top of the file and is immediately followed by a less restrictive section. The example that follows is a modification of the less restrictive section. You will have to comment out the more restrictive statements at the top of the file for it to work correctly.</p>
<pre><span style="font-size:12pt;font-family:&quot;">##<span>       </span>sec.name<span>     </span>source<span>           </span>community</span>
<span style="font-size:12pt;font-family:&quot;">##<span>       </span>========<span>     </span>======<span>           </span>=========</span>
<span style="font-size:12pt;font-family:&quot;">com2sec<span>  </span>local<span>       </span>localhost<span>        </span>craz33guy</span>
<span style="font-size:12pt;font-family:&quot;">com2sec<span>  </span>network_1<span>   </span>172.16.1.0/24<span>    </span>craz33guy</span>
<span style="font-size:12pt;font-family:&quot;">com2sec<span>  </span>network_2<span>   </span>192.168.2.0/24<span>   </span>craz33guy</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">##<span>       </span>Access.group.name<span>   </span>sec.model<span>        </span>sec.name</span>
<span style="font-size:12pt;font-family:&quot;">##<span>       </span>=================<span>  </span>=========<span>         </span>========</span>
<span style="font-size:12pt;font-family:&quot;">group<span>    </span>MyROGroup_1<span>        </span>v1<span>                </span>local</span>
<span style="font-size:12pt;font-family:&quot;">group<span>    </span>MyROGroup_1<span>        </span>v1<span>                </span>network_1</span>
<span style="font-size:12pt;font-family:&quot;">group<span>    </span>MyROGroup_2<span>       </span><span> </span>v2c<span>               </span>network_2</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">##<span>   </span>MIB.view.name<span>     </span>incl/excl<span>  </span>MIB.subtree<span>  </span>mask</span>
<span style="font-size:12pt;font-family:&quot;">##<span>   </span>==============<span>   </span>=========<span>  </span>===========<span>  </span>====</span>
<span style="font-size:12pt;font-family:&quot;">view all-mibs<span>         </span>included<span>   </span>.1<span>           </span>80</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">##<span>      </span>MIB<span>                </span></span>
<span style="font-size:12pt;font-family:&quot;">##<span>      </span>group.name<span>   </span>context sec.model sec.level prefix read<span>     </span>write<span>  </span>notif</span>
<span style="font-size:12pt;font-family:&quot;">##<span>      </span>==========<span>   </span>======= ========= ========= ====== ====<span>     </span>=====<span>  </span>=====</span>
<span style="font-size:12pt;font-family:&quot;">access<span>  </span>MyROGroup_1<span>  </span>""<span>       </span>v1<span>       </span>noauth<span>    </span>exact<span>  </span>all-mibs none<span>   </span>none</span>
<span style="font-size:12pt;font-family:&quot;">access<span>  </span>MyROGroup_2<span>  </span>""<span>       </span>v2c<span>      </span>noauth<span>    </span>exact<span>  </span>all-mibs none<span>   </span>none</span></pre>
<p>In our example:</p>
<ul type="disc">
<li class="MsoNormal">Only three networks      (localhost, 172.16.1.0/24, and 192.168.1.0/24) are allowed to access the      server with the craz33guy community string.</li>
<li class="MsoNormal">Each network is matched to a      either a group called MyROGroup_1 using SNMP version 1, or group called      MyROGroup_2 using SNMP version 2.</li>
<li class="MsoNormal">All the MIBs on the server      are defined by the view named all-mibs.</li>
<li class="MsoNormal">An access statement ensures      that only the defined networks have read only access to all the MIBs.      MyROGroup_1 only has version 1 access with MyROGroup_2 only having version      2 access.</li>
<li class="MsoNormal">Modification of the MIBs via      SNMP is denied because the word &#8220;none&#8221; is in the write section      of the access statement.</li>
</ul>
<p>These precautions are probably unnecessary in a home environment where access is generally limited to devices on the home network by a NAT firewall.</p>
<h3><a name="SNMP_Version_3"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">SNMP Version 3</span></span></span><span style="font-size:12pt;"></span></h3>
<p>SNMP Version 3 SNMPv3 is a much more secure alternative to earlier versions as it encrypts all its data and uses a username / password combination for client authentication. The username should be located in the /etc/snmp/snmpd.conf file with a corresponding automatically generated password located in the /var/net-snmp/snmpd.conf file. Here is how it&#8217;s done.</p>
<p>1. Install the net-snmp-devel package as it contains the utility that will allow you to generate the password. If you need an installation refresher, see Chapter 6, &#8220;<a title="Installing Linux Software" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch06_:_Installing_Linux_Software">Installing Linux Software</a>&#8220;)</p>
<p>2. Stop the snmpd process.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# service snmpd stop</span>
<span style="font-size:12pt;font-family:&quot;">Stopping snmpd: [<span>  </span>OK<span>  </span>]</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span></pre>
<p>3. Automatically create the /etc/snmp/snmpd.conf and /var/net-snmp/snmpd.conf username and password entries using the net-snmp-config command. In this example the authentication password of &#8220;rootsrockreggae&#8221; for the read only (-ro) username &#8220;username4snmpv3&#8243; is encrypted using the MD5 algorithm. The data received will not be encrypted.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# net-snmp-config --create-snmpv3-user -ro \</span>
<span style="font-size:12pt;font-family:&quot;">-a MD5 -A rootsrockreggae username4snmpv3</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">adding the following line to /var/net-snmp/snmpd.conf:</span>
<span style="font-size:12pt;font-family:&quot;"><span>   </span>createUser username4snmpv3 MD5 "rootsrockreggae" DES</span>
<span style="font-size:12pt;font-family:&quot;">adding the following line to /etc/snmp/snmpd.conf:</span>
<span style="font-size:12pt;font-family:&quot;"><span>   </span>rouser username4snmpv3</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# service snmpd start</span>
<span style="font-size:12pt;font-family:&quot;">Starting snmpd: [<span>  </span>OK<span>  </span>]</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span></pre>
<p>4. To encrypt the data received we use the net-snmp-config command again to create a username just for this purpose. A new read only username &#8220;securev3user&#8221; and authentication password &#8220;mandeville&#8221; are used, but this time the data will be encrypted using the DES algorithm with the privacy password of &#8220;savlamar&#8221;.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# net-snmp-config --create-snmpv3-user -ro \</span>
<span style="font-size:12pt;font-family:&quot;">-a MD5 -A mandeville -x DES -X savlamar securev3user</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">adding the following line to /var/net-snmp/snmpd.conf:</span>
<span style="font-size:12pt;font-family:&quot;"><span>   </span>createUser securev3user MD5 "mandeville" DES savlamar</span>
<span style="font-size:12pt;font-family:&quot;">adding the following line to /etc/snmp/snmpd.conf:</span>
<span style="font-size:12pt;font-family:&quot;"><span>   </span>rouser securev3user</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span>
<span style="font-size:12pt;font-family:&quot;"> </span></pre>
<p>5. Start the snmpd process.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# service snmpd start</span>
<span style="font-size:12pt;font-family:&quot;">Starting snmpd: [<span>  </span>OK<span>  </span>]</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span></pre>
<p>6. First we&#8217;ll do a query from remote host smallfry. We specify the authentication password and authentication encryption method, and we also use the -l flag to indicate that authentication will be used, but that data privacy will be disabled (the authNoPriv option).</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@smallfry ~]# snmpget -v 3 -u username4snmpv3 -l authNoPriv \</span>
<span style="font-size:12pt;font-family:&quot;">-a MD5 -A rootsrockreggae<span>  </span>192.168.1.100 SNMPv2-MIB::sysORDescr.8</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">SNMPv2-MIB::sysORDescr.8 = STRING: The management information definitions for the SNMP User-based Security Model.</span>
<span style="font-size:12pt;font-family:&quot;">[root@smallfry ~]#</span></pre>
<p>The query returns an easy to read string, &#8220;The management information definitions for the SNMP User-based Security Model&#8221;. This unencrypted string can also be seen in the tshark packet capture of the server&#8217;s interface.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# tshark -n -i eth1 -x port 161</span>
<span style="font-size:12pt;font-family:&quot;">Capturing on eth1</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;"><span>  </span>0.005889 192.168.1.100 -&gt; 192.168.1.50 SNMP get-response</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">0000<span>  </span>00 c0 4f 46 0c 2e 00 b0 d0 46 32 71 08 00 45 00<span>   </span>..OF.....F2q..E.</span>
<span style="font-size:12pt;font-family:&quot;">0010<span>  </span>00 f0 00 00 40 00 40 11 b3 b2 c0 a8 02 c8 c0 a8<span>   </span>....@.@.........</span>
<span style="font-size:12pt;font-family:&quot;">0020<span>  </span>02 32 00 a1 80 0a 00 dc 87 38 30 81 d1 02 01 03<span>   </span>.2.......80.....</span>
<span style="font-size:12pt;font-family:&quot;">0030<span>  </span>30 11 02 04 45 a2 23 54 02 03 00 ff e3 04 01 01<span>   </span>0...E.#T........</span>
<span style="font-size:12pt;font-family:&quot;">0040<span>  </span>02 01 03 04 38 30 36 04 0d 80 00 1f 88 80 71 11<span>   </span>....806.......q.</span>
<span style="font-size:12pt;font-family:&quot;">0050<span>  </span>68 72 0e b1 e7 45 02 01 12 02 01 39 04 0f 75 73<span>   </span>hr...E.....9..us</span>
<span style="font-size:12pt;font-family:&quot;">0060<span>  </span>65 72 6e 61 6d 65 34 73 6e 6d 70 76 33 04 0c 46<span>   </span>ername4snmpv3..F</span>
<span style="font-size:12pt;font-family:&quot;">0070<span>  </span>6c 74 26 51 4d aa 65 61 59 06 1a 04 00 30 7f 04<span>   </span>lt&amp;QM.eaY....0..</span>
<span style="font-size:12pt;font-family:&quot;">0080<span>  </span>0d 80 00 1f 88 80 71 11 68 72 0e b1 e7 45 04 00<span>   </span>......q.hr...E..</span>
<span style="font-size:12pt;font-family:&quot;">0090<span>  </span>a2 6c 02 04 43 4e da d7 02 01 00 02 01 00 30 5e<span>   </span>.l..CN........0^</span>
<span style="font-size:12pt;font-family:&quot;">00a0<span>  </span>30 5c 06 0a 2b 06 01 02 01 01 09 01 03 08 04 4e<span>   </span>0\..+..........N</span>
<span style="font-size:12pt;font-family:&quot;">00b0<span>  </span>54 68 65 20 6d 61 6e 61 67 65 6d 65 6e 74 20 69<span>   </span>The management i</span>
<span style="font-size:12pt;font-family:&quot;">00c0<span>  </span>6e 66 6f 72 6d 61 74 69 6f 6e 20 64 65 66 69 6e<span>   </span>nformation defin</span>
<span style="font-size:12pt;font-family:&quot;">00d0<span>  </span>69 74 69 6f 6e 73 20 66 6f 72 20 74 68 65 20 53<span>   </span>itions for the S</span>
<span style="font-size:12pt;font-family:&quot;">00e0<span>  </span>4e 4d 50 20 55 73 65 72 2d 62 61 73 65 64 20 53<span>   </span>NMP User-based S</span>
<span style="font-size:12pt;font-family:&quot;">00f0<span>  </span>65 63 75 72 69 74 79 20 4d 6f 64 65 6c 2e<span>         </span>ecurity Model.</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">4 packets captured</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span>
<span style="font-size:12pt;font-family:&quot;"> </span></pre>
<p>7. Next we&#8217;ll do a query that will return a response over an encrypted data channel while crossing the network (the authPriv option).</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@smallfry ~]# snmpget -v 3 -u securev3user -l authPriv \</span>
<span style="font-size:12pt;font-family:&quot;">-a MD5 -A mandeville<span>  </span>-x DES -X savlamar 192.168.1.100 SNMPv2-MIB::sysORDescr.8</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">SNMPv2-MIB::sysORDescr.8 = STRING: The management information definitions for the SNMP User-based Security Model.</span>
<span style="font-size:12pt;font-family:&quot;">[root@smallfry ~]# </span></pre>
<p>The query returns the same string, but the tshark packet capture only sees encrypted data, with only the username being visible.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp] # tshark -n -i eth1 -x port 161</span>
<span style="font-size:12pt;font-family:&quot;">Capturing on eth1</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;"><span>  </span>0.003675 192.168.1.200 -&gt; 192.168.1.50 SNMP Source port: 161<span>  </span>Destination port: 32778 [UDP CHECKSUM INCORRECT]</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">0000<span>  </span>00 c0 4f 46 0c 2e 00 b0 d0 46 32 71 08 00 45 00<span>   </span>..OF.....F2q..E.</span>
<span style="font-size:12pt;font-family:&quot;">0010<span>  </span>01 00 00 00 40 00 40 11 b3 a2 c0 a8 02 c8 c0 a8<span>   </span>....@.@.........</span>
<span style="font-size:12pt;font-family:&quot;">0020<span>  </span>02 32 00 a1 80 0a 00 ec 87 48 30 81 e1 02 01 03<span>   </span>.2.......H0.....</span>
<span style="font-size:12pt;font-family:&quot;">0030<span>  </span>30 11 02 04 17 52 82 96 02 03 00 ff e3 04 01 03<span>   </span>0....R..........</span>
<span style="font-size:12pt;font-family:&quot;">0040<span>  </span>02 01 03 04 3e 30 3c 04 0d 80 00 1f 88 80 71 11<span>   </span>....&gt;0&lt;.......q.</span>
<span style="font-size:12pt;font-family:&quot;">0050<span>  </span>68 72 0e b1 e7 45 02 01 11 02 02 00 8e 04 0c 73<span>   </span>hr...E.........s</span>
<span style="font-size:12pt;font-family:&quot;">0060<span>  </span>65 63 75 72 65 76 33 75 73 65 72 04 0c 01 b2 00<span>   </span>ecurev3user.....</span>
<span style="font-size:12pt;font-family:&quot;">0070<span>  </span>6e 23 07 83 dc a2 b6 d6 3d 04 08 00 00 00 11 4e<span>   </span>n#......=......N</span>
<span style="font-size:12pt;font-family:&quot;">0080<span>  </span>df 19 a3 04 81 88 36 dd e0 ce e0 52 19 ff 58 7e<span>   </span>......6....R..X~</span>
<span style="font-size:12pt;font-family:&quot;">0090<span>  </span>be fa d1 96 20 2b 28 65 59 30 e8 d4 cb 18 9f 8f<span>   </span>.... +(eY0......</span>
<span style="font-size:12pt;font-family:&quot;">00a0<span>  </span>1e 5b a3 d6 ae f7 4a 86 bd ed 2a 4b a8 df 52 fb<span>   </span>.[....J...*K..R.</span>
<span style="font-size:12pt;font-family:&quot;">00b0<span>  </span>00 b4 a8 37 3d 74 9e 6d 1d 56 9a ba f2 13 fa 72<span>   </span>...7=t.m.V.....r</span>
<span style="font-size:12pt;font-family:&quot;">00c0<span>  </span>4d 47 fb 88 7b d3 54 e1 9d b3 66 f0 29 ab 8a 55<span>   </span>MG..{.T...f.)..U</span>
<span style="font-size:12pt;font-family:&quot;">00d0<span>  </span>6f 77 65 40 87 ab 0c 51 d9 0e bf 33 7f 9a cb ea<span>   </span>owe@...Q...3....</span>
<span style="font-size:12pt;font-family:&quot;">00e0<span>  </span>37 50 3c 8e 65 dd 8f 3c 49 71 96 59 f9 d3 a8 23<span>   </span>7P&lt;.e..&lt;Iq.Y...#</span>
<span style="font-size:12pt;font-family:&quot;">00f0<span>  </span>81 c6 1b b2 c2 d0 57 9b 98 1b 89 1e ca 77 3d 84<span>   </span>......W......w=.</span>
<span style="font-size:12pt;font-family:&quot;">0100<span>  </span>6f af b6 9b 86 3a 2f 66 44 1a 41 51 03 bc<span>         </span>o....:/fD.AQ..</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">4 packets captured</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp] #</span></pre>
<p>8. Your password and privilege information are stored in /var/net-snmp/snmpd.conf using the format displayed when you used the net-snmp-config command. here is an example.</p>
<pre><span style="font-size:12pt;font-family:&quot;"># File: /var/net-snmp/snmpd.conf before SNMP starts</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">createUser securev3user MD5 "mandeville" DES savlamar</span>
<span style="font-size:12pt;font-family:&quot;">createUser username4snmpv3 MD5 "rootsrockreggae" DES</span></pre>
<p>The snmpd daemon will completely encrypt the SNMP password data in this file when it restarts which helps to further increase security. We can see an example of this configuration here.</p>
<pre><span style="font-size:12pt;font-family:&quot;"># File: /var/net-snmp/snmpd.conf after SNMP starts</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">usmUser 1 3 0x80001f88780711168720eb1e745</span>
<span style="font-size:12pt;font-family:&quot;">0x73656375626576337573657200 </span>
<span style="font-size:12pt;font-family:&quot;">0x73656375726576337573657200 </span>
<span style="font-size:12pt;font-family:&quot;">NULL .1.3.6.1.6.3.10.1.1.2 0xd951</span>
<span style="font-size:12pt;font-family:&quot;">ac1d95033f4afgf31243eb6907df .1.3.6.1.6.3.10.1.2.2</span>
<span style="font-size:12pt;font-family:&quot;">0xf1f4bb00452211d27b50c273c09031ac 0x00</span>
<span style="font-size:12pt;font-family:&quot;">usmUser 1 3 0x80001f8880711168720eb1e745 </span>
<span style="font-size:12pt;font-family:&quot;">0x757365726e61657534736e6d70763300 </span>
<span style="font-size:12pt;font-family:&quot;">0x757365726e616d6534736e6d70763300 </span>
<span style="font-size:12pt;font-family:&quot;">NULL .1.3.6.1.6.3.10.</span>
<span style="font-size:12pt;font-family:&quot;">1.1.2 0x5e35c9f5352519aa4f53eded09bbdddd </span>
<span style="font-size:12pt;font-family:&quot;">.1.3.6.1.6.3.10.1.2.2 0x5e35c9f5122519aa4f53eded09bbdddd ""</span>
<span style="font-size:12pt;font-family:&quot;">setserialno 1464593474</span></pre>
<p>Practice using the net-snmp-config command so that you can become familiar with the syntax it uses to edit the SNMP configuration files. When in doubt, you can get a full syntax listing of the command if you use it without any arguments like this:</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# net-snmp-config </span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;"> SNMP Setup commands:</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;"><span>   </span>--create-snmpv3-user [-ro] [-A authpass] [-X privpass]</span>
<span style="font-size:12pt;font-family:&quot;"><span>                   </span><span>     </span>[-a MD5|SHA] [-x DES|AES] [username]</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span></pre>
<p>With experience, you should become confident enough to edit the configuration files by yourself.</p>
<p>As you can see, SNMPv3 is more secure than previous versions and should be your first SNMP choice whenever possible.</p>
<h2><a name="Simple_SNMP_Troubleshooting"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Simple SNMP Troubleshooting</span></span></span><span style="font-size:12pt;"></span></h2>
<p>If your SNMP queries fail, then verify that:</p>
<ul type="disc">
<li class="MsoNormal">You restarted your snmp.conf      file so the configuration settings become active. Remember, the snmpd.conf      file is only read by the snmpd daemon when it starts up.</li>
<li class="MsoNormal">You are using the correct      community string.</li>
<li class="MsoNormal">Firewalls aren&#8217;t preventing      SNMP queries from the SNMP client to the SNMP target.</li>
<li class="MsoNormal">Your SNMP security policy      allows the query from your network.</li>
<li class="MsoNormal">Any TCP wrappers      configuration on your SNMP target machine allows SNMP queries from your      SNMP client. Generally speaking in a home environment protected by NAT      your TCP wrappers files (/etc/hosts.allow) and (/etc/hosts.deny) should be      blank.</li>
<li class="MsoNormal">Network routing between the      client and target devices is correct. A simple ping or traceroute test      should be sufficient.</li>
<li class="MsoNormal">The snmpd daemon is running      on the SNMP client.</li>
<li class="MsoNormal">You are querying using the      correct SNMP version.</li>
<li class="MsoNormal">Your /var/log/messages file      does not contain errors that may have occurred while starting snmpd.</li>
</ul>
<p>Troubleshooting to get functioning SNMP queries is important as many other supporting applications, such as MRTG which I&#8217;ll discuss next, rely on them in order to work correctly.</p>
<h1><a name="MRTG"></a><span class="mw-headline"><span style="font-size:12pt;"><span style="color:#008000;">MRTG</span> </span></span><span style="font-size:12pt;"></span></h1>
<p>MRTG (Multi-Router Traffic Grapher) is a public domain package for producing graphs of various router statistics via a Web page. You can easily create graphs of traffic flow statistics through your home network&#8217;s firewall/router or even your Linux box&#8217;s NIC cards using MRTG. The product is available from the MRTG Web site (www.mrtg.org) and also on your distribution CDs. Figure 22-2 shows a sample MRTG graph.</p>
<h3><a name="Figure_22-2_A_Typical_MRTG_Web_Page"></a><span class="mw-headline"><span style="font-size:12pt;"><span style="color:#008000;">F</span><span style="color:#008000;">igure 22-2 A Typical MRTG Web Page</span></span></span><span style="font-size:12pt;"></span></h3>
<p><a title="Mrtg.gif" href="http://www.linuxhomenetworking.com/wiki/index.php/Image:Mrtg.gif"><span style="text-decoration:none;"><!--[if gte vml 1]&gt;  &lt;![endif]--><!--[if !vml]--><span><img src="/DOCUME~1/KURNIA~1/LOCALS~1/Temp/msohtml1/04/clip_image002.gif" border="0" alt="Mrtg.gif" width="512" height="384" /></span><!--[endif]--></span></a></p>
<h2><a name="MRTG_Download_and_Installation"></a><span class="mw-headline"><span style="font-size:12pt;"><span style="color:#008000;">MRTG Download and Installation</span> </span></span><span style="font-size:12pt;"></span></h2>
<p>You need to install MRTG before proceeding. Most RedHat and Fedora Linux software products are available in the RPM format. When searching for the file, remember that the MRTG RPM&#8217;s filename usually starts with mrtg and a version number, as in mrtg-2.10.5-3.i386.rpm.</p>
<p>In addition to MRTG, you need to install the SNMP utility tools as explained earlier and you need to have a Web server package installed for MRTG to work. RedHat Linux usually comes with the Apache Web server software preinstalled. The easiest way to tell if Apache is installed is to run the rpm -q httpd command. If you don&#8217;t get a positive response, you can refer to Chapter 20, &#8220;<a title="The Apache Web Server" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch20_:_The_Apache_Web_Server">The Apache Web Server</a>&#8220;, for installation details. By default Apache expects the HTML files for your Web site to be located in /var/www/html. MRTG places its HTML files in /var/www/mrtg.</p>
<h2><a name="Configuring_MRTG"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Configuring MRTG</span></span></span><span style="font-size:12pt;"></span></h2>
<p>By default, MRTG maps the inbound and outbound data throughput rates on the device it is polling. Methods for specifying other OIDs, such as CPU and memory usage, are discussed in Chapter 23, &#8220;<a title="Advanced MRTG for Linux" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch23_:_Advanced_MRTG_for_Linux">Advanced MRTG for Linux</a>&#8220;. For now, I&#8217;ll stick with the default configuration.</p>
<p>When the MRTG RPM is installed, it creates a directory called /etc/mrtg in which all future configuration files are stored. To create a replacement default /etc/mrtg/mrtg.cfg configuration file for the server, follow these steps.</p>
<p>1) Use MRTG&#8217;s cfgmaker command to create a configuration file named mrtg.cfg for the server (bigboy) using a Read Only community string of craz33guy. Place all data files in the directory /var/www/mrtg.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# cfgmaker --output=/etc/mrtg/mrtg.cfg \</span>
<span style="font-size:12pt;font-family:&quot;">--global "workdir: /var/www/mrtg" -ifref=ip \</span>
<span style="font-size:12pt;font-family:&quot;">--global 'options[_]: growright,bits' \</span>
<span style="font-size:12pt;font-family:&quot;">craz33guy@localhost</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">--base: Get Device Info on craz33guy@localhost:</span>
<span style="font-size:12pt;font-family:&quot;">--base: Vendor Id:</span>
<span style="font-size:12pt;font-family:&quot;">--base: Populating confcache</span>
<span style="font-size:12pt;font-family:&quot;">--snpo: confcache craz33guy@localhost: Descr lo --&gt; 1</span>
<span style="font-size:12pt;font-family:&quot;">--snpo: confcache craz33guy@localhost: Descr wlan0 --&gt; 2</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;">...</span>
<span style="font-size:12pt;font-family:&quot;"> --base: Walking ifAdminStatus</span>
<span style="font-size:12pt;font-family:&quot;">--base: Walking ifOperStatus</span>
<span style="font-size:12pt;font-family:&quot;">--base: Writing /etc/mrtg/mrtg.cfg</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span>
<span style="font-size:12pt;font-family:&quot;"> </span></pre>
<p><strong>SNMPv2:</strong> As explained in the SNMP section, there are different versions of SNMP. If your query doesn&#8217;t work, check to make sure you are using the required version and then check other SNMP configuration parameters on the target device. You can specify MRTG&#8217;s SNMP query version with the &#8211;snmp-options cfgmaker option. Here is an example of cfgmaker using an SNMP version 2 query of a router with an IP address of 192.168.1.3. The &#8211;snmp-options option&#8217;s five colons before the 2 are important.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# cfgmaker --output=/etc/mrtg/192.168.1.3.cfg \</span>
<span style="font-size:12pt;font-family:&quot;">-ifref=ip --global "workdir: /var/www/mrtg" \</span>
<span style="font-size:12pt;font-family:&quot;">--snmp-options=:::::2 craz33guy@192.168.1.3</span></pre>
<p><strong>SNMPv3:</strong> The cfgmaker command can also be used to poll SNMPv3 enabled devices, but you have to first install the Net::SNMP PERL module.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# yum -y install perl-Net-SNMP</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">or</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# perl -MCPAN -e "install Net::SNMP"</span></pre>
<p>If you fail to install the module, you will get an error looking like this:</p>
<pre><span style="font-size:12pt;font-family:&quot;">Undefined subroutine &amp;main::snmpmapOID called at ./cfgmaker line 1480.</span></pre>
<p>Next you need to know the SNMPv3 ID of the host you intend to poll. In fedora, this is value is located in the /var/net-snmp/snmpd.conf file. You can use the grep command to obtain it.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# grep oldEngineID /var/net-snmp/snmpd.conf </span>
<span style="font-size:12pt;font-family:&quot;">oldEngineID 0x80001f8880711168720eb1e745</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span></pre>
<p>You can then repeat the cfgmaker command with options specific to the privacy and authentication schemes configured on the SNMP target device. Using the configurations of our previous SNMPv3 example, our configuration for encrypted authentication only would look like this:</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# cfgmaker --global 'WorkDir: /var/www/mrtg' \</span>
<span style="font-size:12pt;font-family:&quot;">--global 'Options[_]: growright, bits' \</span>
<span style="font-size:12pt;font-family:&quot;">--output=/etc/mrtg/192.168.1.100.cfg \</span>
<span style="font-size:12pt;font-family:&quot;">--enablesnmpv3 --username=username4snmpv3 \</span>
<span style="font-size:12pt;font-family:&quot;">--authpassword=rootsrockreggae --authproto=md5 \</span>
<span style="font-size:12pt;font-family:&quot;">--snmp-options=:::::3 \</span>
<span style="font-size:12pt;font-family:&quot;">--contextengineid=0x80001f8880711168720eb1e745 \</span>
<span style="font-size:12pt;font-family:&quot;">securev3user@192.168.1.100</span></pre>
<p>Our configuration for encrypted authentication and data privacy only would look like this:</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# cfgmaker --global 'WorkDir: /var/www/mrtg' \</span>
<span style="font-size:12pt;font-family:&quot;">--global 'Options[_]: growright, bits' \</span>
<span style="font-size:12pt;font-family:&quot;">--output=/etc/mrtg/192.168.1.100-secure.cfg \</span>
<span style="font-size:12pt;font-family:&quot;">--enablesnmpv3 --username=securev3user --authpassword=mandeville \</span>
<span style="font-size:12pt;font-family:&quot;">--authproto=md5 --privpassword=savlamar --privprotocol=des \</span>
<span style="font-size:12pt;font-family:&quot;">--snmp-options=:::::3 \</span>
<span style="font-size:12pt;font-family:&quot;">--contextengineid=0x80001f8880711168720eb1e745 \</span>
<span style="font-size:12pt;font-family:&quot;">securev3user@192.168.1.100</span></pre>
<p><strong>Note:</strong> The MRTG cfgmaker command reliably supports SNMPv3 as of MRTG version 2.15. Prior to this version you would commonly see this error when attempting to do DNMPv3 queries.</p>
<pre><span style="font-size:12pt;font-family:&quot;">SNMP V3 requires a --username parameter as part of the User Security Model for router securev3user@192.168.1.100:::::3 at ./cfgmaker line 121.</span></pre>
<p>2) Edit /etc/mrtg/mrtg.cfg, and remove the sections related to interfaces you don&#8217;t need to monitor. A certain candidate would be the virtual loopback interface Lo: (with the IP address of 127.0.0.1), which doesn&#8217;t pass any network traffic at all.</p>
<p>3) Run MRTG using /etc/mrtg/mrtg.cfg as your argument three times. You&#8217;ll get an error the two times as MRTG tries to move old data files, and naturally, the first time it is run, MRTG has no data files to move.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg</span>
<span style="font-size:12pt;font-family:&quot;">Rateup WARNING: /usr/bin/rateup could not read the primary log file for localhost_192.168.1.100</span>
<span style="font-size:12pt;font-family:&quot;">Rateup WARNING: /usr/bin/rateup The backup log file for localhost_192.168.1.100 was invalid as well</span>
<span style="font-size:12pt;font-family:&quot;">Rateup WARNING: /usr/bin/rateup Can't remove localhost_192.168.1.100.old updating log file</span>
<span style="font-size:12pt;font-family:&quot;">Rateup WARNING: /usr/bin/rateup Can't rename localhost_192.168.1.100.log to localhost_192.168.1.100.old updating log file</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg</span>
<span style="font-size:12pt;font-family:&quot;">Rateup WARNING: /usr/bin/rateup Can't remove localhost_192.168.1.100.old updating log file</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span></pre>
<p>4) Use MRTG&#8217;s indexmaker command to create a Web index page using your new mrtg.cfg file as a guide. The MRTG Web GUI expects to find the index file in the default MRTG Web directory of /var/www/mrtg/, so the format of the command would be.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# indexmaker --output=/var/www/mrtg/index.html \</span>
<span style="font-size:12pt;font-family:&quot;">/etc/mrtg/mrtg.cfg</span></pre>
<p>5) MRTG is run every five minutes by default, and the file that governs this is /etc/cron.d/mrtg. For MRTG to work correctly, edit this file, replacing all occurrences of /usr/bin/mrtg with env LANG=C /usr/bin/mrtg. The explanation for changing the language character set for MRTG is given in the &#8220;Troubleshooting MRTG&#8221; section.</p>
<p>This isn&#8217;t all, you need to view the graphs too. This will be covered later, but first I&#8217;ll show you how to poll multiple devices.</p>
<h2><a name="Getting_MRTG_To_Poll_Multiple_Devices"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Getting MRTG To Poll Multiple Devices</span></span></span><span style="font-size:12pt;"></span></h2>
<p>The Fedora Core MRTG installation process creates a cron file named /etc/cron.d/mrtg. This file tells the cron daemon to run MRTG using the /etc/mrtg/mrtg.cfg file every five minutes to poll your network devices. You can configure MRTG to poll multiple devices, each with a separate configuration file. Here&#8217;s how:</p>
<p>1) Create a new configuration file using the steps from the previous section; choose a filename that is not mrtg.cfg.</p>
<p>2) Add a new MRTG line in /etc/cron.d/mrtg for each new configuration file you create.</p>
<pre><span style="font-size:12pt;font-family:&quot;">0-59/5 * * * * root env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg</span>
<span style="font-size:12pt;font-family:&quot;">0-59/5 * * * * root env LANG=C /usr/bin/mrtg /etc/mrtg/device1.cfg</span>
<span style="font-size:12pt;font-family:&quot;">0-59/5 * * * * root env LANG=C /usr/bin/mrtg /etc/mrtg/device2.cfg<span>  </span></span></pre>
<p>3) Run the indexmaker command, and include all of your /etc/mrtg configuration files, to regenerate your Web index page.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# indexmaker --output=/var/www/mrtg/index.html \</span>
<span style="font-size:12pt;font-family:&quot;">/etc/mrtg/mrtg.cfg /etc/mrtg/device1.cfg /etc/mrtg/device2.cfg</span></pre>
<p>4) Other versions of Linux keep their MRTG cron entries inside the /etc/crontab file. Edit this file using the same syntax as the Fedora /etc/cron.d/mrtg file, and then restart the cron daemon to re-read the configuration:</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# service crond restart </span></pre>
<p>You could also create a script with the /usr/bin/mrtg /etc/mrtg/device.cfg entries in it and make cron run it every five minutes. This way you can just edit the script each time you add a device without having to restart cron.</p>
<h2><a name="Configuring_Apache_To_Work_With_MRTG"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Configuring Apache To Work With MRTG</span></span></span><span style="font-size:12pt;"></span></h2>
<p>MRTG is useful because it can provide a graphical representation of your server&#8217;s performance statistics via a Web browser.</p>
<p>With Fedora Core, MRTG creates an add-on configuration file named /etc/httpd/conf.d/mrtg.conf that includes all the necessary Apache commands for MRTG to work.</p>
<p>Some configuration may need to be done, because by default MRTG accepts Web requests from the Linux console only. You can add your home network to the file by inserting the network on the Allow from line, or you can allow universal access by commenting out that line along with the Deny from line. This example adds access from the 192.168.1.0 network.</p>
<pre><span style="font-size:12pt;font-family:&quot;">&lt;Location /mrtg&gt;</span>
<span style="font-size:12pt;font-family:&quot;"><span>    </span>Order deny,allow</span>
<span style="font-size:12pt;font-family:&quot;"><span>    </span>Deny from all</span>
<span style="font-size:12pt;font-family:&quot;"><span>    </span>Allow from localhost 192.168.1.0/24</span>
<span style="font-size:12pt;font-family:&quot;">&lt;/Location&gt;</span></pre>
<p>If you want to access MRTG from the Internet, then you&#8217;ll have to comment out the Deny statement and allow from all IP addresses:</p>
<pre><span style="font-size:12pt;font-family:&quot;">&lt;Location /mrtg&gt;</span>
<span style="font-size:12pt;font-family:&quot;"><span>    </span>Order deny,allow</span>
<span style="font-size:12pt;font-family:&quot;"><span>    </span>Allow from all</span>
<span style="font-size:12pt;font-family:&quot;">&lt;/Location&gt;</span></pre>
<p>Remember to restart Apache once you have made these modifications in order for these changes to take effect.</p>
<p><strong>Note:</strong> With newer versions of Fedora, Apache automatically reads the add-on files in the /etc/httpd/conf.d/ directory. With Fedora Core 1, you have to specifically configure the Apache configuration file /etc/httpd/conf/httpd.conf to find it. You can do this yourself by inserting this line at the very bottom of the main Apache configuration file before restarting Apache for the change to take effect.</p>
<pre><span style="font-size:12pt;font-family:&quot;">include "/etc/httpd/conf.d/mrtg.conf"</span></pre>
<h3><a name="Basic_Security"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Basic Security</span></span></span><span style="font-size:12pt;"></span></h3>
<p>If you are accessing MRTG graphs from the Internet, you may want to add password protection to the directory by using a .htaccess file as described in Chapter 20, &#8220;<a title="The Apache Web Server" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch20_:_The_Apache_Web_Server">The Apache Web Server</a>&#8220;.</p>
<h2><a name="How_To_View_The_MRTG_Graphs_In_Your_Web_"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">How To View The MRTG Graphs In Your Web Browser</span></span></span><span style="font-size:12pt;"></span></h2>
<p>You can now access your MRTG graphs by pointing your browser to the URL:</p>
<pre><span style="font-size:12pt;font-family:&quot;"><a title="http://server-ip-address/mrtg/" href="http://server-ip-address/mrtg/">http://server-ip-address/mrtg/</a></span></pre>
<h2><a name="Using_MRTG_To_Monitor_Other_Subsystems"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Using MRTG To Monitor Other Subsystems</span></span></span><span style="font-size:12pt;"></span></h2>
<p>MRTG will generate HTML pages with daily, weekly, monthly, and yearly statistics for your interfaces. By default, MRTG provides only network interface statistics. Chapter 23, &#8220;<a title="Advanced MRTG for Linux" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch23_:_Advanced_MRTG_for_Linux">Advanced MRTG for Linux</a>&#8220;, has detailed examples and explanations of how to monitor Linux disk, CPU, memory, and Web connection data. The MRTG Web site, www.mrtg.org, also has links to other sites that show you how to monitor many other subsystems on a variety of devices and operating systems.</p>
<h2><a name="Troubleshooting_MRTG"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Troubleshooting MRTG</span></span></span><span style="font-size:12pt;"></span></h2>
<p>There are many simple steps you can use to troubleshoot MRTG. Take a look at some of the most common ones.</p>
<h3><a name="Basic_Steps"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Basic Steps</span></span></span><span style="font-size:12pt;"></span></h3>
<p>MRTG won&#8217;t work if SNMP queries don&#8217;t work. Make sure you follow the SNMP troubleshooting steps if you have any difficulties.</p>
<h3><a name="Setting_The_Correct_Character_Set"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Setting The Correct Character Set</span></span></span><span style="font-size:12pt;"></span></h3>
<p>MRTG usually works only if your system uses an ASCII-based (Western European) character set. If it isn&#8217;t set, then you&#8217;ll get errors such as this every time you run MRTG from the command line or as part of a cron job:</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# mrtg /etc/mrtg/mrtg.cfg</span>
<span style="font-size:12pt;font-family:&quot;">-------------------------------------------------------------------</span>
<span style="font-size:12pt;font-family:&quot;">ERROR: Mrtg will most likely not work propperly when the environment</span>
<span style="font-size:12pt;font-family:&quot;"><span>       </span>variable LANG is set to UTF-8. Please run mrtg in an envir..</span>
<span style="font-size:12pt;font-family:&quot;"><span>       </span>where this is not the case:</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;"><span>       </span>env LANG=C /usr/bin/mrtg ...</span>
<span style="font-size:12pt;font-family:&quot;">-------------------------------------------------------------------</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span></pre>
<p>Your system&#8217;s character set is defined in /etc/sysconfig/i18n, and the current Fedora default of en_US.UTF-8 won&#8217;t work, but en_US will after a system reboot. This is not necessarily a good idea, especially if the native language Linux uses on your system is not ASCII based, other things may fail to work.</p>
<p>A better solution is to always run MRTG using this command instead of using just plain /usr/bin/mrtg.</p>
<pre><span style="font-size:12pt;font-family:&quot;">env LANG=C /usr/bin/mrtg</span></pre>
<p>This will modify the character set used by MRTG alone and shouldn&#8217;t affect anything else.</p>
<h3><a name="Incorrect_SNMPv3_Engine_ID"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Incorrect SNMPv3 Engine ID</span></span></span><span style="font-size:12pt;"></span></h3>
<p>The added security of SNMPv3 forces each client to create its own serial number or engine ID. If you use an incorrect identifier you may get noSuchInstance errors like this when polling with MRTG.</p>
<pre><span style="font-size:12pt;font-family:&quot;">2008-07-26 19:42:40: WARNING: Expected a number but got 'noSuchInstance'</span>
<span style="font-size:12pt;font-family:&quot;">2008-07-26 19:42:40: WARNING: Expected a number but got 'noSuchInstance'</span>
<span style="font-size:12pt;font-family:&quot;">2008-07-26 19:42:40: ERROR: Target[localhost_3][_IN_] ' $target-&gt;[1]{$mode} ' did not eval into defined data</span>
<span style="font-size:12pt;font-family:&quot;">2008-07-26 19:42:40: ERROR: Target[localhost_3][_OUT_] ' $target-&gt;[1]{$mode} ' did not eval into defined data</span></pre>
<p>Always make sure you are using the correct ID and try again.</p>
<h3><a name="Fedora_Core_1_MRTG_Errors_With_Net-SNMP"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">Fedora Core 1 MRTG Errors With Net-SNMP</span></span></span><span style="font-size:12pt;"></span></h3>
<p>A bug appears in the MRTG implementation for some Fedora Core 1 MRTG versions when polling another Fedora Core 1 server.</p>
<p>When using a -ifref=ip statement with the cfgmaker command, every line in the configuration file that is generated becomes commented out. When it works, this statement is very convenient, because it makes MRTG provide graphs sorted by the IP addresses of the interfaces instead of the default, which is the much harder to recognize interface MAC address. Upgrading to the latest Core 1 version of MRTG will fix the problem.</p>
<pre><span style="font-size:12pt;font-family:&quot;">### Interface 6 &gt;&gt; Descr: <em><span> </span>| Name: </em><span> </span>| Ip: '192.168.1.100'</span>
<span style="font-size:12pt;font-family:&quot;">###</span>
<span style="font-size:12pt;font-family:&quot;">### The following interface is commented out because:</span>
<span style="font-size:12pt;font-family:&quot;">### * has a speed of which makes no sense</span>
<span style="font-size:12pt;font-family:&quot;">### * got 'Received SNMP response with error code</span>
<span style="font-size:12pt;font-family:&quot;">###<span>       </span>error status: noSuchName</span>
<span style="font-size:12pt;font-family:&quot;">###<span>       </span>index 1 (OID: 1.3.6.1.2.1.2.2.1.10.6)</span>
<span style="font-size:12pt;font-family:&quot;">###<span>     </span>SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)</span>
<span style="font-size:12pt;font-family:&quot;">###<span>                       </span>community: "craz33guy"</span>
<span style="font-size:12pt;font-family:&quot;">###<span>                      </span>request ID: 824482716</span>
<span style="font-size:12pt;font-family:&quot;">###<span>                     </span>PDU bufsize: 8000 bytes</span>
<span style="font-size:12pt;font-family:&quot;">###<span>                         </span>timeout: 2s</span>
<span style="font-size:12pt;font-family:&quot;">###<span>                         </span>retries: 5</span>
<span style="font-size:12pt;font-family:&quot;">#</span>
<span style="font-size:12pt;font-family:&quot;"># Target[localhost_192.168.1.100]: /192.168.1.100:craz33guy@localhost:</span>
<span style="font-size:12pt;font-family:&quot;"># SetEnv[localhost_192.168.1.100]: MRTG_INT_IP="192.168.1.100" MRTG_INT_DES</span>
<span style="font-size:12pt;font-family:&quot;"># MaxBytes[localhost_192.168.1.100]: 0</span>
<span style="font-size:12pt;font-family:&quot;"># Title[localhost_192.168.1.100]: Traffic Analysis for 192.168.1.100</span>
<span style="font-size:12pt;font-family:&quot;"># PageTop[localhost_192.168.1.100]: Traffic Analysis for 192.168.1.100</span></pre>
<p>As all the lines in the configuration file are commented out with a # character, indexmaker fails to create an index.html file and gives errors.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# indexmaker --output=/var/www/mrtg/stats/index.html /etc/mrtg/mrtg.cfg</span>
<span style="font-size:12pt;font-family:&quot;">Use of uninitialized value in hash element at /usr/bin/indexmaker line 307.</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span></pre>
<h1><a name="Webalizer"></a><span class="mw-headline"><span style="font-size:12pt;"><span style="color:#008000;">Webalizer</span> </span></span><span style="font-size:12pt;"></span></h1>
<p>Webalizer is a Web server log file analysis tool that comes installed by default on RedHat/Fedora Linux. Each night, Webalizer reads your Apache log files and creates a set of Web pages that enable you to view Web surfer statistics for your site. The information provided includes a list of your Web site&#8217;s most popular pages sorted by hits along with traffic graphs showing the times of day when your site is most popular.</p>
<h2><a name="How_To_View_Your_Webalizer_Statistics"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">How To View Your Webalizer Statistics</span></span></span><span style="font-size:12pt;"></span></h2>
<p>Fedora creates an add-on configuration file named /etc/httpd/conf.d/Webalizer.conf that includes all the necessary Apache commands for Webalizer to work. As in the case of the MRTG add-on file mentioned above, you have to edit it to allow access to the Webalizer pages from locations other than the Linux console. You also have to restart Apache to make the changes take effect.</p>
<p>By default, Webalizer places its index page in the directory /var/www/html/usage and allows you to view your data by visiting the URL <a title="http://server-ip-address/usage" href="http://server-ip-address/usage">http://server-ip-address/usage</a>.</p>
<h2><a name="The_Webalizer_Configuration_File"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">The Webalizer Configuration File</span></span></span><span style="font-size:12pt;"></span></h2>
<p>Webalizer stores its configuration in the file /etc/Webalizer.conf. The default settings should be sufficient for your Web server, but you may want to adjust the directory in which Webalizer places your graph statistics. This can be adjusted with the OutputDir directive in the file. After adjustments, Webalizer functions with few annoyances; however, be aware that running in quiet mode could hide deeper problems that could occur in future.</p>
<h1><a name="The_top_Command"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">The top Command</span></span></span><span style="font-size:12pt;"></span></h1>
<p>You can monitor the amount of memory and CPU resources your system is using the top command.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# top</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;"><span>  </span>3:04pm<span>  </span>up 25 days, 23:23,<span>  </span>2 users,<span>  </span>load average: 0.00, 0.02, 0.00</span>
<span style="font-size:12pt;font-family:&quot;">78 processes: 76 sleeping, 2 running, 0 zombie, 0 stopped</span>
<span style="font-size:12pt;font-family:&quot;">CPU states:<span>  </span>0.9% user,<span>  </span>0.5% system,<span>  </span>0.0% nice,<span>  </span>0.8% idle</span>
<span style="font-size:12pt;font-family:&quot;">Mem:<span>   </span>384716K av,<span>  </span>327180K used,<span>   </span>57536K free,<span>       </span>0K shrd,<span>  </span>101544K buff</span>
<span style="font-size:12pt;font-family:&quot;">Swap:<span>  </span>779112K av,<span>       </span>0K used,<span>  </span>779112K free<span>                  </span>130776K cached</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;"><span>  </span>PID USER<span>     </span>PRI<span>  </span>NI<span>  </span>SIZE<span>   </span>RSS SHARE STAT %CPU %MEM<span>   </span>TIME COMMAND</span>
<span style="font-size:12pt;font-family:&quot;">27191 root<span>     </span><span> </span>15<span>   </span>0<span>  </span>1012 1012<span>   </span>780 R<span>     </span>5.6<span>  </span>0.2<span>   </span>0:00 top</span>
<span style="font-size:12pt;font-family:&quot;"> 4545 root<span>      </span>16<span>   </span>0<span>  </span>5892 5888<span>  </span>4956 S<span>     </span>0.9<span>  </span>1.5 169:26 magicdev</span>
<span style="font-size:12pt;font-family:&quot;"><span>    </span>1 root<span>      </span>15<span>   </span>0<span>   </span>476<span>   </span>476<span>   </span>432 S<span>     </span>0.0<span>  </span>0.1<span>   </span>0:05 init</span>
<span style="font-size:12pt;font-family:&quot;"><span>    </span>2 root<span>      </span>15<span>   </span>0<span>     </span>0<span>     </span>0<span>     </span>0 SW<span>    </span>0.0<span>  </span>0.0<span>   </span>0:00 keventd</span>
<span style="font-size:12pt;font-family:&quot;"><span>    </span>5 root<span>      </span>15<span>   </span>0<span>     </span>0<span>     </span>0<span>     </span>0 SW<span>    </span>0.0<span>  </span>0.0<span>   </span>0:41 kswapd</span>
<span style="font-size:12pt;font-family:&quot;"><span>    </span>6 root<span>      </span>25<span>   </span>0<span>     </span>0<span>     </span>0<span>     </span>0 SW<span>    </span>0.0<span>  </span>0.0<span>   </span>0:00 bdflush</span>
<span style="font-size:12pt;font-family:&quot;"> </span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span></pre>
<p>Here the CPU usage is under 1.0% and 14% of memory (57536K) is free. The amount of free memory may appear low, but in this case, the server doesn&#8217;t seem to be swapping idle processes from memory to the swap disk partition as it isn&#8217;t being used at all. Excessive swapping can cause your system to slow down dramatically, the simplest ways to avoid this is to add more RAM or reduce the number of processes or users that are active on your system.</p>
<p>If your system seems slow but the CPU and memory usage is low, then start looking at networking problems, such as poor duplex negotiation, bad cables, and network congestion due to excessive traffic.</p>
<h1><a name="The_vmstat_Command"></a><span style="color:#008000;"><span class="mw-headline"><span style="font-size:12pt;">The vmstat Command</span></span></span><span style="font-size:12pt;"></span></h1>
<p>You can also determine memory and swap usage with the vmstat command, which provides a summary of what top produces. In the example, memory is still 14% free (57,452MB used from a total of 130,780) and swap isn&#8217;t being used at all.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# vmstat</span>
<span style="font-size:12pt;font-family:&quot;"><span>   </span>procs<span>                       </span>memory<span>    </span>swap<span>          </span>io<span>     </span>system<span>         </span>cpu</span>
<span style="font-size:12pt;font-family:&quot;"><span>  </span>r<span>  </span>b<span>  </span>w<span>   </span>swpd<span>   </span>free<span>   </span>buff<span>   </span>cache<span>  </span>si<span>  </span>so<span>    </span>bi<span>    </span>bo<span>   </span>in<span>    </span>cs<span>  </span>us<span>  </span>sy<span>  </span>id</span>
<span style="font-size:12pt;font-family:&quot;"><span>  </span>0<span>  </span>0<span>  </span>0<span>      </span>0<span>  </span>57452 101584 130780<span>   </span>0<span>   </span>0<span>     </span>0<span>     </span>4<span>   </span>18<span>     </span>1<span>   </span>3<span>   </span>1<span>   </span>1</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span></pre>
<p>As your memory fills up, your system will temporarily store programs and data on your hard disk&#8217;s &#8220;swap&#8221; partition. Excess swapping of programs and data between disk and memory can cause your system to slow down significantly and memory usage should be monitored to allow you to plan ways to either increase RAM or tune the way your system operates. System tuning is beyond the scope of this book, but there are many reference guides which can show you how to do this.</p>
<h1><a name="The_free_Utility"></a><span class="mw-headline"><span style="font-size:12pt;"><span style="color:#008000;">The free Utility</span> </span></span><span style="font-size:12pt;"></span></h1>
<p>The free utility can determine the amount of free RAM on your system. The output is easier to understand than vmstat&#8217;s. Here&#8217;s a sample.</p>
<pre><span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]# free</span>
<span style="font-size:12pt;font-family:&quot;"><span>             </span>total<span>       </span>used<span>       </span>free <span>    </span>shared<span>     </span>buffers<span>     </span>cached</span>
<span style="font-size:12pt;font-family:&quot;">Mem:<span>        </span>126060<span>     </span>119096<span>       </span>6964<span>          </span>0<span>       </span>58972<span>      </span>40028</span>
<span style="font-size:12pt;font-family:&quot;">-/+ buffers/cache:<span>      </span>20096<span>     </span>105964</span>
<span style="font-size:12pt;font-family:&quot;">Swap:<span>       </span>522072<span>       </span>15496<span>     </span>506576</span>
<span style="font-size:12pt;font-family:&quot;">[root@bigboy tmp]#</span></pre>
<p>You should generally try to make your system run with at least 20% free memory on average, which should allow it to handle moderate spikes in usage caused by running memory-intensive cron batch jobs or tape backups. If you cannot achieve this, consider running more efficient versions of programs, offloading some applications to servers with less load, and, of course, upgrading the capacity of your RAM.</p>
<h1><a name="Conclusion"></a><span class="mw-headline"><span style="font-size:12pt;"><span style="color:#008000;">Conclusion</span> </span></span><span style="font-size:12pt;"></span></h1>
<p>Server monitoring is always a good practice, because it can help you predict when things are going to go wrong or long term trends in your Web traffic.</p>
<p>MRTG can be expanded not only to monitor traffic on your server&#8217;s NIC cards, but also to graph many of the statistics listed in top, free, and vmstat. Chapter 23, &#8220;<a title="Advanced MRTG for Linux" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch23_:_Advanced_MRTG_for_Linux">Advanced MRTG for Linux</a>&#8220;, shows you how</p>
<p class="MsoNormal">
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/katulis.wordpress.com/85/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/katulis.wordpress.com/85/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katulis.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katulis.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katulis.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katulis.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katulis.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katulis.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katulis.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katulis.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katulis.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katulis.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katulis.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katulis.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katulis.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katulis.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=85&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katulis.wordpress.com/2008/08/04/snmp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf99585bec1f921469053ef9c69b17f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">breaker</media:title>
		</media:content>

		<media:content url="/DOCUME~1/KURNIA~1/LOCALS~1/Temp/msohtml1/04/clip_image001.gif" medium="image">
			<media:title type="html">Snmp.gif</media:title>
		</media:content>

		<media:content url="/DOCUME~1/KURNIA~1/LOCALS~1/Temp/msohtml1/04/clip_image002.gif" medium="image">
			<media:title type="html">Mrtg.gif</media:title>
		</media:content>
	</item>
		<item>
		<title>Install MRTG</title>
		<link>http://katulis.wordpress.com/2008/07/29/install-mrtg/</link>
		<comments>http://katulis.wordpress.com/2008/07/29/install-mrtg/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 16:26:48 +0000</pubDate>
		<dc:creator>katulis</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://katulis.wordpress.com/?p=81</guid>
		<description><![CDATA[If you want to download MRTG you can download from here Preparing you System for MRTG Instalaltion First you need to install the required compilers #apt-get install gcc make g++ Apache 2 Installation with perl support Follow these instructions to install apache2 with perl support MRTG Installation Now we need to install mrtg and snmp [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=81&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you want to download MRTG you can download from here<br />
Preparing you System for MRTG Instalaltion<br />
First you need to install the required compilers<br />
#apt-get install gcc make g++</p>
<p>Apache 2 Installation with perl support<br />
Follow these instructions to install apache2 with perl support</p>
<p>MRTG Installation<br />
Now we need to install mrtg and snmp<br />
Installing MRTG in Debian, Ubuntu and Kubuntu<span id="more-81"></span><br />
#apt-get install mrtg snmpd<br />
The installation will create an mrtg subdirectory where the Apache Web pages reside. On your Debian,ubnutu,kubuntu systems the path of this subdirectory is:<br />
/var/www/mrtg</p>
<p>Now you need to edit the mrtg configuration file to edit the some of the settings<br />
File is located at /etc/mrtg.cfg you need to change the global settings as follows<br />
# Global Settings</p>
<p>RunAsDaemon: yes<br />
EnableIPv6: no<br />
WorkDir: /var/www/mrtg<br />
Options[_]: bits,growright<br />
WriteExpires: Yes</p>
<p>Title[^]: Traffic Analysis for</p>
<p>You will find a crontab running every 5 minutes as user root<br />
# cat /etc/cron.d/mrtg<br />
0-55/5 * * * * root if [ -x /usr/bin/mrtg ] &amp;&amp; [ -r /etc/mrtg.cfg ]; then env LANG=C /usr/bin/mrtg /etc/mrtg.cfg &gt;&gt; /var/log/mrtg/mrtg.log 2&gt;&amp;1; fi</p>
<p>Now we need to assign the snmp community name in snmp configration file /etc/snmp/snmpd.conf<br />
# sec.name source community<br />
# com2sec paranoid default public<br />
com2sec readonly default public<br />
#com2sec readwrite default private</p>
<p>Now you need to restart the snmp service<br />
#/etc/init.d/snmpd restart</p>
<p>The configuration file creating using<br />
#cfgmaker public@localhost &gt; /etc/mrtg.cfg</p>
<p>Creating a configuration file for a device using cfgmaker<br />
#cfgmaker public@192.168.0.1 &gt;&gt; /etc/mrtg.cfg</p>
<p>With the configuration file created correctly there’s only one other thing you have to do and that’s to use the indexmaker utility to create the summary home page. Since you have to re-run this command every time you make certain changes to the /etc/mrtg.cfg configuration file.</p>
<p>Creating index file for the webserver using indexmaker<br />
#indexmaker /etc/mrtg.cfg &gt; /var/www/mrtg/index.html</p>
<p>Now you need to reboot your system wait for five minutes or so and then take a look at your summary home page. If your Debian,ubuntu,kubuntu system’s IP address is 192.168.0.1 then you’d type in the following in the address bar of a browser running on a system on the same network:</p>
<p>http://192.168.0.1/mrtg/</p>
<p>Your summary home page should come up with a graph for each target entry in the configuration file. If a graph looks like there’s no data on it, click on it and check the statistics to see if any traffic is being seen. Small amounts of traffic won’t show up on the graphs because we used the Unscaled statement</p>
<p>Some of examples how to monitor cpu , memory , Disk usage<br />
CPU Usage<br />
/etc/mrtg/cpu.cfg</p>
<p>WorkDir: /var/www/mrtg<br />
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt<br />
Target[localhost.cpu]:ssCpuRawUser.0&amp;ssCpuRawUser.0:public@127.0.0.1+ ssCpuRawSystem.0&amp;ssCpuRawSystem.0:public@127.0.0.1+<br />
ssCpuRawNice.0&amp;ssCpuRawNice.0:public@127.0.0.1<br />
RouterUptime[localhost.cpu]: public@127.0.0.1<br />
MaxBytes[localhost.cpu]: 100<br />
Title[localhost.cpu]: CPU Load<br />
PageTop[localhost.cpu]: Active CPU Load %<br />
Unscaled[localhost.cpu]: ymwd<br />
ShortLegend[localhost.cpu]: %<br />
YLegend[localhost.cpu]: CPU Utilization<br />
Legend1[localhost.cpu]: Active CPU in % (Load)<br />
Legend2[localhost.cpu]:<br />
Legend3[localhost.cpu]:<br />
Legend4[localhost.cpu]:<br />
LegendI[localhost.cpu]: Active<br />
LegendO[localhost.cpu]:<br />
Options[localhost.cpu]: growright,nopercent</p>
<p>Memory Usage<br />
/etc/mrtg/mem.cfg</p>
<p>LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt<br />
Target[localhost.mem]: .1.3.6.1.4.1.2021.4.6.0&amp;.1.3.6.1.4.1.2021.4.6.0:public@localhost<br />
PageTop[localhost.mem]:Free Memory<br />
WorkDir: /var/www/mrtg<br />
Options[localhost.mem]: nopercent,growright,gauge,noinfo<br />
Title[localhost.mem]: Free Memory<br />
MaxBytes[localhost.mem]: 1000000<br />
kMG[localhost.mem]: k,M,G,T,P,X<br />
YLegend[localhost.mem]: bytes<br />
ShortLegend[localhost.mem]: bytes<br />
LegendI[localhost.mem]: Free Memory:<br />
LegendO[localhost.mem]:<br />
Legend1[localhost.mem]: Free memory, not including swap, in bytes</p>
<p>Memory Monitoring (Total Versus Available Memory)<br />
/etc/mrtg/memfree.cfg<br />
LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt<br />
Target[server.memory]: memAvailReal.0&amp;memTotalReal.0:public@localhost<br />
Title[server.memory]: Free Memory<br />
PageTop[server.memory]: &lt; H1 &gt;Free Memory&lt; /H1 &gt;<br />
MaxBytes[server.memory]: 100000000000<br />
ShortLegend[server.memory]: B<br />
YLegend[server.memory]: Bytes<br />
LegendI[server.memory]: Free<br />
LegendO[server.memory]: Total<br />
Legend1[server.memory]: Free memory, not including swap, in bytes<br />
Legend2[server.memory]: Total memory<br />
Options[server.memory]: gauge,growright,nopercent<br />
kMG[server.memory]: k,M,G,T,P,X</p>
<p>Memory Monitoring (Percentage usage)</p>
<p>/etc/mrtg/mempercent.cfg<br />
LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt<br />
Title[server.mempercent]: Percentage Free Memory<br />
PageTop[server.mempercent]: &lt; H1 &gt;Percentage Free Memory&lt; /H1 &gt;<br />
Target[server.mempercent]: ( memAvailReal.0&amp;memAvailReal.0:publicy@localhost ) * 100 / ( memTotalReal.0&amp;memTotalReal.0:public@localhost )<br />
options[server.mempercent]: growright,gauge,transparent,nopercent<br />
Unscaled[server.mempercent]: ymwd<br />
MaxBytes[server.mempercent]: 100<br />
YLegend[server.mempercent]: Memory %<br />
ShortLegend[server.mempercent]: Percent<br />
LegendI[server.mempercent]: Free<br />
LegendO[server.mempercent]: Free<br />
Legend1[server.mempercent]: Percentage Free Memory<br />
Legend2[server.mempercent]: Percentage Free Memory</p>
<p>Disk Usage<br />
/etc/mrtg/disk.cfg<br />
LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt<br />
Target[server.disk]: dskPercent.1&amp;dskPercent.2:public@localhost<br />
Title[server.disk]: Disk Partition Usage<br />
PageTop[server.disk]: &lt; H1 &gt;Disk Partition Usage /home and /var&lt; /H1 &gt;<br />
MaxBytes[server.disk]: 100<br />
ShortLegend[server.disk]: %<br />
YLegend[server.disk]: Utilization<br />
LegendI[server.disk]: /home<br />
LegendO[server.disk]: /var<br />
Options[server.disk]: gauge,growright,nopercent<br />
Unscaled[server.disk]: ymwd</p>
<p>Creating jobs for CPU , Memory and Disk Usage</p>
<p>CPU<br />
/etc/cron.mrtg/cpu</p>
<p>#!/bin/sh<br />
/usr/bin/mrtg /etc/mrtg/cpu.cfg</p>
<p>Memory<br />
/etc/cron.mrtg/mem</p>
<p>#!/bin/sh<br />
/usr/bin/mrtg /etc/mrtg/mem.cfg</p>
<p>Memory Free<br />
/etc/cron.mrtg/memfree</p>
<p>#!/bin/sh<br />
/usr/bin/mrtg /etc/mrtg/memfree.cfg</p>
<p>Memory Percentage<br />
/etc/cron.mrtg/mempercent</p>
<p>#!/bin/sh<br />
/usr/bin/mrtg /etc/mrtg/mempercent.cfg</p>
<p>Disk<br />
/etc/cron.mrtg/disk</p>
<p>#!/bin/sh<br />
/usr/bin/mrtg /etc/mrtg/disk.cfg</p>
<p>Run each script 3 times (disregard the warnings)<br />
/etc/cron.mrtg/cpu<br />
/etc/cron.mrtg/mem<br />
/etc/cron.mrtg/memfree<br />
/etc/cron.mrtg/mempercent<br />
/etc/cron.mrtg/disk</p>
<p>Make the Index Files<br />
#/usr/bin/indexmaker –output=/var/www/mrtg/index.html \<br />
–title=”Memory and CPU Usage ” \<br />
–sort=name \<br />
–enumerate \<br />
/etc/mrtg/cpu.cfg \<br />
/etc/mrtg/mem.cfg \<br />
/etc/cron.mrtg/memfree \<br />
/etc/cron.mrtg/mempercent \<br />
/etc/cron.mrtg/disk</p>
<p>Make the mrtg.cfg file<br />
#cfgmaker –global “WorkDir: /var/www/mrtg/” \<br />
–global “Options[_]: growright,bits” \<br />
–ifref=ip \<br />
public@localhost &gt; /etc/mrtg/mrtg.conf</p>
<p>Cronjob setup<br />
/bin/cat &gt;&gt; /var/spool/cron/crontabs/root<br />
*/5 * * * * /bin/run-parts /etc/cron.mrtg 1&gt; /dev/null</p>
<p>Now you logon to your web browser http://192.168.0.1/mrtg/ and Now you should see CPU,Memory and Disk Usage graphs.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/katulis.wordpress.com/81/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/katulis.wordpress.com/81/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katulis.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katulis.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katulis.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katulis.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katulis.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katulis.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katulis.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katulis.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katulis.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katulis.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katulis.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katulis.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katulis.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katulis.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=81&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katulis.wordpress.com/2008/07/29/install-mrtg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf99585bec1f921469053ef9c69b17f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">breaker</media:title>
		</media:content>
	</item>
		<item>
		<title>Install Denyhosts</title>
		<link>http://katulis.wordpress.com/2008/07/28/install-denyhosts/</link>
		<comments>http://katulis.wordpress.com/2008/07/28/install-denyhosts/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 21:58:58 +0000</pubDate>
		<dc:creator>katulis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://katulis.wordpress.com/?p=77</guid>
		<description><![CDATA[Kali ini saya akan mencoba cara menginstall denyhost dan menjalankannya. Denyhost berguna untuk melindungi akses via ssh dari orang tidakmemiliki akses di server kita. Cara kerja denyhost dengan melihat log authentication yang ada di /var/log/auth.log dengan cara memblokir IP address yang login ke server kita dengan password dan username yang salah. Bahasa kerennya Preventing SSH [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=77&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span class="entry">Kali ini saya akan mencoba cara menginstall denyhost dan menjalankannya. Denyhost berguna untuk melindungi akses via ssh dari orang tidakmemiliki akses di server kita. Cara kerja denyhost dengan melihat log authentication yang ada di <span style="color:#0000ff;">/var/log/auth.log</span> dengan cara memblokir IP address yang login ke server kita dengan password dan username yang salah. Bahasa kerennya Preventing SSH Dictionary Attack <img class="wp-smiley" src="http://spyd3r.890m.com/wp-includes/images/smilies/icon_razz.gif" alt="-P" /> . Sehingga IP yang pernah mencoba login ke komputer kita akan dimasukkan daftar Blacklist <span style="color:#0000ff;">/etc/hosts.deny</span>. Berikut ini cara melakukan installasi Denyhosts dimana saya disini menggunakan distro Debian Etch.</span><span id="more-77"></span></p>
<p><span style="color:#008000;"><strong>1. Cara instalasi</strong></span><br />
Pastikan di server anda sudah terdapat python compiler, jika belum ada anda dapat install dengan cara :</p>
<blockquote><p>#<span style="color:#ff0000;">sudo apt-get install python</span></p></blockquote>
<p>Kemudian download dan install denyhost</p>
<blockquote><p>#<span style="color:#ff0000;">cd /tmp</span><br />
#<span style="color:#ff0000;">wget http://internode.dl.sourceforge.net/sourceforge/denyhosts/DenyHosts-2.6.tar.gz</span><br />
#<span style="color:#ff0000;">tar xvfz DenyHosts-2.6.tar.gz</span><br />
#<span style="color:#ff0000;">cd DenyHosts-2.6</span><br />
#<span style="color:#ff0000;">python setup.py install</span></p></blockquote>
<p><span style="color:#008000;"><strong>2. Setting DenyHost</strong></span></p>
<blockquote><p>#<span style="color:#ff0000;">cd /usr/share/denyhosts</span><br />
#<span style="color:#ff0000;">cp denyhosts.cfg-dist denyhosts.cfg</span></p></blockquote>
<p>Edit <span style="color:#0000ff;">denyhost.cfg</span> dengan editor kesayangan anda, dalam hal ini saya menggunakan nano</p>
<blockquote><p>#nano denyhosts.cfg</p></blockquote>
<p>Pastikan file <span style="color:#0000ff;">SECURE_LOG = /var/log/auth.log</span> dan <span style="color:#0000ff;">LOCK_FILE = /var/run/denyhosts.pid</span><strong> </strong>sudah dikonfigurasi sesuai versi linux anda, dalam hal ini saya menggunakan xubuntu :</p>
<ul>
<li><span style="color:#ff0000;"> SECURE_LOG = /var/log/auth.log</span></li>
<li><span style="color:#ff0000;"> LOCK_FILE = /var/run/denyhosts.pid</span></li>
</ul>
<p>Menjalankan denyhost di daemon :</p>
<blockquote><p>#<span style="color:#ff0000;">cp daemon-control-dist daemon-control</span></p></blockquote>
<p>Edit /usr/share/denyhosts/daemon-control , pastikan setting untuk <span style="color:#0000ff;">DENYHOSTS_BIN, DENYHOSTS_LOCK, dan DENYHOSTS_CFG</span> sudah benar semuanya. Untuk setting xubuntu :</p>
<ul>
<li><span style="color:#ff6600;"> DENYHOSTS_BIN = “/usr/bin/denyhosts.py”</span></li>
<li><span style="color:#ff6600;"> DENYHOSTS_LOCK = “/var/run/denyhosts.pid”</span></li>
<li><span style="color:#ff6600;"> DENYHOSTS_CFG = “/usr/share/denyhosts/denyhosts.cfg”</span></li>
</ul>
<p>Menjalankan denyhosts secara otomatis ketika komputer booting :</p>
<blockquote><p>#<span style="color:#ff0000;">chmod 700 daemon-control</span><br />
#<span style="color:#ff0000;">cd /etc/init.d</span><br />
#<span style="color:#ff0000;">ln -s /usr/share/denyhosts/daemon-control denyhosts update-rc.d denyhosts defaults</span><br />
#<span style="color:#ff0000;">/etc/init.d/denyhosts start</span></p></blockquote>
<p><span style="color:#008000;"><strong>Uji Coba</strong></span><br />
Sekarang anda coba login via ssh dari komputer lain dengan memasukkan username dan password yang salah maka secara otomatis IP komputer tersebut akan di blok. Anda bisa melihat IP komputer yang di blok di <span style="color:#0000ff;">/etc/hosts.deny</span> :</p>
<blockquote>
<pre>Added the following hosts to /etc/hosts.deny:

202.84.98.6 (unknown)
194.228.207.66 (mail.gymck.cz)
207.88.140.90 (207.88.140.90.ptr.us.xo.net)
87.139.28.188 (mail.kuepper.de)
218.3.204.139 (unknown)
121.8.140.90 (unknown)
211.233.81.115 (unknown)
202.148.162.109 (unknown)
202.96.102.239 (unknown)
211.234.93.134 (unknown)</pre>
</blockquote>
<p>Untuk membuka akses IP yang di blok, anda tinggal menghapus dari daftar <span style="color:#0000ff;">/etc/hosts.deny</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/katulis.wordpress.com/77/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/katulis.wordpress.com/77/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katulis.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katulis.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katulis.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katulis.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katulis.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katulis.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katulis.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katulis.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katulis.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katulis.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katulis.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katulis.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katulis.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katulis.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=77&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katulis.wordpress.com/2008/07/28/install-denyhosts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf99585bec1f921469053ef9c69b17f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">breaker</media:title>
		</media:content>

		<media:content url="http://spyd3r.890m.com/wp-includes/images/smilies/icon_razz.gif" medium="image">
			<media:title type="html">-P</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing LogWatch</title>
		<link>http://katulis.wordpress.com/2008/07/24/whats-logwatch/</link>
		<comments>http://katulis.wordpress.com/2008/07/24/whats-logwatch/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 17:22:57 +0000</pubDate>
		<dc:creator>katulis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://katulis.wordpress.com/?p=66</guid>
		<description><![CDATA[What&#8217;s LogWatch According its official website, Logwatch is a customizable log analysis system. Logwatch parses through your system&#8217;s logs for a given period of time and creates a report analyzing areas that you specify, in as much detail as you require. Logwatch is easy to use and will work right out of the package on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=66&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#008000;"><strong><span>What&#8217;s LogWatch</span></strong></span></p>
<p>According its official website, Logwatch is a customizable log analysis system. Logwatch parses through your system&#8217;s logs for a given period of time and creates a report analyzing areas that you specify, in as much detail as you require. Logwatch is easy to use and will work right out of the package on most systems.</p>
<p><span style="color:#008000;">LogWatch configuration</span></p>
<p>Since in Engarde&#8217;s repositories there still aren&#8217;t any Extra Packages for LogWatch you have to download and build it from sources. You can download it from the official home page here.<br />
<span id="more-66"></span><br />
Once you logged in as root since there is no SELinux Policy loaded for LogWatch and you&#8217;re not allowed by default using WGET you have to switch into permissive mode by typing the following commands:</p>
<p># <span style="color:#ff0000;">newrole -r sysadm_r</span><br />
# <span style="color:#ff0000;">setenforce 0</span></p>
<p>The permissive mode now allows you to use wget and download the sources:</p>
<p># <span style="color:#ff0000;">wget ftp://ftp.kaybee.org/pub/old/linux/logwatch-7.3.5.tar.gz</span></p>
<p>Now run the following commands:</p>
<p># tar xzf logwatch-7.3.4.tar.gz<br />
# <span style="color:#ff0000;">cd logwatch-7.3.4/</span><br />
# <span style="color:#ff0000;">mkdir /etc/log.d/</span><br />
# <span style="color:#ff0000;">cp -R conf lib scripts /etc/log.d</span><br />
# (cd /usr/bin &amp;&amp; ln -s ../../etc/log.d/scripts/logwatch.pl logwatch)</p>
<p>If want to build the package by using a simple bash-based installer run these commands:</p>
<p># <span style="color:#ff0000;">cd logwatch-7.3.4/</span><br />
# <span style="color:#ff0000;">chmod +x install_logwatch.sh</span><br />
#<span style="color:#ff0000;"> ./install_logwatch.sh</span><br />
<span style="color:#008000;"> LogWatch and Cron</span></p>
<p>If you want to run logwatch daily by using Cron you can simply make a symbolik link from the logwatch.pl script to /etc/cron.daily/logwatch.pl and the script will do the work daily.</p>
<p><span style="color:#008000;"> LogWatch Configuration</span></p>
<p>The default LogWatch configuration file is placed in /etc/log.d/conf/logwatch.conf. You can edit it by using your favourite editor if you want to add or remove some features to your default installation. You can simply understand the meaning of each line thanks to the comments.</p>
<p><span style="color:#008000;"> Using LogWatch</span></p>
<p>Now you&#8217;re ready to run LogWatch. Here some examples of use on our test machine.</p>
<p>The first:</p>
<p># <span style="color:#ff0000;">logwatch &#8211;print &#8211;detail High &#8211;archives &#8211;range All</span></p>
<p>Now we&#8217;re printing (&#8211;print) the informations on the standard output (monitor) with an high level of details (&#8211;detail High) including the archived logs (&#8211;archives) with all the messages of each date (&#8211;range ALL).</p>
<p>The second:</p>
<p># <span style="color:#ff0000;">logwatch &#8211;save logwatch.txt &#8211;range Today</span></p>
<p>We&#8217;re saving the output in the &#8220;logwatch.txt&#8221; file (&#8211;save logwatch.txt) regarding the current day (&#8211;range Today) using the the default parameters defined in the configuration file.</p>
<pre><em>thanks to: http://wiki.engardelinux.org/index.php/HOWTO:Installing_LogWatch</em></pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/katulis.wordpress.com/66/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/katulis.wordpress.com/66/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katulis.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katulis.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katulis.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katulis.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katulis.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katulis.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katulis.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katulis.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katulis.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katulis.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katulis.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katulis.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katulis.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katulis.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=66&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katulis.wordpress.com/2008/07/24/whats-logwatch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf99585bec1f921469053ef9c69b17f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">breaker</media:title>
		</media:content>
	</item>
		<item>
		<title>PortSentry</title>
		<link>http://katulis.wordpress.com/2008/07/24/portsentry/</link>
		<comments>http://katulis.wordpress.com/2008/07/24/portsentry/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 11:23:30 +0000</pubDate>
		<dc:creator>katulis</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://katulis.wordpress.com/?p=60</guid>
		<description><![CDATA[PortSentry adalah aplikasi yang dirancang untuk mendeteksi adanya scanning port suatu box dalam model real time. Perbedaan spesifik dengan IDS seperti Snort adalah portsentry melakukan aksi, sedangkan snort hanya mendeteksi saja. Instalasi : Ambil paket dari http://sourceforge.net/project/showfiles.php?group_id=80573 lalu ekstrak file tersebut # tar zxvf portsentry-1.2.tar.gz # cd portsentry_beta Edit file portsentry_config.h, lalu ganti baris berikut [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=60&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color:#008000;">PortSentry </span></strong>adalah aplikasi yang dirancang untuk mendeteksi adanya scanning port<br />
suatu box dalam model real time.<br />
Perbedaan spesifik dengan IDS seperti Snort adalah portsentry melakukan aksi,<br />
sedangkan snort hanya mendeteksi saja.</p>
<p>Instalasi :<br />
Ambil paket dari<br />
<span style="color:#0000ff;">http://sourceforge.net/project/showfiles.php?group_id=80573</span></p>
<p>lalu ekstrak file tersebut<span id="more-60"></span><br />
# <span style="color:#ff0000;">tar zxvf portsentry-1.2.tar.gz</span><br />
# <span style="color:#ff0000;">cd portsentry_beta</span></p>
<p>Edit file portsentry_config.h, lalu ganti baris berikut :<br />
#<span style="color:#ff9900;">define CONFIG_FILE &#8220;/usr/local/psionic/portsentry/portsentry.conf&#8221;</span></p>
<p>Menjadi</p>
<p>#<span style="color:#ff0000;">define CONFIG_FILE &#8220;/etc/portsentry/portsentry.conf&#8221;</span></p>
<p>Edit file portsentry.conf, lalu ganti baris berikut :<br />
######################<br />
# Configuration Files#<br />
######################<br />
#<br />
# Hosts to ignore<br />
<span style="color:#ff9900;">IGNORE_FILE=&#8221;/usr/local/psionic/portsentry/portsentry.ignore&#8221;</span><br />
# Hosts that have been denied (running history)<br />
<span style="color:#ff9900;">HISTORY_FILE=&#8221;/usr/local/psionic/portsentry/portsentry.history&#8221;</span><br />
# Hosts that have been denied this session only (temporary until next restart)<br />
<span style="color:#ff9900;">BLOCKED_FILE=&#8221;/usr/local/psionic/portsentry/portsentry.blocked&#8221;</span></p>
<p>Menjadi<br />
######################<br />
# Configuration Files#<br />
######################<br />
#<br />
# Hosts to ignore<br />
<span style="color:#ff0000;">IGNORE_FILE=&#8221;/etc/portsentry/portsentry.ignore&#8221;</span><br />
# Hosts that have been denied (running history)<br />
<span style="color:#ff0000;">HISTORY_FILE=&#8221;/etc/portsentry/portsentry.history&#8221;</span><br />
# Hosts that have been denied this session only (temporary until next restart)<br />
<span style="color:#ff0000;">BLOCKED_FILE=&#8221;/etc/portsentry/portsentry.blocked&#8221;</span></p>
<p>Juga pada baris :<br />
# iptables support for Linux<br />
#<span style="color:#ff9900;">KILL_ROUTE=&#8221;/usr/local/bin/iptables -I INPUT -s $TARGET$ -j DROP&#8221;</span></p>
<p>Menjadi<br />
# iptables support for Linux<br />
<span style="color:#ff0000;">KILL_ROUTE=&#8221;/usr/sbin/iptables -I INPUT -s $TARGET$ -j DROP&#8221;</span></p>
<p>PENTING:<br />
Untuk menentukan letak binary iptables Anda, lakukan perintah ini di shell.<br />
Berikut contoh pada box linux saya :<br />
# which iptables<br />
<span style="color:#0000ff;">/usr/sbin/iptables</span></p>
<p>Edit file Makefile, lalu ganti baris berikut :<br />
I<span style="color:#ff9900;">NSTALLDIR = /usr/local/psionic</span><br />
ke<br />
<span style="color:#ff0000;">INSTALLDIR = /etc</span></p>
<p>Kemudian compile<br />
#<span style="color:#ff0000;">make linux</span></p>
<p>Bila ada error seperti dibawah ini :<br />
<span style="color:#ff9900;">SYSTYPE=linux<br />
Making<br />
cc -O -Wall -DLINUX -DSUPPORT_STEALTH -o ./portsentry ./portsentry.c<br />
./portsentry_io.c ./portsentry_util.c<br />
portsentry.c:1584:11: missing terminating &#8221; character<br />
portsentry.c: In function `Usage&#8217;:<br />
portsentry.c:1585: error: syntax error before &#8220;sourceforget&#8221;<br />
portsentry.c:1585: error: stray &#8221; in program<br />
portsentry.c:1585:24: missing terminating &#8221; character<br />
make: *** [linux] Error 1</span></p>
<p>maka edit portsentry.c, hilangkan baris 1585, lalu pada baris 1584, edit menjadi demikian:<br />
<span style="color:#ff0000;">printf (&#8220;Copyright 1997-2003 Craig H. Rowland n”);</span></p>
<p>Lalu, coba jalankan kembali perintah<br />
#<span style="color:#ff0000;"> make linux</span></p>
<p>Kemudian install<br />
#<span style="color:#ff0000;"> make install</span></p>
<p>Jika lancar, coba cek ke direktori /etc/portsentry</p>
<p># ls /etc/portsentry<br />
portsentry*  portsentry.conf  portsentry.ignore</p>
<p>Akan tercipta file2 seperti diatas.</p>
<p>Berikut penjelasan file2 diatas :</p>
<p><span style="color:#008000;">- portsentry</span><br />
File ini adalah binary portsentry. Anda perlu mengeksekusi file ini bila ingin menjalankan aplikasi<br />
portsentry</p>
<p><span style="color:#008000;">- portsentry.conf</span><br />
File ini adalah file konfigurasi portsentry<br />
Sekarang Anda siap menjalankan aplikasi portsentry :</p>
<p><span style="color:#008000;">- portsentry.ignore</span><br />
File ini berisikan list ip yang diabaikan atau ip yang tidak di blok oleh portsentry</p>
<p>Edit file portsentry.ignore dan pastikan ip local dan ip static Anda terdaftar didalamnya, misalnya :<br />
<span style="color:#ff0000;">127.0.0.1/32<br />
202.78.xxx.xxx  <span style="color:#ff9900;">&#8211;&gt; ganti dengan ip kamu yang diijinkan untuk scan </span><br />
</span></p>
<p>Comment baris ini :<br />
<span style="color:#ff9900;">0.0.0.0</span> menjadi <span style="color:#ff0000;"># 0.0.0.0</span></p>
<p>Eksekusi binary portsentry<br />
# <span style="color:#ff0000;">/etc/portsentry/portsentry -stcp</span></p>
<p>Cek di syslog<br />
# <span style="color:#ff0000;">tail -f /var/log/messages</span><br />
portsentry[3772]: adminalert: Going into stealth listen mode on TCP port: 27665<br />
portsentry[3772]: adminalert: Going into stealth listen mode on TCP port: 31337<br />
portsentry[3772]: adminalert: Going into stealth listen mode on TCP port: 32771<br />
portsentry[3772]: adminalert: Going into stealth listen mode on TCP port: 32772<br />
portsentry[3772]: adminalert: Going into stealth listen mode on TCP port: 32773<br />
portsentry[3772]: adminalert: Going into stealth listen mode on TCP port: 32774<br />
portsentry[3772]: adminalert: Going into stealth listen mode on TCP port: 40421<br />
portsentry[3772]: adminalert: Going into stealth listen mode on TCP port: 49724<br />
portsentry[3772]: adminalert: Going into stealth listen mode on TCP port: 54320<br />
portsentry[3772]: adminalert: PortSentry is now active and listening.</p>
<p>Untuk ujicoba, coba lakukan port scanning melalui komputer yang memiliki ip yang<br />
tidak terdaftar di dalam portsentry.ignore</p>
<p>Misalnya : Saya scan dari ip 172.168.0.1<br />
# <span style="color:#ff0000;">nmap -sS -vv -O -P0 202.78.xxx.xxx (ganti dengan ip server)</span></p>
<p>Saya lihat kembali ke shell saya dan cek pada syslog<br />
# <span style="color:#ff0000;">tail -f /var/log/messages</span></p>
<p>portsentry[4009]: attackalert: TCP SYN/Normal scan from host: server.kapukvalley.net/172.168.0.1<br />
to TCP port: 1080<br />
portsentry[4009]: attackalert: Host 172.168.0.1 has been blocked via wrappers with string: “ALL: 172.168.0.1″<br />
portsentry[4009]: attackalert: Host 172.168.0.1 has been blocked via dropped route using command:<br />
“/usr/sbin/iptables -I INPUT -s 172.168.0.1 -j DROP”<br />
portsentry[4009]: attackalert: TCP SYN/Normal scan from host: 172.168.0.1/172.168.0.1 to TCP port: 54320<br />
portsentry[4009]: attackalert: Host: 172.168.0.1/172.168.0.1 is already blocked Ignoring</p>
<p>Ehm.. seperti diatas, ada peringatan serangan dari ip 172.168.0.1<br />
Apa gunanya baris KILL_ROUTE tadi, yaitu merupakan aksi dari serangan, aksi yang kita<br />
ambil seperti diatas adalah di handle oleh iptables. Bila ada serangan seperti diatas,<br />
maka iptables akan segera mendrop ip tersebut, kita lihat list tabel iptables :<br />
# <span style="color:#ff0000;">iptables -L -vnx</span><br />
Chain INPUT (policy ACCEPT 545689 packets, 79757453 bytes)<br />
pkts bytes target prot opt in out source destination<br />
1351 65609 DROP all — * * 172.168.0.1 0.0.0.0/0</p>
<p>Untuk membuka koneksi nya kembali anda perlu seperti ini :<br />
# <span style="color:#ff0000;">iptables -D INPUT 1</span></p>
<p>Pada waktu ada serangan, maka akan tercipta 2 file di direktori /etc/portsentry, yaitu :<br />
<span style="color:#008000;">- portsentry.blocked.stcp</span><br />
File ini berisikan host yang di blokir</p>
<p>Contoh isinya :</p>
<p># <span style="color:#ff0000;">cat portsentry.blocked.stcp</span><br />
1139373183 &#8211; 02/08/2006 11:33:03 Host: server.kapukvalley.net/172.168.0.1 Port: 1080 TCP Blocked</p>
<p><span style="color:#008000;">- portsentry.history</span><br />
File ini isinya hampir sama dengan file diatas, perbedaan yang spesifik yaitu,<br />
file yang diatas menyimpan informasi mengenai host yang melalukan serangan dan berhubungan<br />
dengan aturan pemblokiran atau aksi pemblokiran. Sedangkan file history hanya menyimpan<br />
informasi yang melalukan serangan saja, tidak termasuk aksi.</p>
<p>Contoh isinya :</p>
<p># <span style="color:#ff0000;">cat portsentry.history</span><br />
1139373183 &#8211; 02/08/2006 11:33:03 Host: server.kapukvalley.net/172.168.0.1<br />
Port: 1080 TCP Blocked</p>
<p>Bila Anda sudah mendelete aturan yang ada di chain iptables, maka sebaiknya isi file<br />
portsentry.blocked.stcp pada host yang bersangkutan di delete, bisa dengan perintah :<br />
# <span style="color:#ff0000;">echo &#8220;&#8221; &gt; /etc/portsentry/portsentry.blocked.stcp</span></p>
<p>Apabila Anda ingin praktis membuka koneksi host yang di blokir,<br />
Anda bisa membuat script bash seperti yang penulis buat dibawah ini :</p>
<p><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;Awal-Script&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</strong></p>
<p><span style="color:#000000;">#!/bin/sh</span></p>
<p>IPTABLES=&#8221;$(which iptables)&#8221;<br />
ROOT_UID=0<br />
E_NOTROOT=67</p>
<p># Harus root<br />
if [ "$UID" -ne "$ROOT_UID" ]<br />
then<br />
echo “Harus root euy..”<br />
exit $E_NOTROOT<br />
fi</p>
<p># clear blocked portsentry -stcp<br />
if [ -f /etc/portsentry/portsentry.blocked.stcp ]<br />
then<br />
echo “Hapus log file portsentry.blocked.stcp… done…”<br />
echo “” &gt; /etc/portsentry/portsentry.blocked.stcp<br />
else<br />
echo “ga ada file portsenty.blocked.stcp-na”<br />
fi</p>
<p># Print ip si nakalz :<br />
$IPTABLES -L INPUT -vnx  | awk &#8216;{print &#8220;IP si nakalz -&gt; &#8221; $8}&#8217; | sed &#8217;1,2d&#8217;</p>
<p>echo &#8220;IP berapa yang mau dibuka?&#8221;<br />
read ip<br />
echo &#8220;IP yang Anda masukkan adalah : $ip&#8221;<br />
echo &#8220;Apakah benar? [y/t]”<br />
read jawab<br />
case “$jawab” in<br />
‘y’)<br />
$IPTABLES -D INPUT -s $ip -j DROP<br />
;;<br />
‘n’)<br />
esac<br />
exit 0</p>
<p><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;Akhir-Script&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</strong></p>
<p><em>terimakasih kepada: bintang kecil </em></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/katulis.wordpress.com/60/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/katulis.wordpress.com/60/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katulis.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katulis.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katulis.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katulis.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katulis.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katulis.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katulis.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katulis.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katulis.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katulis.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katulis.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katulis.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katulis.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katulis.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=60&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katulis.wordpress.com/2008/07/24/portsentry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf99585bec1f921469053ef9c69b17f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">breaker</media:title>
		</media:content>
	</item>
		<item>
		<title>Bandwidth Manager</title>
		<link>http://katulis.wordpress.com/2008/07/21/bandwidth-manager/</link>
		<comments>http://katulis.wordpress.com/2008/07/21/bandwidth-manager/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 06:36:23 +0000</pubDate>
		<dc:creator>katulis</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://katulis.wordpress.com/?p=52</guid>
		<description><![CDATA[Berikut ini akan membahas mengenai pembuatan sebuah bandwidth manager yang secara transparan dapat diletakkan pada jaringan yang telah ada. 1. Pengenalan QoS Mungkin Anda semua sudah mengetahuinya, QoS adalah singkatan dari Quality of Service. Tetapi apa artinya? Apa yang bisa Anda lakukan untuk mengimplementasikannya? QoS artinya network yang telah memenuhi kriteria-kriteria tertentu yang dibuat oleh [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=52&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Berikut ini akan membahas mengenai pembuatan sebuah bandwidth manager yang secara transparan dapat diletakkan pada jaringan yang telah ada.</p>
<p><span style="color:#008000;">1.   Pengenalan QoS</span><br />
Mungkin Anda semua sudah mengetahuinya, QoS adalah singkatan dari Quality of Service. Tetapi apa artinya? Apa yang bisa Anda lakukan untuk mengimplementasikannya?</p>
<p>QoS artinya network yang telah memenuhi kriteria-kriteria tertentu yang dibuat oleh manager-manager network tersebut. Kriteria tersebut termasuk:</p>
<p><strong>1. Availability</strong>, yaitu persentase hidupnya <span id="more-52"></span>sistem atau layanan yang diberikan. Idealnya, availability harus mencapai 100% atau setidaknya 99,9999% (ada 6 buah angka sembilan), yang menunjukkan tingkat kerusakan sebesar 2,6 detik per bulan.<br />
<strong> 2. Bandwidth Usages</strong>, yaitu masing-masing user akan diberikan bandwidth sesuai kebutuhan mereka. Selain berdasarkan user, pemakaian bandwidth juga dapat dibagi berdasarkan jenis traffic atau jenis protocol. Misalnya, untuk traffic HTTP dialokasikan bandwidth sebesar 40%, untuk voice 25%, sisanya untuk ftp dan lain-lain. Yang terakhir ini sering disebut dengan “traffic shaper”.<br />
<strong> 3. Throughput,</strong> yaitu kecepatan (rate) transfer data efektif, yang diukur dalam bps (bit per second). Penggunaan sebuah saluran secara bersama-sama akan mengurangi nilai ini.<br />
<strong> 4. Latency,</strong> adalah waktu yang dibutuhkan data untuk menempuh jarak dari asal ke tujuan. Tundaan (delay) ini dapat dipengaruhi oleh jarak (misalnya akibat penggunaan wireless LAN), atau kongesti (yang memperpanjang antrian), atau bisa juga akibat waktu olah yang lama (misalnya proses baca-tulis pada sebuah proxy server).<br />
<strong> 5. Packet Loss,</strong> yaitu jumlah paket yang hilang. Umumnya perangkat network memiliki buffer untuk menampung data yang diterima. Jika terjadi kongesti yang cukup lama, buffer akan penuh, dan data baru tidak dapat diterima. Paket yang hilang ini harus diretransmisi, yang akan membutuhkan waktu tambahan.</p>
<p>Ada banyak kriteria-kriteria lain yang dapat ditentukan oleh seorang manager network disebuah perusahaan Lebih lengkap mengenai QoS dapat dilihat di <span style="color:#0000ff;">http://www.qosforum.com/tech_resources.htm</span></p>
<p>Pada kasus tertentu, sebuah perusahaan bahkan memilih ISP yang telah memiliki service-level agreements, atau SLA. Dengan adanya perjanjian ini, perusahaan tersebut dijamin akan mendapatkan layanan sesuai yang diiklankan oleh ISPnya atau akan mendapat kompensasi apabila layanan tersebut tidak sesuai yang diharapkan.</p>
<p>Artikel ini secara khusus akan membahas bagaimana sebuah akses Internet berkecepatan tinggi (broadband Internet access) dapat dimanfaatkan bersamaan oleh beberapa karyawan di sebuah perusahaan. Dengan menggunakan sebuah fasilitas bandwidth manager, masing-masing karyawan akan dialokasikan dengan bandwidth sesuai kebutuhan mereka.</p>
<p><span style="color:#008000;">2. Linux Ethernet Bridge</span></p>
<p>Kita akan menganggap perusahaan ini memiliki jaringan komputer yang telah berjalan baik, termasuk akses ke Internetnya. Perusahaan ini telah lama memanfaatkan Linux sebagai Gateway ke Internet menggunakan IP-Masquerade. Karena penggunaan bandwidth yang tidak teratur, maka salah seorang karyawan yang men-download sebuah file MP3 berukuran besar akan mengganggu karyawan lain yang hanya menggunakan Internet untuk email dan browsing.</p>
<p>Anda sebagai seorang staff Network-nya diberi tugas oleh atasan untuk mengimplementasikan bandwidth manager tanpa merubah topologi logik jaringan yang telah ada. Artinya, Anda diharapkan untuk dapat mengimplementasikannya tanpa harus mengutak-ngatik konfigurasi yang telah ada pada komputer client. Selain itu, Anda juga dianjurkan oleh atasan untuk tidak merubah konfigurasi pada server.</p>
<p>Solusinya adalah dengan menjalankan CBQ pada sebuah Linux Bridge. Keterangan mengenai CBQ akan dijelaskan di poin berikutnya pada artikel yang sama. Membuat Bridge</p>
<p>Ada beberapa syarat yang harus dipenuhi pada sebuah bridge:</p>
<p>* Sebuah port hanya dapat menjadi anggota dari satu bridge<br />
* Sebuah bridge tidak perlu mengetahui rute yang akan dilaluinya<br />
* Sebuah bridge tidak mengetahui protocol yang lebih tinggi dari ARP. Itulah sebabnya ia dapat membawa berbagai macam protocol yang dilalui ethernet pada bridge tersebut.<br />
* Berapa pun banyaknya port yang akan menjadi anggota sebuah bridge, ia akan dianggap satu interface logik.</p>
<p>Bila Anda pernah mencoba untuk nge-ping sebuah unmanaged switch, tentunya Anda tahu bahwa itu tidak akan berhasil karena switch tersebut tidak memiliki IP address.</p>
<p>Tetapi bila Anda ingin melakukan perubahan konfigurasi pada bridge, Anda dapat menggunakan SNMP, telnet, rlogin, atau ssh. Dianjurkan untuk menggunakan SSH. Source code bridge yang baru memungkinkan Anda untuk mengalokasikan IP terhadap interface virtualnya.</p>
<p>Catatan: Bridge berfungsi sama seperti sebuah switch.</p>
<p>Berikutnya, download program bridge-utils dari <span style="color:#0000ff;">http://sourceforge.net/project/showfiles.php?group_id=26089</span><span style="color:#0000ff;">.</span></p>
<p>Setelah sebuah file binary /sbin/brctl telah terinstall. Ketik brctl untuk melihat beberapa opsi program tersebut.<br />
<strong><span style="color:#008000;"> Setup Bridge</span></strong></p>
<p>Perlu diperhatikan bahwa pada komputer yang akan dijadikan bridge ini memiliki dua network card (eth0 dan eth1). Kedua-duanya yang akan dijadikan anggota sebuah bridge.</p>
<p>* Membuat bridge dengan nama ‘jembatan’:</p>
<p>[root@apple]# <span style="color:#ff0000;">brctl addbr jembatan</span></p>
<p>Untuk mematikannya gunakan: brctl delbr jembatan</p>
<p>* Menambah interface pada bridge:</p>
<p>[root@apple]# <span style="color:#ff0000;">ifconfig eth0 0.0.0.0</span></p>
<p>[root@apple]# <span style="color:#ff0000;">ifconfig eth1 0.0.0.0</span></p>
<p>[root@apple]# <span style="color:#ff0000;">ifconfig eth0 promisc up</span></p>
<p>[root@apple]# <span style="color:#ff0000;">ifconfig eth1 promisc up</span></p>
<p>[root@apple]# <span style="color:#ff0000;">brctl addif jembatan eth0</span></p>
<p>[root@apple]# <span style="color:#ff0000;">brctl addif jembatan eth1</span></p>
<p>Perhatikan bahwa interface-interface tersebut dalam keadaan ‘promisc’ dan tanpa IP. Sekarang aktifkan bridge ‘jembatan’ dengan perintah:</p>
<p>[root@apple]# <span style="color:#ff0000;">ifconfig jembatan up</span></p>
<p>Bila ingin menambahkan IP pada bridge untuk kemudahaan manajemen nantinya, gunakan:</p>
<p>[root@apple]#<span style="color:#ff0000;"> ifconfig jembatan 192.168.1.2 up</span></p>
<p>Dengan demikian anda dapat login ke PC bridge ini dengan telnet atau ssh dengan menggunakan IP <strong>192.168.1.2</strong></p>
<p>Setelah selesai, masukkan perintah-perintah di atas di dalam script <span style="color:#0000ff;">/etc/rc.d/rc.local</span> agar dapat dijalankan setiap saat komputer di boot.</p>
<p>Anda juga dapat mendownload antarmuka grafis (GUI) untuk mengkonfigurasi bridge dari: <span style="color:#0000ff;">http://home.planet.nl/~kristian/gbrctl.html</span></p>
<p>eth0                    eth1</p>
<p><span style="color:#333333;"><strong>PC ———- PC LINUX BRIGE ——– PC</strong></span></p>
<p><span style="color:#333333;"><strong></strong></span><br />
<strong><span style="color:#008000;"> Test Bridge</span></strong></p>
<p>Test bridge ini dengan cara menghubungkan kedua interface eth0 dan eth1 dengan kabel cross, masing-masing ke sebuah PC. Coba ping dari satu PC ke PC lain dan sebaliknya. Bila berhasil, maka sebuah ethernet bridge telah siap digunakan.</p>
<p><span style="color:#008000;">3.       CBQ</span></p>
<p>Berikutnya adalah mengaktifkan CBQ untuk mengatur jumlah bandwidth masing-masing PC yang terhubung melalui bridge kita. Perhatikan rencana pemasangan CBQ pada Gambar 2.</p>
<p><strong><span style="color:#333333;">gateway ——– linux cbq bridge ——— hub ———|_____ pc bagus 48 Kbps</span></strong></p>
<p><strong><span style="color:#333333;">gateway ——– linux cbq bridge ——— hub ———|_____ pc indra 128 Kbps</span></strong></p>
<p><strong><span style="color:#333333;">gateway ——– linux cbq bridge ——— hub ———|_____ pc dani 48 Kbps</span></strong></p>
<p><strong><span style="color:#333333;">gateway ——– linux cbq bridge ——— hub ———|_____ pc tomy 128 Kbps</span></strong></p>
<p><strong><span style="color:#333333;">gateway ——– linux cbq bridge ——— hub ———|_____ pc rosi 64 Kbps</span></strong><strong></strong></p>
<p><strong><span style="color:#333333;">gateway ——– linux cbq bridge ——— hub ———|_____ pc gita 64 Kbps</span></strong></p>
<p><strong><span style="color:#008000;">Rencana Pemasangan CBQ</span></strong></p>
<p>Sekali lagi, penulis menggunakan Centos 5.0 yang juga telah dilengkapi dengan program CBQ. Tetapi penulis tetap berkeras untuk menggunakan rilis terbaru CBQ yaitu versi  0.7.3 yang dapat di download dari: http://sourceforge.net/projects/cbqinit/</p>
<p>Setelah di download letakkan di dalam direktori /sbin:</p>
<p>[root@apple]# <span style="color:#ff0000;">chmod 755 cbq.init</span></p>
<p>[root@apple]# <span style="color:#ff0000;">cp cbq.init /sbin/cbq</span></p>
<p>cp: overwrite ‘/sbin/cbq’? <span style="color:#ff0000;">y</span></p>
<p>Semua konfigurasi CBQ akan diletakkan di dalam direktori <span style="color:#0000ff;">/etc/sysconfig/cbq</span>.</p>
<p>Sedikit tentang CBQ. CBQ adalah kependekan dari class based queueing, yaitu sebuah ethernet shaper yang dapat dijalankan di Linux. CBQ hanya dapat menggunakan interface Ethernet untuk Linux (eth0, eth1, eth2, …) dan ARCNET. Untuk ARCNET, tukar parameter bandwidth menjadi 2Mbit dan bukannya 10Mbit seperti pada ethernet.</p>
<p>Untuk  menjalankan CBQ diperlukan utilitas iproute2 yang dibuat oleh Alexey Kuznetsov dan dapat di download dari: ftp://ftp.inr.ac.ru/ip-routing. Tetapi pada distro yang penulis gunakan, iproute2 telah terinstall dengan baik.</p>
<p>Bagaimana CBQ bekerja? Baiklah. Setiap shaper akan ditulis pada sebuah file konfigurasi yang secara default terletak di dalam direktori /etc/sysconfig/cbq. Satu file per satu shaper / class.</p>
<p>Penamaan file konfigurasinya harus seperti: cbq-. dimana  adalah dua byte heksadesimal dalam kisaran &lt;0002-FFFF&gt; yang merupakan class ID CBQ. Sedangkan  adalah nama dari shaper itu sendiri. Anda dapat menentukannya sesuka hati. Misalnya sesuai dengan Gambar 2, kita akan menamakan sebuah file konfigurasi CBQ dengan: cbq-1280.nisayudo</p>
<p>File konfigurasi CBQ akan dibagi kedalam beberapa paramater. Berikut adalah beberapa paramater yang akan kita gunakan pada artikel ini.<br />
Parameter Divais<br />
DEVICE=,,</p>
<p>Contoh: DEVICE=eth0,10Mbit,1Mbit</p>
<p>adalah nama interface yang akan diatur. Misalnya eth0.  adalah bandwidth fisik dari divais tersebut, misalnya 10Mbit atau 100Mbit untuk ethernet atau 2Mbit untuk arcnet. Sedangkan  adalah parameter yang dapat ditentukan dengan rumus:  =  / 10</p>
<p>Bila terdapat lebih dari satu class pada satu divais, Anda cukup mengisi  dan  sekali saja. Sedangkan pada file-file lainnya hanya isikan: DEVICE=.</p>
<p>Parameter Class<br />
RATE=</p>
<p>Contoh: RATE=128Kbit</p>
<p>Adalah bandwidth yang dialokasikan pada class tersebut. Dengan cara ini kita dapat membatasi (limit) kecepatan dari shaper. Anda dapat menggunakan akhiran Kbit, Mbit, bps, Kbps, atau Mbps.<br />
WEIGHT=</p>
<p>Contoh: WEIGHT=12Kbit</p>
<p>Dapat ditentukan dengan cara: WEIGHT = RATE / 10<br />
PRIO=&lt;1-8&gt;</p>
<p>Contoh: PRIO=5</p>
<p>Prioritas trafik dari class bersangkutan. Semakin tinggi angkanya, semakin kecil prioritasnya. Umumnya digunakan prioritas 5.</p>
<p>Parameter Filter<br />
RULE=[[saddr[/prefix]][:port],][daddr[/prefix]][:port]</p>
<p>Contoh: RULE=192.168.1.4</p>
<p>Anda dapat menggunakan lebih dari satu RULE per satu file konfigurasi. RULE digunakan untuk mem-filter trafik apa yang akan diatur. Contoh lainnya:</p>
<p>RULE=192.168.1.4:80</p>
<p>Memfilter trafik yang ditujukan kepada port 80 pada IP 192.168.1.4</p>
<p>RULE=192.168.1.0/24</p>
<p>Filter seluruh trafik yang terdapat di network 192.168.1.0</p>
<p>Keterangan tambahan mengenai parameter-parameter CBQ dapat Anda lihat di dalam file cbq.init itu sendiri.</p>
<p>Dari Gambar 2, kita akan membuat CBQ untuk mengatur bandwidth terhadap IP-IP tertentu. Perlu diperhatikan bahwa interface eth1 adalah yang menghubungi antara<br />
CBQ Bridge dengan network 192.168.1.0/24 (HUB). Buatlah file-file berikut di dalam direktori <span style="color:#0000ff;">/etc/sysconfig/cbq</span>:</p>
<p>== cbq-64.gitastefanny</p>
<p>DEVICE=eth1,10Mbit,1Mbit</p>
<p>RATE=64Kbit</p>
<p>WEIGHT=6Kbit</p>
<p>PRIO=5</p>
<p>RULE=192.168.1.5</p>
<p>RULE=192.168.1.6</p>
<p>== cbq-48.bagusdanny</p>
<p>DEVICE=eth1</p>
<p>RATE=48Kbit</p>
<p>WEIGHT=4Kbit</p>
<p>PRIO=5</p>
<p>RULE=192.168.1.1</p>
<p>RULE=192.168.1.3</p>
<p>== cbq-128.yudonisa</p>
<p>DEVICE=eth1</p>
<p>RATE=128Kbit</p>
<p>WEIGHT=12Kbit</p>
<p>PRIO=5</p>
<p>RULE=192.168.1.2</p>
<p>RULE=192.168.1.4</p>
<p>Setelah semua file konfigurasi dibuat, jalankan CBQ dengan cara:</p>
<p>[root@apple]# <span style="color:#ff0000;">/sbin/cbq start</span></p>
<p>Untuk melihat statistik CBQ jalankan:</p>
<p>[root@apple]# <span style="color:#ff0000;">/sbin/cbq stats</span></p>
<p>Sedangkan untuk mematikan CBQ:</p>
<p>[root@apple]# <span style="color:#ff0000;">/sbin/cbq stop</span></p>
<p>Dengan dijalankannya CBQ pada bridge tersebut, komputer-komputer pada Gambar 2 telah dialokasikan bandwidth sesuai aturan yang telah dibuat. Anda dapat mencoba dari masing-masing komputer dengan cara mendownload sebuah file yang terdapat di server Linux Gateway, misalnya. Atau dengan mengaktifkan SNMP agent di masing-masing PC dan memonitor trafik masing-masing komputer menggunakan MRTG (http://www.ee.ethz.ch/~oetiker/webtools/mrtg/).</p>
<p><span style="color:#008000;"> 4.       Penutup</span></p>
<p>Perintah-perintah bridge dan CBQ di atas dapat diletakkan di dalam file /etc/rc.d/rc.local agar selalu diaktifkan pada saat komputer di boot. Pada artikel ini hanya dibahas bagaimana CBQ dapat digunakan untuk membatasi penggunaan bandwidth per alamat IP tertentu. Sedangkan CBQ sebenarnya lebih dari sekedar pembatas bandwidth per IP. Ia juga dapat digunakan untuk membatasi trafik Internet seperti trafik HTTP (web), mail, ftp, dan lain-lain. Selain itu CBQ juga memiliki fitur untuk mengatur bandwidth pada jam-jam tertentu. Dengan memanfaatkan fasilitas-fasilitas pada CBQ, Anda dapat membuat sebuah bandwidth manager murah yang hanya memanfaatkan PC.</p>
<p><span style="color:#333333;"><strong>Bahan bacaan:</strong></span></p>
<blockquote><p><span style="color:#ff6600;">* QoS Forum: http://www.qosforum.com/tech_resources.htm<br />
* Artikel-artikel dari I Made Wiryana: http://wiryana.dhs.org/my_project/3rd-party/<br />
* Linux Bridge STP HOWTO:</p>
<p>http://www.linuxdoc.org/HOWTO/BRIDGE-STP-HOWTO/index.html</p>
<p>* CBQ.INIT: ftp://ftp.equinox.gu.net/pub/linux/cbq/cbq.init<br />
* Linux Ethernet Bridge: http://bridge.sourceforge.net<br />
* Bridge GUI (gbrctl): http://home.planet.nl/~kristian/gbrctl.html<br />
* Linux Bridge Mailing List: http://www.math.leidenuniv.nl/pipermail/bridge/<br />
* Ethernet Frame Diverter: http://diverter.sourceforge.net</span></p>
<p><span style="color:#ff6600;">* malang.linux.or.id</span></p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/katulis.wordpress.com/52/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/katulis.wordpress.com/52/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katulis.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katulis.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katulis.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katulis.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katulis.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katulis.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katulis.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katulis.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katulis.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katulis.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katulis.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katulis.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katulis.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katulis.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=52&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katulis.wordpress.com/2008/07/21/bandwidth-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf99585bec1f921469053ef9c69b17f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">breaker</media:title>
		</media:content>
	</item>
		<item>
		<title>Command Cisco Router</title>
		<link>http://katulis.wordpress.com/2008/07/18/command-cisco-router/</link>
		<comments>http://katulis.wordpress.com/2008/07/18/command-cisco-router/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 17:47:43 +0000</pubDate>
		<dc:creator>katulis</dc:creator>
				<category><![CDATA[Cisco Router]]></category>

		<guid isPermaLink="false">http://katulis.wordpress.com/?p=50</guid>
		<description><![CDATA[Daftar Perintah &#8211; Command pada Router Cisco Command pada router cisco devices terdiri dari Router Commands CISCO ROUTER COMMANDS : Usermode Commands 1. disconnect, hapus sesi telnet dan logout 2. enable, masuk ke privilegemode 3. ping &#60;host/ip&#62; 4. traceroute &#60;host/ip&#62; Privilegemode Commands 1. clear arp-cache, hapus cache arp 2. configure terminal, masuk ke global configuration [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=50&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color:#008000;">Daftar Perintah &#8211; Command pada Router Cisco</span></strong></p>
<p>Command pada router cisco devices terdiri dari Router Commands<br />
CISCO ROUTER COMMANDS :</p>
<p>Usermode Commands<br />
1. disconnect, hapus sesi telnet dan logout<br />
2. enable, masuk ke privilegemode<br />
3. ping &lt;host/ip&gt;<br />
4. traceroute &lt;host/ip&gt;<br />
<span id="more-50"></span><br />
Privilegemode Commands<br />
1. clear arp-cache, hapus cache arp<br />
2. configure terminal, masuk ke global configuration mode<br />
3. copy running-config startup-config, simpan konfigurasi sekarang<br />
4. copy startup-config running-config, load konfigurasi yang  tersimpan<br />
5. debug ip packet, debug paket dari tcp/ip<br />
6. disable, kembali ke privilegemode dari global configuration mode<br />
7. disconnect &lt;telnet id&gt;<br />
8. erase startup-config, hapus file konfigurasi dari router<br />
9. logout, keluar dari privilegemode<br />
10. ping &lt;hostname/ip&gt;<br />
11. reload, load kembali startup-config<br />
12. resume &lt;telnet id&gt;, konek kembali setelah diskonek<br />
13. show access-list, memperlihatkan semua access-list dari semua<br />
protokol pada  router<br />
14. show banner, memperlihatkan banner<br />
15. show cdp, memperlihatkan status CDP router<br />
16. show cdp interface, memperlihatkan interface CDP<br />
17. show cdp neighbor<br />
18. show cdp traffic<br />
19. show clock<br />
20. show flash, memperlihatkan IOS image dan file yang tersimpan di flash<br />
memory<br />
21. show frame-relay lmi, memperlihatkan statistik detail LMI<br />
22. show frame-relay map<br />
23. show frame-relay pvc &lt;nomer dlci&gt;<br />
24. show history, memperlihatkan semua perintah yang telah dieksekusi<br />
25. show hosts, memperlihatkan static host yang disimpan<br />
26. show interfaces, memperlihatkan interface yang dimiliki (semua)<br />
secara detail<br />
27. show interfaces ethernet 0<br />
28. show interfaces serial 0<br />
29. show interfaces loopback 0<br />
30. show ip arp<br />
31. show ip eigrp neighbors<br />
32. show ip eigrp neighbors detail<br />
33. show ip eigrp topology<br />
34. show ip eigrp traffic, memperlihatkan traffic statistik dari  protokol eigrp<br />
35. show ip interface<br />
36. show ip interface brief, verify konfigurasi ip<br />
37. show ip ospf database<br />
38. show ip ospf interface<br />
39. show ip ospf neighbor detail<br />
40. show ip route, memperlihatkan konfigurasi routing<br />
41. show protocols, memperlihatkan protokol routing yang telah dikonfigurasi dan<br />
sedang berjalan<br />
42. show running-config, memperlihatkan konfigurasi global yang  sedang berjalan<br />
43. show sessions, memperlihatkan sesi yang ada sekarang<br />
44. show startup-config, memperlihatkan konfigurasi yang tersimpan  pada flash<br />
45. show version, memperlihatkan informasi hardware dan firmware<br />
46. telnet &lt;host/ip&gt;<br />
47. traceroute &lt;host/ip&gt;<br />
48. vlan database, mengakses vlan database atau masuk ke konfigurasi  VTP<br />
49. write erase<br />
50. write memory<br />
51. write terminal</p>
<p>Global configuration mode Commands<br />
1. access-list &lt;nomer&gt; {permit|deny} &lt;source ip address&gt;<br />
2. access-list &lt;nomer&gt; {permit|deny} &lt;any&gt;<br />
3. access-list &lt;nomer&gt; {permit|deny} &lt;ip address&gt; &lt;ip address&gt;<br />
4. access-list &lt;nomer&gt; {permit|deny} &lt;hostname&gt; &lt;ip address&gt;<br />
5. banner motd &lt;string bannernya&gt;<br />
6. cdp advertise-v2<br />
7. cdp holdtime &lt;detik&gt;, mengubah nilai holdtime cdp<br />
8. cdp run<br />
9. cdp timer &lt;detik&gt;, mengubah nilai cdp timer<br />
10. config-register &lt;nilai&gt;<br />
11. dialer-list &lt;nomer&gt; protocol ip permit<br />
12. enable password &lt;passwordnya&gt;, set password untuk masuk ke<br />
mode privilege<br />
13. enable secret &lt;passwordnya&gt;, set enkripsi untuk password yang  disimpan<br />
14. end, kembali ke mode privilege<br />
15. hostname &lt;namahost&gt;, set nama host<br />
16. interface ethernet 0, masuk ke subconfiguration interface  ethernet 0<br />
17. interface fastethernet 0, masuk ke subconfiguration interface  fastethernet 0<br />
18. interface serial 0, masuk ke subconfiguration interface serial 0<br />
19. interface vlan &lt;nomer vlan&gt;, masuk ke subconfiguration vlan<br />
20. ip default-gateway &lt;ip address&gt;, set default gateway<br />
21. ip default-network &lt;ip network&gt;<br />
22. ip host &lt;nama host&gt; &lt;ip address&gt;, set static hostname lain<br />
23. ip name-server &lt;ip address&gt;, set DNS router<br />
24. ip route &lt;prefix&gt; &lt;mask&gt; {next-hop-ip-addr|interface-type}<br />
25. ip route 0.0.0.0 0.0.0.0 &lt;ip gateway&gt;, set defaut gateway /  static route<br />
26. ip route &lt;ip network&gt; &lt;mask&gt; &lt;ip gateway&gt;, set static route<br />
27. ip routing<br />
28. ipx routing<br />
29. isdn switch-type &lt;tipe switch&gt;<br />
30. line aux<br />
31. line console 0, masuk ke konfigurasi console nomer 0<br />
32. line vty 0 4, masuk ke konfigurasi vty untuk 5 buah vty<br />
33. no banner motd, menghapus banner<br />
34. no ip routing, menghapus ip routing<br />
35. no router igrp, menghapus konfigurasi route igrp<br />
36. no router ospf, menghapus konfigurasi route ospf<br />
37. no router rip, menghapus konfigurasi route rip<br />
38. no vlan &lt;nomer&gt;, menghapus vlan nomer ke sekian<br />
39. router eigrp &lt;auth_sys&gt;, masuk ke konfigurasi routing menggunakan  eigrp<br />
40. router ospf &lt;proses id&gt;, masuk ke konfigurasi routing menggunakan  ospf<br />
41. router rip, masuk ke konfigurasi routing menggunakan rip<br />
42. snmp-server enable traps vtp<br />
43. username &lt;nama user&gt; password &lt;passwordnya&gt;, set username dan<br />
passwordnya</p>
<p>Interface subconfiguration mode Commands<br />
1. bandwidth &lt;kilobits&gt;, set bandwidth yang akan dilalui interface<br />
ini dalam kilobits<br />
2. cdp enable<br />
3. clock rate &lt;bits per detik&gt;, set clock rate dalam bits/s<br />
4. compress stac &lt;nomer&gt; in</p>
<p>Line subconfiguration mode Commands<br />
1. exec-timeout &lt;menit&gt; [detik], pilihan detik opsional<br />
2. login synchronous<br />
3. password &lt;passwordnya&gt;, set passwordnya</p>
<p>Subinterface subconfiguration mode Commands<br />
1. description &lt;string deskripsi&gt;, set deskripsi dari subinterface</p>
<p>IP Routing Protocol subconfiguration mode Commands<br />
1. network &lt;ip network&gt;, set ip network</p>
<p>Contoh :<br />
Lab_A&gt;enable<br />
Lab_A#configure terminal atau config t<br />
Lab_A(router)#interface fast eth0/0 atau int f0/0<br />
Lab_A(router-config)#ip add 192.168.0.2 255.255.255.0  (misal)<br />
Lab_A(router-config)#no shut  (mengaktifkan Network IP kayak service<br />
network restart kalo di linux)<br />
Lab_A(router-config)#end<br />
Lab_A#show ip interface brief ( melihat configurasi IP yg telah diseting )</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/katulis.wordpress.com/50/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/katulis.wordpress.com/50/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katulis.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katulis.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katulis.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katulis.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katulis.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katulis.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katulis.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katulis.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katulis.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katulis.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katulis.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katulis.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katulis.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katulis.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=50&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katulis.wordpress.com/2008/07/18/command-cisco-router/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf99585bec1f921469053ef9c69b17f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">breaker</media:title>
		</media:content>
	</item>
		<item>
		<title>Browsing With SSH Tuneling</title>
		<link>http://katulis.wordpress.com/2008/07/18/browsing-by-ssh-tuneling/</link>
		<comments>http://katulis.wordpress.com/2008/07/18/browsing-by-ssh-tuneling/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 06:25:21 +0000</pubDate>
		<dc:creator>katulis</dc:creator>
				<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://katulis.wordpress.com/?p=32</guid>
		<description><![CDATA[Berikut ini saya akan mencoba menuliskan browsing menggunakan BW komputer lain dengan menggunakan SSH tuneling. Syarat menggunakan SSH Tuneling : Anda harus memiliki account SSH di server yang dituju Firefox Web Browser (knp firefox? karena saya menggunakan firefox) Kelebihan browsing menggunakan SSH Tunneling Bypass semua rules (firewall) dalam jaringan yang dilewati. Seolah-olah anda menggunakan bandwidth [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=32&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="entry">
<p>Berikut ini saya akan mencoba menuliskan browsing menggunakan BW komputer lain dengan menggunakan SSH tuneling.</p>
<p><strong><span style="color:#008000;">Syarat menggunakan SSH Tuneling :</span><br />
</strong></p>
<ul>
<li>Anda harus memiliki account SSH di server yang dituju</li>
<li>Firefox Web Browser (knp firefox? karena saya menggunakan firefox)</li>
</ul>
<p><span style="color:#008000;"><strong>Kelebihan browsing menggunakan SSH Tunneling</strong></span></p>
<ol>
<li>Bypass semua rules (firewall) dalam jaringan yang dilewati.</li>
<li>Seolah-olah anda menggunakan bandwidth orang lain.</li>
<li>Berguna apabila anda mendownload di situs limited download seperti rapidshare (tanpa harus mencari free proxy).</li>
</ol>
<p><span id="more-32"></span>SSH Tunneling bisa dilakukan di OS berbasis Windows atau berbasis Unix tetapi disini saya akan menjelaskan browsing ssh tunneling di Unix.</p>
<ul>
<li>SSH Tunneling di OS Unix</li>
<li> Dalam hal ini saya menggunakan<strong> </strong>Sistem operasi Windows Xp, lakukan remote ke server<strong> </strong>disini saya menggunakan server dengan OS Debian Etch (Debian 4.0). Pastikan anda memiliki Putty untuk melakukan remot keserver:D.</li>
<p>Dari <span style="color:#ff0000;"><span style="color:#000000;">Start &gt; klick Run &gt; kemudian lakukan ssh tuneling ke mesin yg akan anda tuju</span><span style="color:#000000;">:</span> </span><span style="color:#000000;"><strong>putty -ssh username@hostname -D port -C</strong></span><br />
Contoh : <span style="color:#ff0000;"><strong>putty -ssh wwn@202.43.163.xxx -D 9090 -C</strong></span></p>
<li>Yakinkan anda bisa login dan masuk ke mesin server yg dituju. Setelah itu buka firefox anda lakukan perintah berikut : <span style="color:#000000;"><strong>Klik Edit&gt;Preference&gt;Advance&gt;Network&gt;Settings</strong></span></li>
<li>Kemudian klik pada bagian “Manual proxy configuration” isi SOCKS HOST “<span style="color:#ff0000;">127.0.0.1</span>″ port “<span style="color:#ff0000;">9090</span>″,</li>
<p>	<strong>Beres dah!</strong>
</ul>
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/katulis.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/katulis.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katulis.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katulis.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katulis.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katulis.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katulis.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katulis.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katulis.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katulis.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katulis.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katulis.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katulis.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katulis.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katulis.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katulis.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=32&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katulis.wordpress.com/2008/07/18/browsing-by-ssh-tuneling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf99585bec1f921469053ef9c69b17f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">breaker</media:title>
		</media:content>
	</item>
		<item>
		<title>Instal clam antivirus</title>
		<link>http://katulis.wordpress.com/2008/06/17/instal-clam-antivirus/</link>
		<comments>http://katulis.wordpress.com/2008/06/17/instal-clam-antivirus/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 03:41:26 +0000</pubDate>
		<dc:creator>katulis</dc:creator>
				<category><![CDATA[antivirus]]></category>

		<guid isPermaLink="false">http://katulis.wordpress.com/?p=31</guid>
		<description><![CDATA[Clam antivirus ( http://clamav.elektrapro.com) merupakan software antivirus yang berlisensi GNU GPL 2 dengan menggunakan database virus dari OpenAntiVirus ( http://www.openantivirus.org). Download, ekstrak dan ganti direktori ke source clam antivirus : [root@wedus src]# wget http://clamav.elektrapro.com/stable/clamav-0.54.tar.gz [root@wedus src]# tar -xzvf clamav-0.54.tar.gz [root@wedus src]# cd clamav-0.54 Buat user dan group yang akan menjalankan daemon clam anvirus : [root@wedus [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=31&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Clam antivirus ( http://clamav.elektrapro.com) merupakan software antivirus yang berlisensi GNU GPL 2 dengan menggunakan database virus dari OpenAntiVirus ( http://www.openantivirus.org). Download, ekstrak dan ganti direktori ke source clam antivirus :</p>
<p>[root@wedus src]# wget http://clamav.elektrapro.com/stable/clamav-0.54.tar.gz<br />
[root@wedus src]# tar -xzvf clamav-0.54.tar.gz<br />
[root@wedus src]# cd clamav-0.54<span id="more-31"></span></p>
<p>Buat user dan group yang akan menjalankan daemon clam anvirus :</p>
<p>[root@wedus clamav-0.54]# groupadd clamav<br />
[root@wedus clamav-0.54]# useradd -g clamav -s /bin/false -c &#8220;Clam AntiVirus&#8221; clamav</p>
<p>Lakukan kompilasi dan install :</p>
<p>[root@wedus clamav-0.54]# ./configure<br />
[root@wedus clamav-0.54]# make<br />
[root@wedus clamav-0.54]# make install</p>
<p>Pindah file konfigurasi standar dari clam antivirus ke nama file yang lain, karena kita akan menyusun sendiri file konfigurasi tersebut :</p>
<p>[root@wedus clamav-0.54]# mv /usr/local/etc/clamav.conf /usr/local/etc/clamav.conf.default</p>
<p>Buatlah file /usr/local/etc/clamav.conf isinya :</p>
<p>LogFile /tmp/clamd.log<br />
LogFileMaxSize 2M<br />
LogVerbose<br />
LogTime<br />
PidFile /var/run/clamd.pid<br />
DataDirectory /usr/local/share/clamav<br />
LocalSocket /tmp/clamd<br />
MaxDirectoryRecursion 15<br />
User clamav<br />
ScanArchive<br />
ArchiveMaxFileSize 10M<br />
ArchiveMaxRecursion 5<br />
ArchiveMaxFiles 1000</p>
<p>Jalankan daemon clam antivirus (clamd ) :</p>
<p>[root@wedus clamav-0.54]# clamd</p>
<p>Periksa apakah daemon tersebut sudah berjalan seperti yang kita inginkan :</p>
<p>[root@wedus clamav-0.54]# ps axu | grep clamd<br />
clamav   29192  0.0  4.7  9120 5984 ?        S    11:06   0:00 clamd<br />
clamav   29193  0.0  4.7  9120 5984 ?        S    11:06   0:00 clamd<br />
clamav   29194  0.0  4.7  9120 5984 ?        S    11:06   0:00 clamd</p>
<p>Untuk menjalankan daemon clamd setiap server di reboot :</p>
<p>[root@wedus clamav-0.54]# echo /usr/local/sbin/clamd &gt;&gt; /etc/rc.local</p>
<p>Tanpa berpindah dari direktori source clam antivirus, lakukan test dengan cara menscan direktori test :</p>
<p>[root@wedus clamav-0.54]# clamscan -r test</p>
<p>Kemudian download update database virus yang paling baru :</p>
<p>[root@wedus clamav-0.54]# freshclam</p>
<p>Jika sudah selesai kemudian kita jalankan daemon proses update database virus tersebut secara otomatis (akan dilaksanakan pengecekan database virus yang paling baru 2 kali dalam sehari ) :</p>
<p>[root@wedus clamav-0.54]# touch /var/log/clam-update.log<br />
[root@wedus clamav-0.54]# chmod 644 /var/log/clam-update.log<br />
[root@wedus clamav-0.54]# chown clamav /var/log/clam-update.log</p>
<p>Jalankan daemonnya (freshclam ):</p>
<p>[root@wedus clamav-0.54]# freshclam -d -c 2 -l /var/log/clam-update.log</p>
<p>Untuk menjalankan daemon freshclam jika server di reboot :</p>
<p>[root@wedus clamav-0.54]# echo &#8220;freshclam -d -c 2 -l /var/log/clam-update.log&#8221; \<br />
&gt;&gt; /etc/rc.local</p>
<p>2. Instal Module Perl Time::HiRes dan DB_FIle</p>
<p>Anda bisa mendapatkan module perl Time::HiRes tersebut yang paling baru melalui http://search.cpan.org/search?module=Time::HiRes, atau anda bisa langsung mendownload di lokal mirror CPAN di Indonesia (terima kasih kepada ISP CBN), download, ekstrak, dan kompilasi :</p>
<p>[root@wedus src]# wget \<br />
ftp://ftp.cbn.net.id/mirror/CPAN/authors/id/J/JH/JHI/Time-HiRes-1.42.tar.gz<br />
[root@wedus src]# tar -xzvf Time-HiRes-1.42.tar.gz<br />
[root@wedus src]# cd Time-HiRes-1.42<br />
[root@wedus Time-HiRes-1.42]# perl Makefile.PL<br />
[root@wedus Time-HiRes-1.42]# make<br />
[root@wedus Time-HiRes-1.42]# make install</p>
<p>Atau, anda juga bisa menggunakan CPAN auto-install sebagai berikut untuk menginstal module perl Time::HiRes tersebut :</p>
<p>[root@wedus src]# perl -MCPAN -e &#8220;install Time::HiRes&#8221;</p>
<p>Lakukan juga langkah seperti tersebut diatas untuk module DB_File.<br />
3. Instal maildrop</p>
<p>Yang dibutuhkan oleh qmail-scanner dari paket maildrop sebenarnya adalah program reformime. Download, ekstrak, kompilasi dan install :</p>
<p>[root@wedus src]# wget http://unc.dl.sf.net/courier/maildrop-1.5.2.tar.bz2<br />
[root@wedus src]# tar -jxvf maildrop-1.5.2.tar.bz2<br />
[root@wedus src]# cd maildrop-1.5.2<br />
[root@wedus maildrop-1.5.2]# ./configure<br />
[root@wedus maildrop-1.5.2]# make<br />
[root@wedus maildrop-1.5.2]# make install</p>
<p>4. Instal tnef unpacker</p>
<p>Tnef unpacker digunakan untuk menguraikan attachment MS-TNEF MIME yang digunakan oleh Microsoft mail server.</p>
<p>[root@wedus src]# wget http://unc.dl.sf.net/sourceforge/tnef/tnef-1.2.0.tar.gz<br />
[root@wedus src]# tar -xzvf tnef-1.2.0.tar.gz<br />
[root@wedus src]# cd tnef-1.2.0<br />
[root@wedus tnef-1.2.0]# ./configure<br />
[root@wedus tnef-1.2.0]# make<br />
[root@wedus tnef-1.2.0]# make install</p>
<p>5. Instal perl-suidperl</p>
<p>Karena pada default distribusi RedHat 7.3 tidak menyertakan program perl-suidperl, maka kita perlu menginstal program tersebut (hal ini mungkin bisa anda temui jika anda tidak menginstal program tersebut pada file /var/log/qmail/smtpd/current akan terdapat error Can&#8217;t do setuid atau jika di server lokal akan anda dapatkan error 451_qq_temporary_problem_(#4.3.0) ) :</p>
<p>[root@wedus src]# wget \<br />
ftp://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/perl-suidperl-5.6.1-34.99.6.i386.rpm<br />
[root@wedus src]# rpm -ivh perl-suidperl-5.6.1-34.99.6.i386.rpm</p>
<p>6. Instal qmail-scanner</p>
<p>Download, ekstrak source qmail-scanner yang paling baru :</p>
<p>[root@wedus src]# wget \</p>
<p>http://unc.dl.sourceforge.net/sourceforge/qmail-scanner/qmail-scanner-1.16.tgz</p>
<p>[root@wedus src]# tar -xzvf qmail-scanner-1.16.tgz</p>
<p>Ganti direktori ke source qmail-scanner kemudian lakukan konfigurasi :</p>
<p>[root@wedus src]# cd qmail-scanner-1.16<br />
[root@wedus qmail-scanner-1.16]# ./configure</p>
<p>Jika sukses, script configure akan menemukan path program yang dibutuhkan oleh qmail-scanner dan clam antivirus, misalnya :</p>
<p>&#8230;.<br />
mimeunpacker=/usr/local/bin/reformime<br />
uudecode=/usr/bin/uudecode<br />
unzip=/usr/bin/unzip<br />
tnef=/usr/local/bin/tnef<br />
clamscan=/usr/local/bin/clamscan<br />
scanners=&#8221;clamscan_scanner&#8221;<br />
&#8230;.</p>
<p>Buat direktori yang akan digunakan oleh qmail-scanner :</p>
<p>[root@wedus qmail-scanner-1.16]# mkdir -p /var/spool/qmailscan/quarantine/{tmp,cur,new}<br />
[root@wedus qmail-scanner-1.16]# mkdir -p /var/spool/qmailscan/working/{tmp,cur,new}<br />
[root@wedus qmail-scanner-1.16]# mkdir -p /var/spool/qmailscan/archive/{tmp,cur,new}</p>
<p>Salin file quarantine-attachments.txt ke direktori /var/spool/qmailscan :</p>
<p>[root@wedus qmail-scanner-1.16]# cp quarantine-attachments.txt /var/spool/qmailscan/</p>
<p>Ubah kepemilikan dari direktori /var/spool/qmailscan :</p>
<p>[root@wedus qmail-scanner-1.16]# chown -R qmailq:qmail /var/spool/qmailscan/</p>
<p>Salin file qmail-scanner-queue.pl ke direktori /var/qmail/bin :</p>
<p>[root@wedus qmail-scanner-1.16]# cp qmail-scanner-queue.pl \<br />
/var/qmail/bin/qmail-scanner-queue.pl</p>
<p>Ganti kepemilikan dan mode dari file qmail-scanner-queue.pl tersebut :</p>
<p>[root@wedus qmail-scanner-1.16]# chown qmailq:qmail /var/qmail/bin/qmail-scanner-queue.pl<br />
[root@wedus qmail-scanner-1.16]# chmod 4755  /var/qmail/bin/qmail-scanner-queue.pl</p>
<p>Generate database perl-scanner dan membersihkan file-file sementara :</p>
<p>[root@wedus qmail-scanner-1.16]# /var/qmail/bin/qmail-scanner-queue.pl -z<br />
[root@wedus qmail-scanner-1.16]# /var/qmail/bin/qmail-scanner-queue.pl -g</p>
<p>Edit file /var/qmail/bin/qmail-scanner-queue.pl, sesuaikan dengan konfigurasi yang anda kehendaki, misalnya :</p>
<p>my $V_FROM=&#8217;virus-notifier@kurowo.edu&#8217;;<br />
my $QUARANTINE_CC=&#8217;asfik@indolinuxefnet.org&#8217;;</p>
<p>Test kirim email bervirus ke root@localhost :</p>
<p>[root@wedus qmail-scanner-1.16]# ./contrib/test_installation.sh -doit</p>
<p>Jika sukses, anda bisa memodifikasi file startup untuk menjalakan qmail-smtpd anda, misalnya jika anda menggunakan supervise anda bisa mengedit file /service/qmail-smtpd/run menjadi :</p>
<p>PATH=$PATH:/usr/local/bin:/var/qmail/bin<br />
QMAILQUEUE=&#8221;/var/qmail/bin/qmail-scanner-queue.pl&#8221;<br />
export PATH QMAILQUEUE</p>
<p>QMAILDUID=`id -u qmaild`<br />
NOFILESGID=`id -g qmaild`<br />
MAXSMTPD=30<br />
exec /usr/local/bin/softlimit -m 11000000 \<br />
tcpserver -H -R -v -x /etc/tcp.smtp.cdb -c &#8220;$MAXSMTPD&#8221; -u &#8220;$QMAILDUID&#8221; -g &#8220;$NOFILESGID&#8221; \<br />
0 25 qmail-smtpd 2&gt;&amp;1</p>
<p>Perhatikan perubahan tersebut diatas terutama pada path QMAILQUEUE dan angka (memory) yang digunakan softlimit, jika anda mengeset angka tersebut terlalu kecil, maka biasanya anda akan mendapatkan error perl: error in loading shared libraries: atau failed to map segment from shared object: Cannot allocate memory. Qmail-scanner tidak mendeteksi virus klez jika setting dari soflimit kurang dari 11000000 (11 juta), anda bisa lihat referensinya di http://archive.elektrapro.com/clamav.elektrapro.com/users/2002/10/msg00114.html (thanks kepada tio aka geep di #indolinux EFnet)</p>
<p>Restart daemon qmail anda, jika anda menggunakan supervise anda bisa menggunakan :</p>
<p>[root@wedus qmail-scanner-1.16]# qmailctl restart</p>
<p>Kemudian anda bisa mencoba mengirim email dengan attachment sebuah file eicar.com yang isinya sebagai berikut :</p>
<p>X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*</p>
<p>Jika anda lakukan tail -f /var/spool/qmailscan/quarantine.log, maka akan anda dapatkan file tersebut akan ditolak dan di log oleh qmail-scanner, misalnya :</p>
<p>04/03/2003 12:31:45     asfik@indolinuxefnet.org        asfik@kurowo.edu      test email mengandung virus     EICAR Test Virus      clamscan: 0.54.</p>
<p>Jika sukses, berarti mail server anda telah menggunakan software antivirus <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , have fun ! Jika anda menginginkan pembacaan statistik berapa jumlah email yang masuk kedalam file /var/spool/qmailscan/quarantine.log, anda bisa menggunakan Qmail Scanner Statistics (QSS). Caranya, buat direktori qss, download source qss, dan ekstrak :</p>
<p>[root@wedus src]# mkdir qss<br />
[root@wedus src]# cd qss<br />
[root@wedus qss]# wget http://unc.dl.sf.net/sourceforge/qss/qss-2.0.2.tar.gz<br />
[root@wedus qss]# tar -xzvf qss-2.0.2.tar.gz</p>
<p>Tentukan direktori dimana akan kita salin file /var/spool/qmailscan/quarantine.log, misalnya buat direktori /usr/local/httpd/logs/quarantine, kemudian cari user yang menjalankan daemon apache (anda bisa melihat dari file httpd.conf anda bagian User atau anda bisa menggunakan perintah ps axu | grep httpd untuk mencarinya), disini kita misalkan usernya adalah www. Kemudian buatlah file /etc/qss.sh (mulai dibawah ini ganti user www dengan user yang menjalankan daemon apache anda) isinya :</p>
<p>#!/bin/bash<br />
cp -f /var/spool/qmailscan/quarantine.log /usr/local/httpd/logs/quarantine/quarantine.log<br />
chown www /usr/local/httpd/logs/quarantine/quarantine.log</p>
<p>Set menjadi script yang executable :</p>
<p>[root@wedus qss]# chmod +x /etc/qss.sh</p>
<p>Buat direktori /usr/local/httpd/logs/quarantine dan ganti kepemilikannya ke user www :</p>
<p>[root@wedus qss]# mkdir /usr/local/httpd/logs/quarantine<br />
[root@wedus qss]# chown www /usr/local/httpd/logs/quarantine</p>
<p>Tentukan dimana qss akan diinstall, hal ini tergantung setting dari DocumentRoot di file httpd.conf anda, misalnya kita buat di direktori /usr/local/httpd/htdocs/qss (sehingga nantinya bisa diakses melalui http://localhost/qss misalnya) :</p>
<p>[root@wedus qss]# mkdir /usr/local/httpd/htdocs/qss</p>
<p>Salin semua file ke direktori tersebut diatas dan ganti kepemilikannya :</p>
<p>[root@wedus qss]# cp -R * /usr/local/httpd/htdocs/qss<br />
[root@wedus qss]# chown -R www /usr/local/httpd/htdocs/qss</p>
<p>Edit file /usr/local/httpd/htdocs/qss/config.php ganti bagian :</p>
<p>$config["logFile"] = &#8220;quarantine.log&#8221;;</p>
<p>menjadi :</p>
<p>$config["logFile"] = &#8220;/usr/local/httpd/logs/quarantine/quarantine.log&#8221;;</p>
<p>Jalankan script untuk menyalin file quarantine.log untuk pertama kali :</p>
<p>[root@wedus qss]# sh /etc/qss.sh</p>
<p>Test dengan browser anda dengan url http://localhost/qss atau http://ip.address.server.anda/qss tergantung konfigurasi ServerNamepada file httpd.conf anda. Jika sukses anda bisa menambahkan cron setiap 5 menit (jika anda menginginkan waktu yang lebih lama anda bisa mengganti angka 5 menjadi yang lain, misalnya 10,15 atau 30, silakan konsultasi dengan man 5 crontab anda ) :</p>
<p>[root@wedus qss]# echo &#8220;*/5 * * * * /etc/qss.sh&#8221; &gt; cron.temp<br />
[root@wedus qss]# crontab -u root cron.temp</p>
<p>Enjoy !</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/katulis.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/katulis.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katulis.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katulis.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katulis.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katulis.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katulis.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katulis.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katulis.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katulis.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katulis.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katulis.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katulis.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katulis.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katulis.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katulis.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=31&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katulis.wordpress.com/2008/06/17/instal-clam-antivirus/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf99585bec1f921469053ef9c69b17f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">breaker</media:title>
		</media:content>
	</item>
		<item>
		<title>Setup Rsync</title>
		<link>http://katulis.wordpress.com/2008/06/16/setup-rsync/</link>
		<comments>http://katulis.wordpress.com/2008/06/16/setup-rsync/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 13:32:07 +0000</pubDate>
		<dc:creator>katulis</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://katulis.wordpress.com/?p=29</guid>
		<description><![CDATA[SEKILAS TENTANG RSYNC Rsync adalah sebuah program yang fungsinya hampir sama dengan RCP, namun memiliki fitur tambahan yang lebih banyak dan menggunakan protokol rsync remote update untuk mempercepat transfer file bila file tujuan sudah ada. Rsync hanya menyalin perbedaan file yang tidak ada saja, kemudian mengompres dan mengirimnya lewat ssh jika anda memerlukan keamanan yang [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=29&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#008000;"><strong><span>SEKILAS TENTANG RSYNC</span></strong></span></p>
<p>Rsync adalah sebuah program yang fungsinya hampir sama dengan RCP, namun memiliki fitur tambahan yang lebih banyak dan menggunakan protokol rsync remote update untuk mempercepat transfer file bila file tujuan sudah ada.</p>
<p>Rsync hanya menyalin perbedaan file yang tidak ada saja, kemudian mengompres dan mengirimnya lewat ssh jika anda memerlukan keamanan yang lebih. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Berikut ini adalah beberapa buah fitur tambahan rsync :</p>
<p>1. mendukung penyalinan link, device, owner, grup, dan permisi.<br />
2. Option  exclude dan exclude-from serupa dengan GNU tar<br />
3. sebuah mode CVS exclude  untuk mengabaikan file-file yang sama yang akan diabaikan oleh CVS<br />
4. dapat  menggunakan sembarang remote shell transparan, termasuk rsh atau ssh<span id="more-29"></span><br />
5. tidak  membutuhkan root privilege<br />
6. pipelining transfer file untuk meminimalkan  biaya latency</p>
<p>7. dukungan bagi server rsync anonymous atau authenticated.</p>
<p><span style="color:#008000;"><strong><span>INSTALASI RSYNC</span></strong></span></p>
<p>Rsync dapat diinstall melalui paket rpm atau pun dengan tarball&#8230; Semua sesuai selera anda. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Instalasi lewat RPM dapat dilakukan dengan cara berikut ini:</p>
<p>1. download paket rpm, anda bisa mendownloadnya <a title="mirror cbn" href="http://mirror.cbn.net.id/">disini</a></p>
<p>2. Setelah paket di download ga perlu panjang lebar segera saja kita bantai:D. Login dengan hak akses root kemudian ketik command dibawah ini:</p>
<p><img src="/DOCUME%7E1/wwn/LOCALS%7E1/Temp/moz-screenshot.jpg" alt="" /></p>
<p># <span style="color:#0000ff;">rpm -ivh rsync-2.4.6-1.i386.rpm</span></p>
<p>Untuk instalasi denga tarball dapat kita lakukan dengan cara berikut:</p>
<ol>
<li>Yang pasti download terlebih dahulu paket rsync nya, silahkan cari <a href="http://google.com">disini</a> sendiri ya <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Extrak paket yang telah didownload tadi dengan cara : # <span style="color:#0000ff;">tar -zxvf rsync-2.4.6.tar.gz</span></li>
<li>Setealah di extrak masuk kedirectorynya. misal : # <span style="color:#0000ff;">cd /home/donwload/rsync-2.4.6</span> <span style="color:#0000ff;">&lt;&lt;&#8211; letak paket di Extrak</span>.</li>
<li>Kemidian ketikan command berikut: # <span style="color:#0000ff;">./configure</span></li>
<li><span style="color:#0000ff;"><span style="color:#000000;">Kemudian buildin rsync dengan cara: # <span style="color:#0000ff;">make &amp;&amp; make install</span></span></span></li>
</ol>
<p><span style="color:#008000;"><strong><span>PENGGUNAAN RSYNC</span></strong></span></p>
<p>Ada beberapa cara untuk menggunakan rsync, langsung saja sebagai berikut ini:</p>
<p>rsync [OPTION]&#8230; SRC [SRC]&#8230; [USER@]HOST:DEST</p>
<p>rsync [OPTION]&#8230; [USER@]HOST:SRC DEST</p>
<p>rsync [OPTION]&#8230; SRC [SRC]&#8230; DEST</p>
<p>rsync [OPTION]&#8230; [USER@]HOST::SRC [DEST]</p>
<p>rsync [OPTION]&#8230; SRC [SRC]&#8230; [USER@]HOST::DEST</p>
<p>rsync [OPTION]&#8230; rsync://[USER@]HOST[:PORT]/SRC [DEST]</p>
<p>Catatan yang perlu diperhatikan dalam penggunaan rsync :</p>
<p>Ada beberapa buah cara untuk menggunakan rsync :</p>
<p>* untuk menyalinkan file-file lokal. Ini dilakukan dengan tidak menggunakan  tanda &#8220;:&#8221; pada path sumber dan tujuan.<br />
* Untuk menyalinkan dari mesin lokal ke mesin remote dengan menggunakan program remote shell sebagai alat transpornya. Dapat dilakukan ketika path tujuan berisikan tanda pemisah &#8220;:&#8221;.<br />
* untuk menyalin dari mesin remote ke mesin lokal dengan menggunakan program remote shell sebagai alat transpornya. Dapat dilakukan ketika path sumber berisikan tanda pemisah &#8220;::&#8221; atau sebuah URL rsync://.<br />
* Untuk menyalinkan dari mesin lokal ke server rsync remote. Ini dilakukan dengan memberikan tanda pemisah &#8220;::&#8221; pada path tujuan.<br />
* Untuk menampilkan daftar file-file pada mesin tujuan. Dapat dilakukan dengan cara yang sama dengan transfer rsync kecuali anda tidak mengisikan tujuan lokal.</p>
<p><strong><span style="color:#000000;">contoh</span><span style="color:#000000;"> penggunaan </span><span style="color:#000000;">rsync</span></strong>:</p>
<p># <span style="color:#0000ff;">rsync -avz  /var/www/html /home/web</span></p>
<p>command diatas akan memerintahkan untuk mentransfer file yang ada di direktori /var/www/html ke direktori /home/web, jika di direktori /home/web telah terdapat beberapa file yg sama maka rsync akan menggunakan protokol remote-update agar  mengirimkan perbedaannya saja.</p>
<p># <span style="color:#0000ff;">rsync -avz html www.yourserver.com:/html</span></p>
<p>command diatas memeintahkan untuk mentransfer data dari direktori html di komputer client ke direktori html yg ada di server www.yourserver.com. File-file ditransfer dalam mode &#8220;archive&#8221;, yang memastikan bahwa link simbolik, device, atribut, permisi, kepemilikan dan sebagainya disimpan saat transfer. Sebagai tambahan, digunakan pula kompresi untuk mengurangi ukuran data yang ditransfer.</p>
<p># rsync -avz  yourserver:data/tmp /data/tmp</p>
<p>Perintah ini akan melakukan transfer data dari data yang ada direktori  data/tmp di mesin yourserver ke direktori /data/tmp di komputer client.</p>
<p><span style="color:#008000;"><strong><span>INSTALASI RSYNC SERVER</span></strong></span></p>
<p>Untuk membuat sebuah server rsync ada dua langkah utama yang harus anda lakukan pada mesin yang ingin anda jadikan sebagai server rsync :</p>
<p><span style="color:#ff9900;"><strong>Menjalankan rsync dalam mode daemon</strong></span></p>
<p>dengan memberikan perintah rsync  &#8211;daemon(<span style="color:#ff0000;">menjalankan atau merestart rsync setelah dilakukan konfigurasi baru difile rsyncd.conf</span>) pada perintah baris.</p>
<p><span style="color:#ff9900;"><strong><span>Menset file konfigurasi /etc/rsyncd.conf</span></strong></span></p>
<p>rsyncd.conf adalah sebuah file konfigurasi rsync ketika dijalankan dengan option &#8211;daemon. Saat itulah rsync menjadi rsync server yang listening ke TCP port 873. File rsyncd.conf mengendalikan otentikasi, akses, pencatatan dan modul yang tersedia.</p>
<p><strong>Format File Konfigurasi</strong></p>
<p>File konfigurasi ini terdiri dari modul dan parameter. Modul dimulai dengan nama modul dalam tanda kurung siku dan berlanjut terus hingga awal modul berikutnya. Modul berisikan parameter dalam bentuk &#8220;name = value&#8221;.</p>
<p>Hanya tanda sama dengan pertama yang signifikan. Whitespace sebelum dan  setelah tanda sama dengan pertama diabaikan.</p>
<p>Baris yang dimulai dengan tanda &#8220;#&#8221; akan diabaikan.</p>
<p>Nilai yang dapat diberikan mengikuti tanda sama dengan di parameter berupa string (tidak dibutuhkan quote) atau boolean, yang mungkin dapat diberikan sebagai yes/no, 0/1, true/false.</p>
<p><strong>Option Global</strong></p>
<p>Parameter pertama dalam file, sebelum header modul, adalah  parameter-parameter global.</p>
<p><strong>motd file</strong></p>
<p>Option &#8220;motd file&#8221; memungkinkan anda untuk menspesifikasikan &#8220;pesan hari ini&#8221; yang akan ditampilkan ke client setiap kali koneksi. Defaultnya adalah tidak ada file motd.</p>
<p><strong>log file</strong></p>
<p>Option &#8220;log file&#8221; memberi tahu daemon rsync untuk mencatat pesan-pesan ke  file alih-alih menggunakan syslog.</p>
<p><strong>pid file</strong></p>
<p>Option &#8220;pid file&#8221; memberitahu daemon rsync untuk mencatat id prosesnya ke  file tersebut.</p>
<p><strong>syslog facility</strong></p>
<p>Option &#8220;syslog facility&#8221; memungkinkan anda menspesifikasikan nama fasilitas syslog yang akan digunakan ketika mencatat pesan-pesan ke server rsync. Anda dapat menggunakan sembarang nama fasilitas syslog standar yang didefinisikan pada sistem anda. Nama-nama umum tersebut antara lain auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6 dan local7. Bakunya adalah daemon.</p>
<p><strong>socket options</strong></p>
<p>Option ini dapat menyediakan beragam kegembiraan bagi orang-orang yang suka mengotak-atik sistem mereka. Anda dapat menset segala macam option soket yang mungkin dapat mempercepat transfer atau memperlambatnya. Silakan baca man page untuk sistem call setsockopt() untuk rincinya. Bakunya tidak ada option soket khusus yang diset.</p>
<p>Contoh sederhana :</p>
<p>[root@botak]# cat /etc/rsyncd.conf<br />
motd file = /etc/rsyncd.motd<br />
max connections = 25<br />
syslog facility = local3<br />
hosts allow = 202.146.250.212/32 202.78.201.6/32<br />
hosts deny = 0.0.0.0/0<br />
[web]<br />
comment = botak area<br />
path = /home/webs/botak/html<br />
read only = yes<br />
strict modes = false<br />
list = yes<br />
uid = webs<br />
gid = webs<br />
auth users = webs<br />
secrets file = /etc/rsyncd.secrets<br />
[emails]<br />
comment = Email botak<br />
path = /home/vpopmail/domains/botak.com<br />
use chroot = false<br />
read only = yes<br />
list = yes<br />
uid = vpopmail<br />
gid = vchkpw</p>
<p>[mysql]<br />
comment = Mysql Lapan<br />
path = /var/lib/mysql<br />
use chroot = false<br />
read only = yes<br />
list = yes<br />
uid = mysql<br />
gid = mysql</p>
<p>Sebelumnya buatlah file rsyncd.conf dan rsyncd.secrets kemudian insert dengan perintah diatas.</p>
<p>File /etc/rsyncd.secrets akan tampak sebagai berikut :</p>
<p>osamu:mypass<br />
lader:mypass</p>
<p>Sekian sedikit kutipan dan penjelasan dari pengalaman dan referensi dari rekan2 <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , terimakasih</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/katulis.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/katulis.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/katulis.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/katulis.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/katulis.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/katulis.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/katulis.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/katulis.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/katulis.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/katulis.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/katulis.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/katulis.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/katulis.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/katulis.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/katulis.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/katulis.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=katulis.wordpress.com&amp;blog=3401898&amp;post=29&amp;subd=katulis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://katulis.wordpress.com/2008/06/16/setup-rsync/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf99585bec1f921469053ef9c69b17f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">breaker</media:title>
		</media:content>

		<media:content url="/DOCUME%7E1/wwn/LOCALS%7E1/Temp/moz-screenshot.jpg" medium="image" />
	</item>
	</channel>
</rss>
