<?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>108.bz &#187; Troubleshooting</title>
	<atom:link href="http://www.108.bz/posts/tag/troubleshooting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.108.bz</link>
	<description>Wandering futilities...</description>
	<lastBuildDate>Fri, 27 May 2011 09:08:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Slow write performance and partition alignment</title>
		<link>http://www.108.bz/posts/it/slow-write-performance-and-partition-alignment/</link>
		<comments>http://www.108.bz/posts/it/slow-write-performance-and-partition-alignment/#comments</comments>
		<pubDate>Tue, 24 May 2011 21:45:00 +0000</pubDate>
		<dc:creator>Giuliano</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Benchmarking]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.108.bz/?p=717</guid>
		<description><![CDATA[Or how a single sector can make you ten times more happier. Today I&#8217;ll talk about a client issue: getting (extremely) slow write performance when backing up my laptop over an USB drive (a 200GB Samsung S1 Mini). All I usually do is booting the PC with SystemRescueCd, plug an USB disk in, &#8220;ddrescue /dev/sda [...]]]></description>
			<content:encoded><![CDATA[<p>Or how a single sector can make you ten times more happier.<br />
Today I&#8217;ll talk about a client issue: getting (extremely) slow write performance when backing up my laptop over an USB drive (a 200GB Samsung <a href="http://www.samsung.com/global/business/hdd/external/external_mini.html">S1 Mini</a>). All I usually do is booting the PC with <a href="http://www.sysresccd.org/">SystemRescueCd</a>, plug an USB disk in, &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;"><a href="http://www.gnu.org/software/ddrescue/ddrescue.html">ddrescue</a> /dev/sda /mnt/externaldisk/laptop_disk_image.dd</a></span>&#8220;, letting it run overnight. Except that this morning the backup wasn&#8217;t finished yet. What&#8217;s wrong? Long post (for a simple solution) ahead&#8230;</p>
<p>The USB disk (shown below as <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">/dev/sdb*</span>) &#8220;feels&#8221; fast when reading and awfully slow when writing. The most simple way to do an HDD benchmark is, of course <a href="http://en.wikipedia.org/wiki/Dd_(Unix)">dd</a>. Use it along with <a href="http://dag.wieers.com/home-made/dstat/">dstat</a> (an essential tool when pinpointing performance issues, whatever they may be) and you&#8217;ll quickly gather some useful figures. <i>Beware!</i> <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">dd</span> can ruin all your data just by mistaking a &#8220;b&#8221; for an &#8220;a&#8221;: triple-check and make sure that you&#8217;re running it on the right devices!</p>
<p>A sequential write test:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">balrog ~ # dd if=/dev/zero of=/mnt/temp/x.bin bs=16384 count=$((100*1024))<br />
102400+0 records in<br />
102400+0 records out<br />
1677721600 bytes (1.7 GB) copied, 455.334 s, 3.7 MB/s</div></div>
<p>3.7 MB/s only, definitely slow. <img src='http://www.108.bz/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Note that you shouldn&#8217;t use <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">/dev/{random,urandom}</span> as input file, they&#8217;re a bottleneck by themselves. <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">/dev/zero</span>, on the other hand, is super-fast. &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">dd if=/dev/zero of=/dev/null bs=16384 count=$((10000*1024))</span>&#8221; (shove zeros to /dev/null) is bound only by the CPU, running at about 9.3 GB/s here.</p>
<p>A sequential read test:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">balrog ~ # dd if=/mnt/temp/x.bin of=/dev/null bs=16384 count=$((100*1024))<br />
102400+0 records in<br />
102400+0 records out<br />
1677721600 bytes (1.7 GB) copied, 52.1106 s, 32.2 MB/s</div></div>
<p>30 MB/s, that&#8217;s the order of magnitude I was expecting (confirmed <a href="http://www.storagereview.com/samsung_s1_mini_review">here</a>).</p>
<p>If I repeat the write test and, at the same time, run <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">dstat</span>, I notice that there are no burst or drops: speed is constant.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">balrog linux-2.6.36-gentoo-r5 # dstat -p -d -D sdb<br />
---procs--- --dsk/sdb--<br />
run blk new| read &nbsp;writ<br />
&nbsp; 0 &nbsp; 0 1.0| 362k &nbsp;888k &nbsp; &nbsp;# &lt;-- ignore the first sample<br />
&nbsp; 0 &nbsp; 0 &nbsp; 0| &nbsp; 0 &nbsp; &nbsp; 0 <br />
4.0 1.0 1.0| &nbsp; 0 &nbsp; &nbsp; 0 <br />
1.0 2.0 &nbsp; 0| &nbsp; 0 &nbsp; 360k &nbsp; &nbsp;# &lt;-- &quot;dd&quot; starts<br />
&nbsp; 0 2.0 &nbsp; 0| &nbsp; 0 &nbsp;3360k<br />
&nbsp; 0 2.0 &nbsp; 0| &nbsp; 0 &nbsp;3240k<br />
1.0 2.0 &nbsp; 0| &nbsp; 0 &nbsp;3240k<br />
&nbsp; 0 2.0 &nbsp; 0| &nbsp; 0 &nbsp;3240k</div></div>
<p>Since reading works, kernel and USB Host Controller seem to go along well. Issue should lie on the disk&#8217;s side. I had no clue of what was happening until I tried writing straight to the disk instead of the first primary partition (i.e.: /dev/sdb instead of /dev/sdb1), thus <i>trashing the filesystem</i> (I&#8217;ve got no data to lose on that disk: no worries).</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">balrog ~ # dd if=/dev/zero of=/dev/sdb bs=16384 count=$((100*1024))<br />
1677721600 bytes (1.7 GB) copied, 63.0382 s, 26.6 MB/s</div></div>
<p>Even though the difference between read and write throughput seems to be too much (almost one order of magnitude), this is starting to look like a FS blocksize/partition aligment issue. Well, some disks use a physical sector size (PSS) of 512 bytes. Others use 4096 bytes (4 KiB). Others use the latter but tell the OS that they&#8217;re using 512 bytes or more simply the OS can&#8217;t figure out the right physical sector size&#8230; And USB mass storage devices tell the OS almost nothing (<a href="http://en.wikipedia.org/wiki/Hdparm">hdparm</a> won&#8217;t help this time)&#8230;</p>
<p>Filesystem (or other &#8220;structured storage&#8221; systems like, for instance, datafiles in databases) organize their data in blocks. The <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">block size</span> can sometimes be adjusted. 4096 bytes is a quite common value:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">balrog ~ # tune2fs -l /dev/sdb1 | grep -i block.size<br />
Block size: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4096</div></div>
<p>A sector represents the smallest chunk of data that can be read/written from/to a disk. If its size is 512, and the filesystem block size is 4096, the filesystem driver will read/write batches of 8 sectors. Better said: the FS thinks to deal with 4k blocks, not knowing that lower level functions will further split them in eight (if only logically).<br />
Consider another example: the PSS is 4096, but the drive acts as if it was 512.  Physical sectors can be found at absolute offset sector_number*512*8 (0, 4096, 8192, &#8230;).  What if a 4k write operation happens at offset 1*512*8-512? (3584, it doesn&#8217;t look like a &#8220;bad&#8221; offset: as far as the OS is concerned, any multiple of 512 is fine). The drive, being unable to write less than 4k and at proper locations, will: read sector 0, read sector 1, modify the last 512 bytes chunk of sector 0, modify the first three chunks of sector 1 then write both sectors (or something similar). If things were properly aligned, a single write operation would&#8217;ve sufficed. Read operations speed, on the other hand, may be almost unaffected. Think about it: unless you&#8217;re dealing with tons of 4k files spread across sector couples (i.e.: two sectors read instead of one), large chunks of data are (hopefully) laid out sequentially of the disc. Reading 1GB plus 512 bytes, instead of 1GB alone, won&#8217;t change anything benchmarks.</p>
<p>What&#8217;s up with my partition?</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">balrog ~ # sfdisk -uS -l /dev/sdb &nbsp; &nbsp;<br />
<br />
Disk /dev/sdb: 24321 cylinders, 255 heads, 63 sectors/track<br />
Units = sectors of 512 bytes, counting from 0<br />
<br />
&nbsp; &nbsp;Device Boot &nbsp; &nbsp;Start &nbsp; &nbsp; &nbsp; End &nbsp; #sectors &nbsp;Id &nbsp;System<br />
/dev/sdb1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;63 390716864 &nbsp;390716802 &nbsp;83 &nbsp;Linux</div></div>
<p><span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">sfdisk</span> (one of <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">fdisk</span>&#8216;s cousins) shows that the partition starts at byte 63*512=32256. This value isn&#8217;t divisible by 4096, yielding a non integer result. Sector 64, instead, is a good place to start an aligned partition:</p>
<p>63*512/4096 = 7.87<br />
64*512/4096 = 8.00   </p>
<p>Similarly, other partitions should start at sectors that are multiples of 8 (because 512*8=4096).<br />
This is the corrected partition table. Moving the partition forward (by a mere 512 bytes) causes a 10x write speed increase.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">balrog ~ # sfdisk -uS -l /dev/sdb<br />
<br />
Disk /dev/sdb: 24321 cylinders, 255 heads, 63 sectors/track<br />
Units = sectors of 512 bytes, counting from 0<br />
<br />
&nbsp; &nbsp;Device Boot &nbsp; &nbsp;Start &nbsp; &nbsp; &nbsp; End &nbsp; #sectors &nbsp;Id &nbsp;System<br />
/dev/sdb1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;64 390721967 &nbsp;390721904 &nbsp;83 &nbsp;Linux</div></div>
<p>You may still have a question though. Does aligning a <i>partition</i> mean that the contained <i>filesystem</i> is aligned too? You&#8217;re right, that assumption should not be taken for a fact.</p>
<p>A filesystem is made up of &#8220;your&#8221; data and &#8220;its&#8221; data (the latter being internal structures necessary to organize the former). In any case, a FS will try to pad/align stuff to the block size. That was to say that, if you start a partition and the partition is aligned to a given boundary, the filesystem (all of its composing blocks) will be aligned too.</p>
<p>You can find a description of the ext2 layout <a href="http://www.nongnu.org/ext2-doc/ext2.html#DISK-LAYOUT-SAMPLE-20MB">here</a>. Partition starts with two sectors reserved for the boot loader. Then comes a 1k chunk holding ext2 &#8220;superblock&#8221;. At offset 56 within the superblock, we should find the ext2 magic number (0x53EF), and here it is:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">giuliano@giuliano ~ $ dd if=/dev/sdb1 bs=512 skip=2 count=1 2&gt;/dev/null | xxd -s +56 -l 2<br />
0000038: 53ef &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; S.</div></div>
<p>The next byte after the superblock, is byte 4096. From then on, everything happens (from the FS point of view) in chunks as big as the configured block size. My disk is a 4k sector disk, formatted with a single partition aligned (as the FS) to a 4K block. FS block size is 4K too. Can&#8217;t do really do any better than that besides choosing a filesystem that manages to handle the given workload with fewer read/write operations, but I digress&#8230;</p>
 <img src="http://www.108.bz/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=717" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.108.bz/posts/it/slow-write-performance-and-partition-alignment/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>About path thrashing and why you should always zone</title>
		<link>http://www.108.bz/posts/it/about-path-thrashing-and-why-you-should-always-zone/</link>
		<comments>http://www.108.bz/posts/it/about-path-thrashing-and-why-you-should-always-zone/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 08:58:36 +0000</pubDate>
		<dc:creator>Giuliano</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[SAN]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://www.108.bz/?p=703</guid>
		<description><![CDATA[So, Customer starts updating all of his VMware ESX hosts and things turn out for the worst. VMs are crawling slow (ping response time from 0 to 1000ms), console access through vSphere client doesn&#8217;t always work, and hosts&#8217; CPU percentage is unnaturally high. Cause is apparent: path thrashing. Path thrashing happens when, for some reason, [...]]]></description>
			<content:encoded><![CDATA[<p>So, Customer starts updating all of his VMware ESX hosts and things turn out for the worst. VMs are crawling slow (ping response time from 0 to 1000ms), console access through vSphere client doesn&#8217;t always work, and hosts&#8217; CPU percentage is unnaturally high. Cause is apparent: path thrashing.<br />
Path thrashing happens when, for some reason, SCSI LUNs are being continuously reassinged from a controller (Target) to another one. ESX has a hard time &#8220;bouncing&#8221; I/O back and forth on the right Fibre Channel path. On Active/Passive SAN arrays a LUN can be &#8220;owned&#8221; by just one controller at a time. If the LUN owner has to be changed because of a hardware failure (path, Controller, SFP/GBIC, FC switch, &#8230;) or because the Initiator would like to, the LUN itself has to &#8220;trespass&#8221; (in EMC parlance), transition to another controller. The &#8220;command&#8221; to do so can be issued by the Initiator or internally by the storage subsystem.<br />
Back to today&#8217;s case, I was dealing with an IBM DS4800 where LUNs flipped like mad between controller A and B. How to stop it quickly?</p>
<ul>
<li>If anything, the flipping shows that failover works as expected (VMs don&#8217;t crash despite the chaos).</li>
<li>That said, I could just disconnect a controller. Not really because the same storage system hosts an Oracle RAC cluster, humming along happily, unaffected by the issue.</li>
<li>I need a way to selectively &#8220;hide&#8221; a controller from one or more hosts. I can do it easily by tweaking the SAN zoning configuration.</li>
</ul>
<p>A Zone (much like a VLAN) is basically a group of WWNs (or ports). Objects in the Zone can only talk to each other. While creating Zones, it is common practice to &#8220;go minimal&#8221;: they should contain as few stuff as possible. I usually name them like this:<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">Z_HOSTNAME_P1_DS4800_CA1_CB1</span><br />
HBA Port 1 of HOSTNAME can see Controller A/Port 1 and Controller B/Port 1 of the DS4800.<br />
Thus, going through each ESX server&#8217;s Zone, I just remove the Controller that the host shouldn&#8217;t see. Path thrashing is temporarily stopped.<br />
The above rant serves mainly as a pro-zoning argument. &#8220;If every HBA port has to access every Controller&#8217;s port, why implement zoning?&#8221;. As you just read, zoning saved me from serious trouble, today.<br />
About the &#8220;real&#8221; issue, it was ultimately caused by a thing called &#8220;Auto Volume Transfer&#8221; (AVT)<sup class='footnote'><a href='#fn-703-1' id='fnref-703-1'>1</a></sup>. Let&#8217;s say that a LUN is assigned to controller A, but I/O for the LUN is issued to controller B. With AVT switched on the storage system will automatically transfer the LUN from A to B.<br />
The Customer ESX servers are all (correctly) configured to use the &#8220;Most Recently Used&#8221; (MRU) <a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&#038;cmd=displayKC&#038;externalId=1003973">path</a> to a LUN. It seems that ESX, from a certain version on, issues I/O on the standby path, causing havoc if AVT is on. I can&#8217;t tell if that&#8217;s because it is fooled into thinking that the storage is an Active/Active one or if it just sort of periodically &#8220;probes&#8221; standby paths.<br />
How do you switch AVT off? By using the DS &#8220;Storage Manager&#8221; and changing the ESX Hosts&#8217; type from &#8220;Linux&#8221; (or whatever) to &#8220;LNXCLVMWARE&#8221;. This applies to all of the LSI derived Storage Systems (IBM, SUN StorageTek, Engenio, &#8230;). The latter host type is the right one to use when hooking an ESX cluster to an IBM DS Storage System. But &#8220;Linux&#8221; seems to do just fine on not so new ESX hosts version 4.1.x &#8230; When AVT is off, the Storage will decide to trespass LUNs only in the event of an internal hardware failure while, normally, LUN ownership will be handled by the multipathing software on the Host.</p>
<p>More reading on the subject:</p>
<p>[<a href="https://www.ibm.com/developerworks/forums/message.jspa?messageID=14532649">1</a>] Differences between the &#8220;Linux&#8221; and &#8220;LNXCLVMWARE&#8221; host types.<br />
[<a href="http://webcache.googleusercontent.com/search?q=cache:SP6Ytyb4-0YJ:https://selfservice.lsi.com/service/main.jsp%3Bjsessionid%3D0637AE74501C3CB54E44A071BEFF108D%3Ft%3DsolutionTab%26ft%3DsearchTab%26ps%3DsolutionPanels%26locale%3Den_US%26_dyncharset%3DUTF-8%26curResURL%3D%252Fservice%252Fmain.jsp%253Bjsessionid%253D0637AE74501C3CB54E44A071BEFF108D%253F_dyncharset%253DUTF-8%2526_dynSessConf%253D3633170421896306112%2526t%253DsearchTab%2526locale%253Den_US%2526_dyncharset%253DUTF-8%2526topicName%253D%2526sfield%253D%2526dosearch%253Dtrue%2526searchstring%253DQuery%25252520does%25252520not%25252520work%25252520in%25252520WINS%2526useFocusTopic%253Dtrue%2526focusTopic%253D9000029%26solutionId%3DLSI7423%26isSrch%3DYes+site:selfservice.lsi.com+AVT&#038;cd=1&#038;hl=en&#038;ct=clnk&#038;client=opera&#038;source=www.google.com">2</a>] <i>How does Auto Volume Transfer (AVT) work?</i> Courtesy of Google&#8217;s cache. Lists which SCSI commands trigger AVT.<br />
[<a href="https://www.ibm.com/developerworks/mydeveloperworks/blogs/VirtuallySpeaking/entry/vmware_scsi_errors_and_conditions_ibm_ds_storage_systems1?lang=en">3</a>] A really nice blog post about the same issue described here. (Found, of course, when I was writing mine)</p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-703-1'>or even &#8220;Auto Disk Transfer&#8221; (ADT) <span class='footnotereverse'><a href='#fnref-703-1'>&#8617;</a></span></li>
</ol>
</div>
 <img src="http://www.108.bz/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=703" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.108.bz/posts/it/about-path-thrashing-and-why-you-should-always-zone/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Oracle Grid Control &#8211; crashing runInstaller</title>
		<link>http://www.108.bz/posts/it/oracle-grid-control-crashing-runinstaller/</link>
		<comments>http://www.108.bz/posts/it/oracle-grid-control-crashing-runinstaller/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 23:20:27 +0000</pubDate>
		<dc:creator>Giuliano</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[JRE]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.108.bz/?p=659</guid>
		<description><![CDATA[Today I ran into a weird issue while installing Oracle Grid Control Agent 10.2.0.3 on Linux. Right after typing &#8220;runInstaller&#8221;, OUI crashed because of segmentation fault&#8230; Let me talk about some of the troubleshooting maneuvers you may need to perform should you find yourself in similar troubles. Here are the relevant details: OS: Red Hat [...]]]></description>
			<content:encoded><![CDATA[<p>Today I ran into a weird issue while installing Oracle Grid Control Agent 10.2.0.3 on Linux. Right after typing &#8220;runInstaller&#8221;, OUI crashed because of segmentation fault&#8230; Let me talk about some of the troubleshooting maneuvers you may need to perform should you find yourself in similar troubles.</p>
<p>Here are the relevant details:</p>
<ul>
<li>OS: Red Hat Enterprise Linux Server 5.3 x86-64</li>
<li>GC Agent: Oracle Enterprise Manager 10g Grid Control Release 3 (10.2.0.3) for Linux x86-64</li>
<li>GC Console: Oracle Enterprise Manager 10g Release 5 (10.2.0.5) Grid Control for Microsoft Windows 32-bit</li>
</ul>
<p>And here&#8217;s the error message (the most interesting portions):</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">An unexpected exception has been detected in native code outside the VM.<br />
Unexpected Signal : 11 occurred at PC=0xE44F46A7<br />
Function=[Unknown.]<br />
Library=(N/A)<br />
<br />
[..]<br />
<br />
Current Java thread:<br />
&nbsp; &nbsp; &nbsp; &nbsp; at sun.awt.motif.MToolkit.init(Native Method)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at sun.awt.motif.MToolkit.&lt;init&gt;(Unknown Source)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)<br />
&nbsp; &nbsp; &nbsp; &nbsp; at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)<br />
<br />
[..]<br />
<br />
Heap at VM Abort:<br />
Heap<br />
&nbsp;def new generation &nbsp; total 576K, used 84K [0xe6510000, 0xe65b0000, 0xe7090000)<br />
&nbsp; eden space 512K, &nbsp; 4% used [0xe6510000, 0xe65152f8, 0xe6590000)<br />
&nbsp; from space 64K, 100% used [0xe65a0000, 0xe65b0000, 0xe65b0000)<br />
&nbsp; to &nbsp; space 64K, &nbsp; 0% used [0xe6590000, 0xe6590000, 0xe65a0000)<br />
&nbsp;tenured generation &nbsp; total 6212K, used 4461K [0xe7090000, 0xe76a1000, 0xefb10000)<br />
&nbsp; &nbsp;the space 6212K, &nbsp;71% used [0xe7090000, 0xe74eb5f8, 0xe74eb600, 0xe76a1000)<br />
&nbsp;compacting perm gen &nbsp;total 5632K, used 5398K [0xefb10000, 0xf0090000, 0xf3b10000)<br />
&nbsp; &nbsp;the space 5632K, &nbsp;95% used [0xefb10000, 0xf00558b0, 0xf0055a00, 0xf0090000)<br />
<br />
Local Time = Tue Feb &nbsp;8 09:45:48 2011<br />
Elapsed Time = 1<br />
#<br />
# The exception above was detected in native code outside the VM<br />
#<br />
# Java VM: Java HotSpot(TM) Client VM (1.4.2_08-b03 mixed mode)<br />
#</div></div>
<p>To go past this show-stopper I tried a few things&#8230;</p>
<p>The Heap report produced by java at crash time, seemed to indicate a memory shortage. By editing the &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">install/oraparam.ini</span>&#8221; file, you can tweak how much RAM is available for OUI&#8217;s JVM. Just alter &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">JRE_MEMORY_OPTIONS</span>&#8221; value.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#JRE_MEMORY_OPTIONS=&quot; -mx150m&quot;<br />
JRE_MEMORY_OPTIONS=&quot; -Xms512m -Xmx2048m&quot;</div></div>
<p>This is also a safe place to put additional command line parameters: they&#8217;ll mostly be passed to java&#8217;s command line. I said &#8220;mostly&#8221; because OUI wrapper/launcher seems to check some sort of allowed parameters list and may refuse to go on if somethings doesn&#8217;t look right.</p>
<p>The &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">-XX:MaxPermSize=32m</span>&#8221; is one of the knobs that doesn&#8217;t pass the sanity check. In order to run OUI&#8217;s JVM by hand, with the right parameters, just keep the first lines of runInstaller (the ones starting with &#8216;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">Arg:</span>&#8216;):</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Arg:0:/tmp/OraInstall2011-02-08_04-55-33PM/jre/1.4.2/bin/java:<br />
Arg:1:-Doracle.installer.library_loc=/tmp/OraInstall2011-02-08_04-55-33PM/oui/lib/linux:<br />
Arg:2:-Doracle.installer.oui_loc=/tmp/OraInstall2011-02-08_04-55-33PM/oui:<br />
Arg:3:-Doracle.installer.bootstrap=TRUE:<br />
[..]<br />
Arg:20:-timestamp:<br />
Arg:21:2011-02-08_04-55-33PM:<br />
Arg:22:-nowelcome:</div></div>
<p>Strip &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">^Arg:</span>&#8220;, &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">^\d*:</span>&#8220;, &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">:$</span>&#8220;, add a trailing &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;"> \</span>&#8221; and you&#8217;ll have an OUI launching shell script you can alter at will.</p>
<p>Increasing JVM&#8217;s memory led to no effect. Heap report looked fine (usage percentages went down) but crash was still there.</p>
<p>Another useful switch is &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">-XX:+ShowMessageBoxOnError</span>&#8220;. It makes java halt on error, allowing us to attach a debugger and perform a stack backtrace, e.g.:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Unexpected Signal: 11, PC: 0x6d4626a7, PID: 4866<br />
An error has just occurred.<br />
To debug, use 'gdb /tmp/OraInstall2011-02-08_11-01-42AM/jre/1.4.2/bin/java 4866'; then switch to thread -136623920</div></div>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#0 &nbsp;0xffffe410 in __kernel_vsyscall ()<br />
#1 &nbsp;0xf7e462b6 in nanosleep () from /lib/libc.so.6<br />
#2 &nbsp;0xf7e460df in sleep () from /lib/libc.so.6<br />
#3 &nbsp;0xf7bdc6d7 in os::message_box ()<br />
&nbsp; &nbsp;from /tmp/OraInstall2011-02-08_11-01-42AM/jre/1.4.2/lib/i386/client/libjvm.so<br />
#4 &nbsp;0xf7bd9c52 in os::handle_unexpected_exception ()<br />
&nbsp; &nbsp;from /tmp/OraInstall2011-02-08_11-01-42AM/jre/1.4.2/lib/i386/client/libjvm.so<br />
#5 &nbsp;0xf7bddbf6 in JVM_handle_linux_signal ()<br />
&nbsp; &nbsp;from /tmp/OraInstall2011-02-08_11-01-42AM/jre/1.4.2/lib/i386/client/libjvm.so<br />
#6 &nbsp;0xf7bdc9d8 in signalHandler ()<br />
&nbsp; &nbsp;from /tmp/OraInstall2011-02-08_11-01-42AM/jre/1.4.2/lib/i386/client/libjvm.so<br />
#7 &nbsp;&lt;signal handler called&gt;<br />
#8 &nbsp;0x6d4626a7 in ?? ()<br />
#9 &nbsp;0x6d6d75b9 in XtToolkitInitialize () from /usr/lib/libXt.so.6</div></div>
<p>I also tried to &#8220;inject&#8221; a couple of newer JVM&#8217;s into the stage directory. The quickest way is to borrow it from another installer.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[oracle@racnode01 orastage]$ find . -type d -name oracle.swd.jre -exec echo {} \; -exec ls {} \;<br />
./Linux_x86_64_Grid_Control_full_102030/Disk1/stage/Components/oracle.swd.jre<br />
1.4.2.8.0<br />
./p6810189_10204_Linux-x86-64/Disk1/stage/Components/oracle.swd.jre<br />
1.4.2.14.0</div></div>
<p>The server&#8217;s has a &#8220;working&#8221; directory were Oracle patches/products are stored before use. In my case, changing OUI&#8217;s JVM from 1.4.2.8 to 1.4.2.14 is a matter of copying:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">./p6810189_10204_Linux-x86-64/Disk1/stage/Components/oracle.swd.jre/1.4.2.14.0</div></div>
<p>to:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">./Linux_x86_64_Grid_Control_full_102030/Disk1/stage/Components/oracle.swd.jre</div></div>
<p>Then modifing the same &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">oraparam.ini</span>&#8221; file mentioned before.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#JRE_LOCATION=../stage/Components/oracle.swd.jre/1.4.2.8.0/1/DataFiles<br />
JRE_LOCATION=../stage/Components/oracle.swd.jre/1.4.2.14.0/1/DataFiles</div></div>
<p>You could as well download a specific JRE from http://java.sun.com (sorry: from Oracle) and:</p>
<ul>
<li>install the new JRE somewhere</li>
<li>unzip (-t) the &#8220;filegroup1.jar&#8221; file that corresponds to OUI&#8217;s &#8220;factory&#8221; JRE. Note how the directories are laid out (something like: &#8220;jre/1.4.2&#8243;). Modify the new JRE accordingly.</li>
<li>zip the new JRE, rename the resulting file to &#8220;filegroup1.jar&#8221;, copy it in the right place.</li>
<li>modify oraparam.ini and choose the JVM version you&#8217;ll boot OUI into.</li>
</ul>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[oracle@racnode01 oracle.swd.jre]$ pwd<br />
/opt/orastage/Linux_x86_64_Grid_Control_full_102030/Disk1/stage/Components/oracle.swd.jre<br />
[oracle@racnode01 oracle.swd.jre]$ find . -type f<br />
./1.4.2.8.0/1/DataFiles/filegroup1.jar &nbsp; # &lt;-- factory<br />
./1.4.2.8.0/1/DataFiles/filegroup2.jar<br />
./1.4.2.8.0/1/DataFiles/filegroup3.jar<br />
./1.4.2.8.0/1/DataFiles/filegroup4.jar<br />
./1.4.2.8.0/1/DataFiles/filegroup5.jar<br />
./1.4.2.14.0/1/DataFiles/filegroup1.jar &nbsp;# &lt;-- stolen from patchset p6810189<br />
./1.4.2.14.0/1/DataFiles/filegroup2.jar<br />
./1.4.2.14.0/1/DataFiles/filegroup3.jar<br />
./1.4.2.14.0/1/DataFiles/filegroup4.jar<br />
./1.4.2.14.0/1/DataFiles/filegroup5.jar<br />
./1.4.2.19.0/1/DataFiles/filegroup1.jar &nbsp;# &lt;-- downloaded by hand</div></div>
<p>Three different JREs, each of them segfaulting in the same spot, as we saw in the backtrace:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#9 &nbsp;0x6d6d75b9 in XtToolkitInitialize () from /usr/lib/libXt.so.6</div></div>
<p>Who&#8217;s the owner of <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">libXt</span>?</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[root@racnode01 ~]# rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE} %{ARCH}\n' -f /usr/lib/libXt.so.6<br />
libXt-1.0.2-3.1.fc6 i386</div></div>
<p>After making sure that none of the running processes was using that package contents, I decided to remove it (<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">rpm -e &#8211;nodeps libXt-1.0.2-3.1.i386</span>) and reinstall it. Surprisingly, OUI worked flawlessy after this last action. Too bad I can&#8217;t really explain why. <img src='http://www.108.bz/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  libXt version didn&#8217;t change before/after reinstall. I should diff it anyway with what&#8217;s left untouched on other RAC cluster members. I&#8217;ll update the post when I have a stricter explanation&#8230;</p>
 <img src="http://www.108.bz/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=659" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.108.bz/posts/it/oracle-grid-control-crashing-runinstaller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symantec Endpoint Protection &#8211; crypt32 errors</title>
		<link>http://www.108.bz/posts/it/symantec-endpoint-protection-crypt32-errors/</link>
		<comments>http://www.108.bz/posts/it/symantec-endpoint-protection-crypt32-errors/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 16:28:58 +0000</pubDate>
		<dc:creator>Giuliano</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Group Policy]]></category>
		<category><![CDATA[Registry]]></category>
		<category><![CDATA[Symantec]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.108.bz/?p=591</guid>
		<description><![CDATA[One of the most procrastinated issues I had at a Customer&#8217;s, was the proliferation of errors like these (as shown in servers/clients Event Viewer): Event Type: Error Event Source: &#160; crypt32 Event Category: None Event ID: &#160; 8 Description: Failed auto update retrieval of third-party root list sequence number from: &#60;http://www.download.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootseq.txt&#62; with error: This network [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most procrastinated issues I had at a Customer&#8217;s, was the proliferation of errors like these (as shown in servers/clients Event Viewer):</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Event Type: Error<br />
Event Source: &nbsp; crypt32<br />
Event Category: None<br />
Event ID: &nbsp; 8<br />
Description:<br />
Failed auto update retrieval of third-party root list sequence number from: &lt;http://www.download.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootseq.txt&gt; with error: This network connection does not exist.</div></div>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Event Type: Error<br />
Event Source: &nbsp; crypt32<br />
Event Category: None<br />
Event ID: &nbsp; 11<br />
Description:<br />
Failed extract of third-party root list from auto update cab at: &lt;http://www.download.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootstl.cab&gt; with error: A required certificate is not within its validity period when verifying against the current system clock or the timestamp in the signed file.</div></div>
<p>There are several posts mentioning the issue, <a href="http://www.symantec.com/connect/forums/crypt32-errors-event-viewer-after-sep-110-installation">this one</a> pointed me in the right direction. Basically, because of how SEP components communicate, Windows is triggered into updating the list of trusted root Certification Authorities. It tries to do so through the Internet using the Computer account. The latter may not have any proxy configured. Being unable to reach outside, the host gets flooded by <i>crypt32</i> errors.</p>
<p>In order to solve the issue, I decided to deploy a valid proxy configuration, for the Computer account (<i>SYSTEM</i> user), on a subset of the Domain&#8217;s hosts.<br />
One of the ways to script that is the &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">proxycfg -u</span>&#8221; command<sup class='footnote'><a href='#fn-591-1' id='fnref-591-1'>1</a></sup> that works by copying the current user proxy settings to the SYSTEM&#8217;s registry. Sounds cool but if the current user is not a member of the local Administrators group, he won&#8217;t have the necessary rights. The following script instead, can be launched via Group Policy<sup class='footnote'><a href='#fn-591-2' id='fnref-591-2'>2</a></sup> during operating system startup, and since it&#8217;s a <i>startup</i> script rather than a <i>login</i> one, it will run with administrative privileges.</p>
<p>Nothing fancy in the below source. It creates the registry key if it doesn&#8217;t exist, then sets the right value for <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">WinHttpSettings</span> which I obtained this way:</p>
<ul>
<li>use &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">proxycfg -u</span>&#8221; on a test host</li>
<li>use the Registry editor to export the contents of <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections</span></li>
</ul>
<p>The value is of type <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">REG_BINARY</span>. Since the <a href="http://msdn.microsoft.com/en-us/library/yfdfhz1b(v=vs.85).aspx">RegWrite</a> API (method of class <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">WScript.Shell</span>) cannot deal with binary values, WMI (<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">StdRegProv</span> registry provider) needs to be used. Also, <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">SetBinaryValue</span> expects an array of decimal values, while Regedit exports them as hexadecimal digits (you&#8217;ll have to take care of the conversion yourself).</p>
<div class="codecolorer-container vb blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">Resume</span> <span style="color: #000080;">Next</span><br />
<span style="color: #000080;">Const</span> HKEY_LOCAL_MACHINE = &amp;H80000002<br />
<br />
strPath = <span style="color: #800000;">&quot;SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections&quot;</span><br />
strKey = <span style="color: #800000;">&quot;WinHttpSettings&quot;</span><br />
strValue = <span style="color: #800000;">&quot;24,0,0,0,0,0,0,0,3,0,0,0,19,0,0,0,112,114,111,120,121,46,99,117,115,116,46,108,97,110,58,56,48,56,48,47,0,0,0,49,48,46,42,46,42,46,42,59,115,101,114,118,101,114,50,48,59,115,101,114,118,101,114,50,48,46,42,59,42,46,99,117,115,116,46,108,97,110,59,60,108,111,99,97,108,62&quot;</span><br />
strMachineName = <span style="color: #800000;">&quot;.&quot;</span><br />
<br />
arrValues = Split(strValue,<span style="color: #800000;">&quot;,&quot;</span>)<br />
strMoniker = <span style="color: #800000;">&quot;winMgmts:\\&quot;</span> &amp; strMachineName &amp; <span style="color: #800000;">&quot;\root\default:StdRegProv&quot;</span><br />
<span style="color: #000080;">Set</span> oReg = GetObject(strMoniker)<br />
rv = oReg.CreateKey(HKEY_LOCAL_MACHINE, strPath)<br />
rv = oReg.SetBinaryValue(HKEY_LOCAL_MACHINE, strPath, strKey, arrValues)</div></div>
<p>If the scripts works as it should, you&#8217;ll be greeted by these events:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Event Type: Information<br />
Event Source: &nbsp; crypt32<br />
Event Category: None<br />
Event ID: &nbsp; 7<br />
Description:<br />
Successful auto update retrieval of third-party root list sequence number from: &lt;http://www.download.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootseq.txt&gt;</div></div>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Event Type: Information<br />
Event Source: &nbsp; crypt32<br />
Event Category: None<br />
Event ID: &nbsp; 2<br />
Description:<br />
Successful auto update retrieval of third-party root list cab from: &lt;http://www.download.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootstl.cab&gt;</div></div>
<p>And, hopefully, crypt32 errors will be gone for good.</p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-591-1'>See <a href="http://msdn.microsoft.com/en-us/library/ms761351(v=vs.85).aspx">Using the WinHTTP Proxy Configuration Utility</a> <span class='footnotereverse'><a href='#fnref-591-1'>&#8617;</a></span></li>
<li id='fn-591-2'>Computer Configuration, Windows Settings, Scripts, Startup <span class='footnotereverse'><a href='#fnref-591-2'>&#8617;</a></span></li>
</ol>
</div>
 <img src="http://www.108.bz/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=591" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.108.bz/posts/it/symantec-endpoint-protection-crypt32-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Reports Server font issues</title>
		<link>http://www.108.bz/posts/it/oracle-reports-server-font-issues/</link>
		<comments>http://www.108.bz/posts/it/oracle-reports-server-font-issues/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 13:45:53 +0000</pubDate>
		<dc:creator>Giuliano</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.108.bz/?p=572</guid>
		<description><![CDATA[Here&#8217;s a couple of hints you may find useful when shooting troubles around Oracle Reports Server. It all starts when Customer wants to produce PDF reports using a custom font. Of course the font won&#8217;t be there when the file is opened on a client PC. The report server must either embed (include entirely) or [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a couple of hints you may find useful when shooting troubles around <a href="http://en.wikipedia.org/wiki/Oracle_reports">Oracle Reports Server</a>.<br />
It all starts when Customer wants to produce PDF reports using a custom font. Of course the font won&#8217;t be there when the file is opened on a client PC. The report server must either <i>embed</i> (include entirely) or <i>subset</i> (include just the actually used glyphs) the font into the PDF.</p>
<p>We&#8217;re running <a href="http://www.oracle.com/technology/documentation/appserver1012.html">Oracle Application Server 10g Release 2</a> on Windows.</p>
<p>More than one Reports Server (RS from now on) can be run at the same time. Each RS is identified by name. Open a DOS window, change directory to the one where reports templates/resources are, then launch:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">rwserver server=rstest</div></div>
<p><a href="http://www.108.bz/wp-content/uploads/2010/09/rsts01.png"><img src="http://www.108.bz/wp-content/uploads/2010/09/rsts01.png" alt="Test Oracle Reports Server is running" title="rsts01" width="390" height="200" class="aligncenter size-full wp-image-576" /></a></p>
<p>RS named &#8220;rstest&#8221; will get its own log directory and configuration file, under the Application Server &#8220;HOME&#8221;:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">reports\conf\rstest.conf<br />
reports\logs\rstest\<br />
reports\logs\rstest\rwserver.log</div></div>
<p>Quite convenient: you&#8217;ll leave the production RS alone, be able to activate debug tracing, restart at will, &#8230;</p>
<p>Here&#8217;s how tu run a test report on the &#8220;rstest&#8221; RS:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">rwclient SERVER=rstest REPORT=d01_skt_anag1.rdf userid=user/pwd@db DESFORMAT=pdf DESTYPE=file DESNAME=c:\temp\testoutput.pdf</div></div>
<p>Back to our issues. First step, I&#8217;d say, is to find out the exact name of the font we&#8217;d like to embed. Did you know you can convert Report Developer &#8220;source&#8221; files (<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">.rdf</span>) to XML, then peek in them? Use:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">rwconverer STYPE=rdffile SOURCE=d01_skt_anag1.rdf DTYPE=xmlfile dest=c:\temp\rpt.xml</div></div>
<p>&#8220;Cooper Black&#8221; is the name:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C:\dev\appl\Reports&gt;findstr /I face c:\temp\rpt.xml | findstr /I coop<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;font face=&quot;Cooper Black&quot; size=&quot;14&quot; bold=&quot;yes&quot; textColor=&quot;red&quot;/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;font face=&quot;Cooper Black&quot; size=&quot;11&quot; bold=&quot;yes&quot; textColor=&quot;red&quot;/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;font face=&quot;Cooper Black&quot; size=&quot;12&quot; bold=&quot;yes&quot; textColor=&quot;red&quot;/&gt;</div></div>
<p>Install the font in Windows. Oddly, things didn&#8217;t seem to work for me when I just copied the <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">.ttf</span> file in the <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">C:\WINDOWS\Fonts</span> directory. I had to use the &#8220;Install New Font&#8221; menu item. I thought both methods were equivalent, maybe I was wrong, maybe I&#8217;m talking junk now.</p>
<p><a href="http://www.108.bz/wp-content/uploads/2010/09/rsts03.png"><img src="http://www.108.bz/wp-content/uploads/2010/09/rsts03.png" alt="TTF font install in Windows" title="rsts03" width="377" height="257" class="aligncenter size-full wp-image-578" /></a></p>
<p>Modify the <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">uifont.ali</span> file (<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">tools\common</span>), telling the Report Server to subset &#8220;Cooper Black&#8221; into the generated PDF files. Just add a line under the <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">PDF:Subset</span> section, equating the font name to the TTF file name, both enclosed in double quotes.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[ PDF:Subset ]<br />
&quot;Cooper Black&quot; = &quot;COOPBL.TTF&quot;</div></div>
<p>The <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">fnchk.exe</span> program (ran without arguments) displays the full path of <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">uifont.ali</span> and tells if everything is fine or the file contains any syntax error.</p>
<p>Installing the font in Windows is not enough, you should also put it in one of the <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">REPORTS_PATH</span> directories. The value of this variable can be found in the registry, I chose: <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">C:\Oracle\Products\FRHome\reports\templates</span>. <a href="http://en.wikipedia.org/wiki/Filemon">FileMon</a> is essential when trying to see which files can&#8217;t be found by a process.</p>
<p>Time to restart the Reports Service, generate a PDF report and check if fonts are good (in Acrobat Reader: CTRL-D, &#8220;Fonts&#8221; tab). Ours is listed as &#8220;Embedded Subset&#8221;; we&#8217;re done.</p>
<p><a href="http://www.108.bz/wp-content/uploads/2010/09/rsts06.png"><img src="http://www.108.bz/wp-content/uploads/2010/09/rsts06-294x300.png" alt="Embedded Subset Font in PDF" title="rsts06" width="294" height="300" class="aligncenter size-medium wp-image-580" /></a></p>
<p>See also: Oracle Support Note.350971.1 <i>&#8220;Troubleshooting Guide for Font Aliasing / Font Subsetting / Font Embedding Issues&#8221;</i>.</p>
 <img src="http://www.108.bz/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=572" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.108.bz/posts/it/oracle-reports-server-font-issues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Allot NetEnforcer bandwidth reports</title>
		<link>http://www.108.bz/posts/it/allot-netenforcer-bandwidth-reports/</link>
		<comments>http://www.108.bz/posts/it/allot-netenforcer-bandwidth-reports/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 14:01:20 +0000</pubDate>
		<dc:creator>Giuliano</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Allot]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Performance Monitoring]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.108.bz/?p=429</guid>
		<description><![CDATA[A while ago I was trying to get my head around some nasty network performance issues. A couple of firewalls were in the play, along with a Bandwidth Manager device (an Allot NetEnforcer AC-402). I wasn&#8217;t completely satisfied with NetEnforcer reporting functions and wanted something more dependable and realtime. Well, if you turn to the [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I was trying to get my head around some nasty network performance issues. A couple of firewalls were in the play, along with a Bandwidth Manager device (an <a href="http://www.allot.com/NetEnforcer_AC-400.html">Allot NetEnforcer AC-402</a>).</p>
<p>I wasn&#8217;t completely satisfied with NetEnforcer reporting functions and wanted something more dependable and realtime. Well, if you turn to the device&#8217;s CLI access (SSH), you&#8217;ll notice an interesting <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">acthruput</span> command.<br />
It shows the <i>current</i> throughput per Interface, Line, Pipe and Virtual Channel. What more could you ask for?</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">AC:~# acthruput<br />
---------------------------------------------------------<br />
Entity &nbsp; &nbsp; &nbsp; &nbsp; Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Bits/sec<br />
---------------------------------------------------------<br />
INTERFACE &nbsp; &nbsp; &nbsp;Internal &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1918600<br />
&nbsp; LINE &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1770720<br />
&nbsp; &nbsp; &nbsp; PIPE &nbsp; &nbsp; 8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2144<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VC &nbsp; 32 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2144<br />
&nbsp; &nbsp; &nbsp; PIPE &nbsp; &nbsp; 5 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7136<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VC &nbsp; 8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7136<br />
[..]<br />
---------------------------------------------------------<br />
INTERFACE &nbsp; &nbsp; &nbsp;External &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 9509880<br />
&nbsp; LINE &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;9421000<br />
&nbsp; &nbsp; &nbsp; PIPE &nbsp; &nbsp; 8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;96960<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VC &nbsp; 32 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 96960<br />
&nbsp; &nbsp; &nbsp; PIPE &nbsp; &nbsp; 13 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 752<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VC &nbsp; 22 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 752<br />
[..]</div></div>
<p>As you can see, <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">acthruput</span> identifies Pipes by number. How do you relate this number to the actual mnemonic pipe name? Use &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">acstat -l pipe</span>&#8220;, which also displays the total number of live connections per pipe .</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">AC:~# acstat -l pipe<br />
---------------------------------------------------------------------------------<br />
Rule QID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Rule name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Live connections<br />
---------------------------------------------------------------------------------<br />
1.8.0.0.0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Customer1 ; Fallback &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10<br />
1.13.0.0.0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Customer2 ; Fallback &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7<br />
1.5.0.0.0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Customer3 ; Fallback &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 23<br />
[..]</div></div>
<p>Wrap <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">acthruput</span> in a <i>while</i> loop that adds a timestamp and a delay (&rarr; sampling frequency). Start your terminal emulator logging facilities, hit enter, wait, ctrl-c, stop logging.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">AC:~# while [ 1 ] ; do date; acthruput; sleep 10; done</div></div>
<p>Eventually, clean the log a bit and feed it to the Perl script you&#8217;ll find at the end of this post.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ DATE='Thu Dec 10'; grep &quot;$DATE\|INTERFACE\|LINE\|PIPE&quot; &quot;log.txt&quot; &nbsp;| ./allot_fmt.pl &quot;$DATE&quot; &gt; log.csv</div></div>
<p>The script outputs CSV formatted data:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">timestamp;ifc;L1;P1;P10;P12;P2;P3;P4;P5;P8;P9;<br />
Thu Dec 10 14:48:00 CET 2009;Int;2779648;2599928;4608;;111760;1024;;9792;;52536;<br />
Thu Dec 10 14:48:00 CET 2009;Ext;8372424;5372392;206448;;2407264;60720;;258816;;66784;<br />
Thu Dec 10 14:48:12 CET 2009;Int;1909272;1699872;3776;;170624;512;;1216;;33272;<br />
Thu Dec 10 14:48:12 CET 2009;Ext;7932680;7370584;97152;;350920;36432;;12144;;65448;<br />
[..]</div></div>
<p>And here&#8217;s what it looks like when opened up in OpenOffice Calc (sorry, no fancy formatting).<br />
<a href="http://www.108.bz/wp-content/uploads/2010/04/Allot_NetEnforcer_bandwidth_reports.gif"><img src="http://www.108.bz/wp-content/uploads/2010/04/Allot_NetEnforcer_bandwidth_reports-300x181.gif" alt="NetEnforcer bandwidth report" title="NetEnforcer_bandwidth_report" width="300" height="181" class="alignnone size-medium wp-image-435" /></a><br />
The graph above shows that the 8Mbps link (the &#8220;Line&#8221;, in Allot&#8217;s parlance) is not saturated. Problem was that, during that timeframe, we were also trying to make <a href="http://en.wikipedia.org/wiki/Iperf">Iperf</a> &#8220;consume&#8221; all of the available bandwidth. We couldn&#8217;t make it because one of the firewalls was acting as a bottleneck if presented with certain workloads (many connections, see <a href="http://www.108.bz/posts/it/who-ate-all-the-bandwidth/">this</a>) . Being able to generate these kinds of report proved very useful in troubleshooting&#8230;</p>
<div class="codecolorer-container perl blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;height:300px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl </span><br />
<span style="color: #666666; font-style: italic;"># Giuliano - http://www.108.bz</span><br />
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@samples</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$lastsample</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$lastint</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009999;">&lt;STDIN&gt;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #009966; font-style: italic;">s/[\r\n]*//g</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">next</span> <span style="color: #b1b100;">unless</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/$ARGV[0]/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$lastsample</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$lastsample</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$lastsample</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/push.html"><span style="color: #000066;">push</span></a> <span style="color: #0000ff;">@samples</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$lastsample</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">#print &quot;$_\n&quot;;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elsif</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/INTERFACE/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009966; font-style: italic;">s/^.*INTERFACE.*(Int|Ext)ernal.*$/$1/</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$lastint</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">#print &quot;$lastint\n&quot;;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elsif</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/LINE/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009966; font-style: italic;">s/^.*LINE\s*([0-9]+)\s*(\d+).*$/L$1;$2/</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$line</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$tput</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/split.html"><span style="color: #000066;">split</span></a> <span style="color: #ff0000;">';'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">#print &quot;$line,$tput\n&quot;;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$lastsample</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$lastint</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$line</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$tput</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elsif</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/PIPE/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009966; font-style: italic;">s/^.*PIPE\s*([0-9]+)\s*(\d+).*$/P$1;$2/</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$pipe</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$tput</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/split.html"><span style="color: #000066;">split</span></a> <span style="color: #ff0000;">';'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">#print &quot;$pipe,$tput\n&quot;;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$lastsample</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$lastint</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$pipe</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$tput</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #000000; font-weight: bold;">STDERR</span> <span style="color: #ff0000;">&quot;wtf<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/exit.html"><span style="color: #000066;">exit</span></a><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$keys</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$sample</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@samples</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$int</span> <span style="color: #009900;">&#40;</span><a href="http://perldoc.perl.org/functions/keys.html"><span style="color: #000066;">keys</span></a> <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$sample</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$key</span> <span style="color: #009900;">&#40;</span><a href="http://perldoc.perl.org/functions/keys.html"><span style="color: #000066;">keys</span></a> <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$sample</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$int</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$keys</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$key</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #339933;">@</span><a href="http://perldoc.perl.org/functions/keys.html"><span style="color: #000066;">keys</span></a> <span style="color: #339933;">=</span> <a href="http://perldoc.perl.org/functions/sort.html"><span style="color: #000066;">sort</span></a> <a href="http://perldoc.perl.org/functions/keys.html"><span style="color: #000066;">keys</span></a> <span style="color: #0000ff;">%$keys</span><span style="color: #339933;">;</span><br />
<br />
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;timestamp;ifc;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$key</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><a href="http://perldoc.perl.org/functions/keys.html"><span style="color: #000066;">keys</span></a><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;$key;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$sample</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@samples</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$int</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Int'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'Ext'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;$sample-&gt;[0];&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;$int;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$key</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><a href="http://perldoc.perl.org/functions/keys.html"><span style="color: #000066;">keys</span></a><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;$sample-&gt;[1]-&gt;{$int}-&gt;{$key};&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<a href="http://perldoc.perl.org/functions/exit.html"><span style="color: #000066;">exit</span></a><span style="color: #339933;">;</span></div></div>
 <img src="http://www.108.bz/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=429" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.108.bz/posts/it/allot-netenforcer-bandwidth-reports/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Who ate all the bandwidth?</title>
		<link>http://www.108.bz/posts/it/who-ate-all-the-bandwidth/</link>
		<comments>http://www.108.bz/posts/it/who-ate-all-the-bandwidth/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 17:36:40 +0000</pubDate>
		<dc:creator>Giuliano</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Performance Monitoring]]></category>
		<category><![CDATA[Switching]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.108.bz/?p=370</guid>
		<description><![CDATA[Today Internet browsing is particularly slow. At seemingly random intervals, available bandwith drops down and people get more and more irritable. How do you find out why this is happening? The possible causes boil down to: Router/Firewall1 is not pleased by &#8220;something&#8221;. Could be an attack or a bug in the device firmware. Too many [...]]]></description>
			<content:encoded><![CDATA[<p>Today Internet browsing is particularly slow.<br />
At seemingly random intervals, available bandwith drops down and people get more and more irritable. <img src='http://www.108.bz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>How do you find out why this is happening?</p>
<p>The possible causes boil down to:</p>
<ol style="list-style-type: upper-alpha;">
<li style="list-style-type: upper-alpha;">Router/Firewall<sup class='footnote'><a href='#fn-370-1' id='fnref-370-1'>1</a></sup> is not pleased by &#8220;something&#8221;. Could be an attack or a bug in the device firmware.</li>
<li style="list-style-type: upper-alpha;">Too many connections. Maybe they&#8217;re not passing much traffic, but the internet gateway can&#8217;t keep up with their number. I&#8217;ve seen firewalls perform very badly in this respect. E.g.: 3 connections trying to download/upload as fast as they can, and a total, aggregate, b/w of 10Mbps. Those 3 plus 3000 &#8220;normal&#8221; connections and a total b/w of 6Mbps.</li>
<li style="list-style-type: upper-alpha;">A reasonable amount of connections, effectively eating all of the available bandwidth.</li>
</ol>
<p>I&#8217;ll skip case <b>A</b>, for now. <img src='http://www.108.bz/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
In case <b>B</b> you&#8217;ll likely want to know the firewall&#8217;s idea of &#8220;netstat&#8221;, meaning the complete listing of TCP/UDP/other connections. No big deal if the device has got some sort of CLI access: capture its output, import it into a spreadsheet, or use awk/sort/grep<sup class='footnote'><a href='#fn-370-2' id='fnref-370-2'>2</a></sup> to build your stats. Usually, computing total number of connections by source IP address and sorting accordingly, is enough to gain some insight about what&#8217;s going on.<br />
Case <b>C</b>&#8230; For long-running (days) data analysis, you could use a tool like <a href="http://www.ntop.org/">NTOP</a>. But if, like me today, you need to act quickly (perhaps because you know that the issue will disappear soon), <a href="http://www.ex-parrot.com/pdw/iftop/">iftop</a> can hardly be beaten.<br />
Both tools require the machine they run on to be able to &#8220;sniff&#8221; all the traffic passing through the firewall. This can be accomplished by configuring <i>monitoring</i>/<i>monitored</i> port(s) on a switch.  <i>Monitored</i> ports get their inbound/outbound traffic copied to the monitoring one. Different vendors call the thing a different way, <i>port mirroring</i> is also a good keyphrase. Here are a couple of resources:</p>
<ul>
<li>(Old) 3Com Superstack: <a href="http://blog.icewolf.ch/archive/2008/07/08/monitor-port-on-3com-4400.aspx">Monitor Port on 3Com 4400</a></li>
<li>HP ProCurve, pretty straightforward to set up using the &#8220;menu&#8221; interface:  <a href="http://www.hp.com/rnd/support/faqs/sw_208_224.htm#question25">How do I attach a LAN Analyzer to a Switch 208t/224t port to monitor LAN traffic for diagnostic purposes?</a></li>
<li>ProCurve switches are not limited to mirroring ports that belong to the same device/chassis: <a href="http://pro-h40060-hpwpux-pro.atlanta.hp.com/procurve/uk/en/pdfs/application-notes/AN-S14_ProCurve-intelligent-mirroring-final.pdf">How to configure remote and intelligent mirroring on ProCurve switches</a></li>
<li>
Low-end HP switches (like the ProCurve 1800 one I encountered here), though, are only manageable via a web gui:<br />
<div id="attachment_389" class="wp-caption alignnone" style="width: 310px"><a href="http://www.108.bz/wp-content/uploads/2010/03/procurve1800mirroring.png"><img src="http://www.108.bz/wp-content/uploads/2010/03/procurve1800mirroring-300x120.png" alt="Port Mirroring on a ProCurve 1800" title="procurve1800mirroring" width="300" height="120" class="size-medium wp-image-389" /></a><p class="wp-caption-text">Port Mirroring on a ProCurve 1800</p></div>
</li>
<li>Cisco: <a href="http://en.wikipedia.org/wiki/Port_mirroring">Port Mirroring</a>, <a href="http://itprofesionals.blogspot.com/2009/12/configuring-cisco-catalyst-switch-span.html">Configuring a Cisco Catalyst Switch SPAN mirroring port</a>
</li>
</ul>
<p>(You could as well use a hub instead of a switch and get implicit mirroring of any port, to any port of the hub. Just unplug the firewall, link the hub to the switch, plug firewall and monitoring host in the hub. Kludgy but quick and easy, if you can afford the temporary cabling changes, and the bottleneck introduced by the hub&#8230;)</p>
<p>So:
<ul>
<li>Find the switch where the firewall is connected to. Which side of the firewall? It depends on where you believe the issues originates from. Let&#8217;s say the culprit is most likely to lie on the LAN &rarr; switch port A.</li>
<li>Connect your laptop/monitoring machine to the same switch &rarr; port B.</li>
<li>Set up monitoring: port A is <i>monitored</i>, port B is <i>monitoring</i>.</li>
<li>Run iftop, maybe telling it to also show port numbers (&#8220;-P&#8221;, without this switch, you&#8217;ll only see totals by source/destination IP addresses couple), don&#8217;t display hostnames &#8220;-n&#8221;, the interface &#8220;-i eth0&#8243; and provide a meaningful filter (here I&#8217;m selecting packets whose source is not on the LAN<sup class='footnote'><a href='#fn-370-3' id='fnref-370-3'>3</a></sup>. The &#8220;-p&#8221; option instructs iftop to capture packets in <a href="http://en.wikipedia.org/wiki/Promiscuous_mode">promiscuous</a> mode. Without it, iftop won&#8217;t lift off the wire packets that aren&#8217;t addressed to the machine on which it is running.
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">iftop -p -P -n -i eth0 -f 'not src net 192.168.200.0/23'</div></div>
<p>Iftop will produce a realtime table of running connections, sorted by how demanding they are in terms of bandwidth (10s average, by default). See the screenshot below; the top connections are due to two running video conference streams stealing 1Mbit/second worth of bandwidth, each.<br />
<div id="attachment_394" class="wp-caption alignnone" style="width: 310px"><a href="http://www.108.bz/wp-content/uploads/2010/03/iftop.png"><img src="http://www.108.bz/wp-content/uploads/2010/03/iftop-300x193.png" alt="iftop output" title="iftop" width="300" height="193" class="size-medium wp-image-394" /></a><p class="wp-caption-text">iftop's output</p></div><br />
Once everything is set up and you&#8217;re able to read iftop&#8217;s output, spotting the &#8220;top talkers&#8221; of your net becomes kids play, enjoy!</p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-370-1'>for brevity, I&#8217;ll just say &#8220;firewall&#8221; from now on. <span class='footnotereverse'><a href='#fnref-370-1'>&#8617;</a></span></li>
<li id='fn-370-2'>Yuri is king at doing that. See his <a href="http://yurisk.info/2010/03/08/awk-weekly-checkpoint-anti-spam-statistics-or-viva-la-open-relays/">AWK weekly</a> series. <span class='footnotereverse'><a href='#fnref-370-2'>&#8617;</a></span></li>
<li id='fn-370-3'>iftop will still show these source addresses, since its output is always made of bidirectional &#8220;connections&#8221;. Only, counters pertaining to the LAN &rarr; outside direction, won&#8217;t increase. <span class='footnotereverse'><a href='#fnref-370-3'>&#8617;</a></span></li>
</ol>
</div>
 <img src="http://www.108.bz/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=370" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.108.bz/posts/it/who-ate-all-the-bandwidth/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Executing processes as the SYSTEM user</title>
		<link>http://www.108.bz/posts/it/executing-processes-as-the-system-user/</link>
		<comments>http://www.108.bz/posts/it/executing-processes-as-the-system-user/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 22:05:08 +0000</pubDate>
		<dc:creator>Giuliano</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[OS Internals]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.108.bz/?p=179</guid>
		<description><![CDATA[On MS Windows operating systems, many processes run under the NT AUTHORITY\SYSTEM account, be them scheduled tasks or services. Sometimes it&#8217;s useful to run cmd.exe as the SYSTEM user and see what&#8217;s going on. Here&#8217;s a nifty trick to do it. C:\Documents and Settings\giuliano&#62;time /t 17:10 C:\Documents and Settings\giuliano&#62;at 17:11 /interactive cmd.exe Added a new [...]]]></description>
			<content:encoded><![CDATA[<p>On MS Windows operating systems, many processes run under the <em>NT AUTHORITY\SYSTEM</em> account, be them scheduled tasks or services.<br />
Sometimes it&#8217;s useful to run <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">cmd.exe</span> as the <em>SYSTEM</em> user and see what&#8217;s going on. Here&#8217;s a nifty trick to do it.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C:\Documents and Settings\giuliano&gt;time /t<br />
17:10<br />
<br />
C:\Documents and Settings\giuliano&gt;at 17:11 /interactive cmd.exe<br />
Added a new job with job ID = 1<br />
<br />
C:\Documents and Settings\giuliano&gt;</div></div>
<p>Basically you check what time it is and schedule <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">cmd.exe</span> to run on the next minute. You do that by means of the <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;"><a href="http://technet.microsoft.com/en-us/library/bb490866.aspx">at.exe</a></span> OS command.</p>
<p>When the time comes, a Command Prompt window should pop-up. It runs under the <em>SYSTEM</em> account:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Microsoft Windows [Version 5.2.3790]<br />
(C) Copyright 1985-2003 Microsoft Corp.<br />
<br />
C:\WINDOWS\system32&gt;whoami<br />
nt authority\system<br />
<br />
C:\WINDOWS\system32&gt;</div></div>
<p>Each process you run from there, also runs as <em>SYSTEM</em>. If you run <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">regedit.exe</span>, for instance, you can import registry data into the <em>SYSTEM</em> user&#8217;s hive. Today I used this tecnique to export/import Putty&#8217;s settings (they are stored in the registry) in order to make <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;"><a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">plink.exe</a></span>, as run from a UPS monitoring Agent, see a pre-configured SSH &#8220;Session&#8221; (hostname, login username, private key, &#8230;). I needed the Agent to shut down a bunch of Linux servers when the battery charge was running low: <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">plink.exe</span> on Windows side and <span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">sudo</span> on the Linux one, did the job.</p>
<p>For completness sake, <a href="http://verbalprocessor.com/2007/12/05/running-a-cmd-prompt-as-local-system/">here</a>&#8216;s a post on the same subject. It also deals about Vista/Windows Server 2008 and how to achieve our goal using <a href="http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx">PsExec</a>.</p>
 <img src="http://www.108.bz/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=179" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.108.bz/posts/it/executing-processes-as-the-system-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>True shell access on Symantec Brightmail</title>
		<link>http://www.108.bz/posts/it/true-shell-access-on-symantec-brightmail/</link>
		<comments>http://www.108.bz/posts/it/true-shell-access-on-symantec-brightmail/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 10:27:54 +0000</pubDate>
		<dc:creator>Giuliano</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Antispam]]></category>
		<category><![CDATA[Brightmail]]></category>
		<category><![CDATA[Symantec]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.108.bz/?p=118</guid>
		<description><![CDATA[By connecting (SSH, &#8220;admin&#8221; user) to a Symantec Brightmail Gateway appliance 1, you are left in a restricted shell where only a limited set of commands is available. The undocumented &#8220;set-support&#8221; command may come in handy: it assigns a temporary password to the &#8220;support&#8221; user, a normal unix account with a standard shell. giuliano@balrog ~ [...]]]></description>
			<content:encoded><![CDATA[<p>By connecting (SSH, &#8220;admin&#8221; user) to a Symantec Brightmail Gateway appliance <sup class='footnote'><a href='#fn-118-1' id='fnref-118-1'>1</a></sup>, you are left in a restricted shell where only a limited set of commands is available. The undocumented &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">set-support</span>&#8221; command may come in handy: it assigns a temporary password to the &#8220;support&#8221; user, a normal unix account with a standard shell.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">giuliano@balrog ~ $ ssh admin@192.1.2.3<br />
admin@192.1.2.3's password:<br />
<br />
bmail&gt; set-support<br />
Warning: Do NOT execute this script without explicit direction from a Symantec<br />
Customer Support person.<br />
Changing password for user support.<br />
New password:<br />
BAD PASSWORD: it is based on a dictionary word<br />
Retype new password:<br />
passwd: all authentication tokens updated successfully.<br />
User support enabled until 01/04/2010.<br />
bmail&gt; logout<br />
Connection to 192.1.2.3 closed.<br />
<br />
giuliano@balrog ~ $ ssh support@192.1.2.3<br />
support@192.1.2.3's password:<br />
<br />
[support@bmail support]$ echo $SHELL<br />
/bin/bash</div></div>
<p>What&#8217;s nice about the &#8220;support&#8221; user is that he can run tcpdump and access useful logfiles, e.g.:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">support@bmail support]$ tail -f /data/logs/stats.maillog<br />
2007 Mar 30 11:36:17 (info) delivery-mta/smtp[2008]: 45A689A9: to=, relay=192.1.2.3[192.1.2.3], delay=0, status=sent (250 OK)</div></div>
<p>A note about the restricted shell command &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">watch maillog</span>&#8221; and the &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">/data/logs/stats.maillog</span>&#8221; file.<br />
The latter is the truly useful MTA log file (holding a realtime record of which messages are relayed through the appliance), while the &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">watch maillog</span>&#8221; command shows entirely different stuff. There used to be a proper &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">watch stats.maillog</span>&#8221; command, but at some point Symantec decided to remove it, can&#8217;t really tell why.</p>
<p>I originally learnt about the &#8220;<span style="font-family: Bitstream Vera Sans Mono,Courier New,monospace;">set-support</span>&#8221; command <a href="http://www.symantec.com/connect/forums/root-user">here</a> (Symantec Support Forums).</p>
<p>If you need full root access, you can restart the appliance, break into GRUB&#8217;s command line interface, append a &#8220;1&#8243; to the kernel parameters in order to boot to runlevel 1 (single user mode). There you can change the root password to whatever you like and make Symantec&#8217;s Tech Support upset. <img src='http://www.108.bz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I had to do it a couple of times to replace a failed disk, though&#8230;</p>
<div class='footnotes'>
<div class='footnotedivider'></div>
<ol>
<li id='fn-118-1'>Or Symantec Mail Security, like it was previously called. It&#8217;s an antispam device, coming in either hardware or virtual (VMware) appliance versions. Models I&#8217;ve seen: 8240, 8260. Almost &#8220;install and forget&#8221;, if you ask me. That means it works quite well! <img src='http://www.108.bz/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  <span class='footnotereverse'><a href='#fnref-118-1'>&#8617;</a></span></li>
</ol>
</div>
 <img src="http://www.108.bz/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=118" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.108.bz/posts/it/true-shell-access-on-symantec-brightmail/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

