<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>wp &#124; anoopdotnet &#187; sysadmin</title>
	<atom:link href="http://wp.anoop.net/tag/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://wp.anoop.net</link>
	<description>yet another meaningless wordpress blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 08:47:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
	<atom:link rel="hub" href="http://superfeedr.com/hubbub" />
			<item>
		<title>modify system keepalive times in linux</title>
		<link>http://wp.anoop.net/2010/11/modify-system-keepalive-times-in-linux/</link>
		<comments>http://wp.anoop.net/2010/11/modify-system-keepalive-times-in-linux/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 16:15:45 +0000</pubDate>
		<dc:creator>Anoop</dc:creator>
				<category><![CDATA[Meaningless]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[netstat]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tcp]]></category>

		<guid isPermaLink="false">http://wp.anoop.net/?p=196</guid>
		<description><![CDATA[Because I always forget how. In any enterprise level application environment, you&#8217;ll find that your tiers are segregated by a firewall. In some cases, you may see this type of architecture FIREWALL -&#62; WEB -&#62; FIREWALL -&#62; APP -&#62; FIREWALL -&#62; DB or even FIREWALL -&#62; WEB -&#62; FIREWALL -&#62; APP/DB In both designs, which [...]]]></description>
			<content:encoded><![CDATA[<p>Because I always forget how.</p>
<p>In any enterprise level application environment, you&#8217;ll find that your tiers are segregated by a firewall.</p>
<p>In some cases, you may see this type of architecture</p>
<p>FIREWALL -&gt; WEB -&gt; FIREWALL -&gt; APP -&gt; FIREWALL -&gt; DB</p>
<p>or even</p>
<p>FIREWALL -&gt; WEB -&gt; FIREWALL -&gt; APP/DB</p>
<p>In both designs, which are somewhat similar, you may potentially run into keepalive issues.</p>
<p>Keepalives are essentially messages sent between two devices on a specified interval to verify the state of the connection between them. If a message is not acknowledged by the receiving device, then the transmitting device assumes the connection is down and then will find another way to route data until that connection is re-established (if it does which usually, it doesn&#8217;t)</p>
<p>Keepalives are essential in environments where you&#8217;re using connection pools. Web servers may sometimes use a connection pool to talk to an application server like tomcat or weblogic. Application servers frequently use database connection pools to ensure that the performance is optimal.</p>
<p>Most connection pools will have a keep alive setting so you should leverage that when you can. Some connection pools do not. Mod_weblogic for example doesn&#8217;t have it&#8217;s own keep alive value. It can be enabled or disabled but by default, it will use the system keepalive interval which on RHEL/CentOS systems is set to 7200 seconds (two hours).</p>
<p>To check your current system keepalive settings<br />
<code><br />
# sysctl -a | grep net.ipv4.tcp_keepalive<br />
net.ipv4.tcp_keepalive_intvl = 75<br />
net.ipv4.tcp_keepalive_probes = 9<br />
net.ipv4.tcp_keepalive_time = 7200<br />
</code></p>
<p><strong>net.ipv4.tcp_keepalive_intvl</strong> is the frequency by which keepalive messages are sent.<br />
<strong>net.ipv4.tcp_keepalive_probes</strong> tells your system how many unacknowledged keepalive messages should be ignored before considering the connection to be dead.<br />
<strong>net.ipv4.tcp_keepalive_time</strong> tells your system how long to wait before sending the first keepalive message after the last packet. This is the biggie!</p>
<p>I don&#8217;t understand why 7200 seconds was chosen as a number. In my environment here, the firewall can drop idle connections after one hour and sometimes even less depending on how big the connection table can get (I&#8217;m looking at you checkpoint).</p>
<p>So I normally trim these down so that the keepalive time is less and the number of probes is more. The interval is also reduced by a bit but that&#8217;s not really important. You would normally make these changes on the server that is initiating the connection. A webserver, or an application server. Sometimes a DB server but not always.</p>
<p>in /etc/sysctl.conf, add these lines (or modify them if they&#8217;re already there)</p>
<p><code><br />
net.ipv4.tcp_keepalive_intvl = 60<br />
net.ipv4.tcp_keepalive_probes = 20<br />
net.ipv4.tcp_keepalive_time = 300<br />
</code></p>
<p>To put these settings into effect, run </p>
<p><code><br />
sysctl -p /etc/sysctl.conf<br />
</code></p>
<p>and now retest with sysctl -a</p>
<p>Once set, you will need to restart your webserver or app server so it sees the new settings. This allows you to start with a fresh set of connections that you can actually monitor using netstat.</p>
<p>You should be able to corroborate on both ends of the connection, the ports, state and number of connections which tells you that things are A-OK!</p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.anoop.net/2010/11/modify-system-keepalive-times-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My vim settings</title>
		<link>http://wp.anoop.net/2010/11/my-vim-settings/</link>
		<comments>http://wp.anoop.net/2010/11/my-vim-settings/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 15:44:36 +0000</pubDate>
		<dc:creator>Anoop</dc:creator>
				<category><![CDATA[Meaningless]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://wp.anoop.net/?p=2039</guid>
		<description><![CDATA[From time to time, I find some settings for vi on remote systems that really kind of freak me out. The one I found recently was &#8216;incsearch&#8217; so I decided to use this opportunity to note down the settings I use on a daily basis. Hope you find some of these useful. syntax on   [...]]]></description>
			<content:encoded><![CDATA[<p>From time to time, I find some settings for vi on remote systems that really kind of freak me out. The one I found recently was &#8216;incsearch&#8217; so I decided to use this opportunity to note down the settings I use on a daily basis. Hope you find some of these useful.</p>
<p><code><br />
syntax on  <br />
set hlsearch<br />
set incsearch<br />
set ruler<br />
set showmatch<br />
</code></p>
<p><strong>syntax on</strong> is pretty obvious. If you&#8217;re writing code, it&#8217;s pretty smart about highlighting the code so it&#8217;s easier to read. It can be odd at first but I find it really useful and after a while, it becomes second nature.</p>
<p><strong>set hlsearch</strong> highlights your search terms so they&#8217;re easy to see. I like this option a lot. not everyone does. </p>
<p><strong>set incsearch</strong> searches as you type. It&#8217;s new to me so I&#8217;m still getting used to it but I think I can already see some uses for it.</p>
<p><strong>set ruler</strong> shows you where your cursor is at all times. I like this option a lot if only to tell me what line number I&#8217;m on. <strong>set number</strong> will also do this but I also find it irritating because it also interferes with my copy/paste habits.</p>
<p><strong>set showmatch</strong> is really useful if you&#8217;re a coder. If you&#8217;ve got somewhat complicated conditional statements or loops, this feature will show you where brackets match so you can find missing brackets and close the proper blocks.</p>
<p>Hope these help. I&#8217;ll update these as I find more. </p>
]]></content:encoded>
			<wfw:commentRss>http://wp.anoop.net/2010/11/my-vim-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>repos not updating in spacewalk. taskomatic!</title>
		<link>http://wp.anoop.net/2010/11/repos-not-updating-in-spacewalk-taskomatic/</link>
		<comments>http://wp.anoop.net/2010/11/repos-not-updating-in-spacewalk-taskomatic/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 21:42:05 +0000</pubDate>
		<dc:creator>Anoop</dc:creator>
				<category><![CDATA[Geekdom]]></category>
		<category><![CDATA[Meaningless]]></category>
		<category><![CDATA[Technobabble]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[repos]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[rpms]]></category>
		<category><![CDATA[Spacewalk]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[taskomatic]]></category>

		<guid isPermaLink="false">http://wp.anoop.net/?p=1656</guid>
		<description><![CDATA[Spacewalk, it&#8217;s pretty damn awesome. Or at least, I think it is. It&#8217;s an open source linux systems management solution from Redhat (GPLv2). Once you get spacewalk up and running, you&#8217;ll be amazed by some of the things it does. It can push config files, packages, inventory systems, group them and allow you to work [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://spacewalk.redhat.com">Spacewalk</a>, it&#8217;s pretty damn awesome. Or at least, I think it is. It&#8217;s an open source linux systems management solution from Redhat (GPLv2).</p>
<p>Once you get spacewalk up and running, you&#8217;ll be amazed by some of the things it does. It can push config files, packages, inventory systems, group them and allow you to work exclusively with those groups in a very easy way. That&#8217;s only scratching the surface of what spacewalk is capable of.</p>
<p>I like it because I can setup custom channels where I can push custom software to each of my servers. From time to time though, I notice that the repos don&#8217;t really rebuild automatically. If you look at the &#8220;details&#8221; section of your channel, you&#8217;ll notice something like this</p>
<p><img src="http://wp.anoop.net/wp-content/uploads/2010/11/Screen-shot-2010-11-13-at-2.27.19-PM.png" alt="" width="568" height="110"></p>
<p>The times don&#8217;t match. It probably means that the taskomatic daemon is not running or is running but isn&#8217;t really pulling tasks from the database.</p>
<p>To verify, login to sqlplus and run this query<br />
<code><br />
sqlplus spacewalk/spacewalk@xe</p>
<p>SQL*Plus: Release 10.2.0.4.0 - Production on Sat Nov 13 14:14:00 2010</p>
<p>Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.</p>
<p>Connected to:<br />
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production</p>
<p>SQL&gt; select * from rhnTaskQueue;</p>
<p>ORG_ID TASK_NAME<br />
---------- ----------------------------------------------------------------<br />
TASK_DATA   PRIORITY EARLIEST<br />
---------- ---------- ---------<br />
1 update_errata_cache_by_channel<br />
143	    0 13-NOV-10</p>
<p>1 update_errata_cache_by_channel<br />
122	    0 12-NOV-10</p>
<p>1 update_errata_cache_by_channel<br />
208	    0 13-NOV-10</p>
<p>ORG_ID TASK_NAME<br />
---------- ----------------------------------------------------------------<br />
TASK_DATA   PRIORITY EARLIEST<br />
---------- ---------- ---------<br />
1 update_errata_cache_by_channel<br />
122	    0 13-NOV-10<br />
</code></p>
<p>Notice how some tasks are older? This table should almost always be empty or only have data for a small period of time as the name suggests.</p>
<p>Restarting taskomatic is as simple as</p>
<p><code><br />
[root@spacewalk init.d]# ./taskomatic stop<br />
Stopping RHN Taskomatic...<br />
Stopped RHN Taskomatic.<br />
[root@spacewalk init.d]# ./taskomatic start<br />
Starting RHN Taskomatic...<br />
</code></p>
<p>Wait about 10 minutes, because that&#8217;s the polling time for taskomatic, and then check the database again. There should be no rows</p>
<p><code><br />
SQL&gt; select * from rhnTaskQueue;</p>
<p>no rows selected<br />
SQL&gt;<br />
</code></p>
<p>Also check the spacewal UI and look for something like this</p>
<p><a href="http://wp.anoop.net/wp-content/uploads/2010/11/Screen-shot-2010-11-13-at-2.55.53-PM1.png"><img title="Screen shot 2010-11-13 at 2.55.53 PM" src="http://wp.anoop.net/wp-content/uploads/2010/11/Screen-shot-2010-11-13-at-2.55.53-PM1.png" alt="" width="566" height="107" /></a></p>
<p>or</p>
<p><a href="http://wp.anoop.net/wp-content/uploads/2010/11/Screen-shot-2010-11-13-at-3.35.53-PM.png"><img src="http://wp.anoop.net/wp-content/uploads/2010/11/Screen-shot-2010-11-13-at-3.35.53-PM.png" alt="" title="Screen shot 2010-11-13 at 3.35.53 PM" width="581" height="105" /></a></p>
<p>Spacewalk is still very much in its infancy but it shows great promise and there is a great community of people who are willing to help and are dedicated to making it a rich and feature full product. Spacewalk 1.1 was released recently and we haven&#8217;t had a chance to upgrade yet but I continue to see great things coming from spacewalk and that makes me happy.</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.anoop.net/2010/11/repos-not-updating-in-spacewalk-taskomatic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>testing identd from the command line (telnet)</title>
		<link>http://wp.anoop.net/2009/07/testing-identd-from-the-command-line-telnet/</link>
		<comments>http://wp.anoop.net/2009/07/testing-identd-from-the-command-line-telnet/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 04:59:06 +0000</pubDate>
		<dc:creator>Anoop</dc:creator>
				<category><![CDATA[Meaningless]]></category>
		<category><![CDATA[Technobabble]]></category>
		<category><![CDATA[identd]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tcpdump]]></category>
		<category><![CDATA[telnet]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://wp.anoop.net/?p=90</guid>
		<description><![CDATA[You should know that I only recommend doing this on systems that you ABSOLUTELY trust. If you have any doubt what so ever, do NOT continue. I never thought i&#8217;d actually need this but i ended up actually providing it as a solution for securing database accounts. To get this working on CentOS 5, I [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>You should know that I only recommend doing this on systems that you ABSOLUTELY trust. If you have any doubt what so ever, do NOT continue.
</p></blockquote>
<p>I never thought i&#8217;d actually need this but i ended up actually providing it as a solution for securing database accounts.</p>
<p>To get this working on CentOS 5, I had to do the following</p>
<p># yum install xinetd authd</p>
<p>authd is an xinetd service and authd is the RFC 1413 identd service</p>
<p>Out of the box, authd comes a little more secure than I expected. It&#8217;s not bad but it&#8217;s definitely a hindrance for other systems when they don&#8217;t know what to send.</p>
<p>/etc/xinetd.d/auth will come by default with<br />
<code><br />
server_args     = -t60 --xerror --os -E<br />
</code></p>
<p>This tells inetd to expect the &#8216;uname&#8217; instead of &#8216;UNIX&#8217; as the OS name. It&#8217;s great that it offers this option but I don&#8217;t know if all identd clients need to know what OS it is. You can leave it in if you like. Lastly, it tells identd to encrypt the username and then send it. I&#8217;m not sure how many identd clients can handle that.</p>
<p>I changed it to </p>
<p><code><br />
server_args     = -t60 --xerror<br />
</code></p>
<p>start or restart xinetd and you should see 113 listening.</p>
<p>I&#8217;m a lazy guy so I can&#8217;t be bothered to open more than one connection to a server. You can open two if you prefer.</p>
<p>I login and start tcpdump</p>
<p><code><br />
tcpdump -i lo -nn "port 113" &#038;<br />
telnet localhost 113<br />
</code></p>
<p>It should show you distinctly what port two ports are involved in the connection you just made. </p>
<p><em>IP 127.0.0.1.SOURCE_PORT_NUM > 127.0.0.1.113</em></p>
<p>Next type in &#8220;SOURCE_PORT_NUM,113&#8243; and hit Enter. Note that &#8220;SOURCE_PORT&#8221; here is a NUMBER not actually &#8220;SOURCE_PORT&#8221;</p>
<p>Amidst all the messy tcpdump output, you should see a line</p>
<p><em>SOURCE_PORT_NUM , 113 : USERID : UNIX :root</em></p>
<p>That shows you that identd is working properly. At least locally.</p>
<p>So if you ever find any of this useless knowledge helpful, let me know.</p>
<p>Unix/Linux admins are taught to hate identd because it&#8217;s pretty much the least secure protocol but I have to believe that it has a place in an environment that is completely trusted. You don&#8217;t have random users logging in or random accounts being created.</p>
<p>I think the overall advantage here is that you can use this to provide an additional layer of security across your trusted enterprise.</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.anoop.net/2009/07/testing-identd-from-the-command-line-telnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

