<?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>Sysadmin Ramblings &#187; Linux</title>
	<atom:link href="http://ramblings.narrabilis.com/wp/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://ramblings.narrabilis.com/wp</link>
	<description>Scripts, settings, and fixes...</description>
	<lastBuildDate>Thu, 29 Jul 2010 13:29:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>listing available groups in yum with ids (for kickstart)</title>
		<link>http://ramblings.narrabilis.com/wp/yum-groups/</link>
		<comments>http://ramblings.narrabilis.com/wp/yum-groups/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 13:25:56 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=299</guid>
		<description><![CDATA[To list the package groups available in yum, you would use yum grouplist.  When you are adding groups to your kickstart file, you use the id of the group not the name, so this *very* simple script lists the groups with their ids.


#!/usr/bin/python
&#160;
import yum
&#160;
yb = yum.YumBase()
yb.doConfigSetup()
yb.doTsSetup()
for grp in yb.comps.groups:
&#160;&#160;print &#34;%s (%s)&#34; % (grp.name,grp.groupid)


This is [...]]]></description>
			<content:encoded><![CDATA[To list the package groups available in yum, you would use yum grouplist.  When you are adding groups to your kickstart file, you use the id of the group not the name, so this *very* simple script lists the groups with their ids.<span id="more-299"></span>

<blockquote><code><br />
#!/usr/bin/python<br />
&nbsp;<br />
import yum<br />
&nbsp;<br />
yb = yum.YumBase()<br />
yb.doConfigSetup()<br />
yb.doTsSetup()<br />
for grp in yb.comps.groups:<br />
&nbsp;&nbsp;print &quot;%s (%s)&quot; % (grp.name,grp.groupid)<br />
</code></blockquote>

This is posted in my <a href="http://narrabilis.com/mybook/kickstart/packages">howto</a> also]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/yum-groups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>kickstart problem Partition requires a size specification RHEL6beta</title>
		<link>http://ramblings.narrabilis.com/wp/kickstart-size0/</link>
		<comments>http://ramblings.narrabilis.com/wp/kickstart-size0/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 13:19:47 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[RHEL6 (beta)]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=296</guid>
		<description><![CDATA[In the process of munging our RHEL5 kickstarts to RHEL6, we started getting this error &#8220;Partition requires a size specification&#8221;, the partition had a size of 0 set in the kickstart, with grow.

part pv.2 &#45;-size=0 &#45;-grow

reading kickstart.py, it seems that the check for size has gone from pd.size = None to not self.size

if not self.size [...]]]></description>
			<content:encoded><![CDATA[In the process of munging our RHEL5 kickstarts to RHEL6, we started getting this error <tt>&#8220;Partition requires a size specification&#8221;</tt>, the partition had a size of 0 set in the kickstart, with grow.<span id="more-296"></span>
<blockquote><code><br />
part pv.2 &#45;-size=0 &#45;-grow<br />
</code></blockquote>
reading kickstart.py, it seems that the check for size has gone from <tt>pd.size = None</tt> to <tt>not self.size</tt>
<blockquote><code><br />
if not self.size and not self.onPart:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raise KickstartValueError, formatErrorMsg(self.lineno, msg=&quot;Partition requires a size specification&quot;)<br />
</code></blockquote>

The fix was simple enough then, just change size from 0 to 1.
<blockquote><code><br />
part pv.2 &#45;-size=1 &#45;-grow<br />
</code></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/kickstart-size0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wwn of a linux hba</title>
		<link>http://ramblings.narrabilis.com/wp/wwn-linux-hba/</link>
		<comments>http://ramblings.narrabilis.com/wp/wwn-linux-hba/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 14:51:57 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[fc]]></category>
		<category><![CDATA[fibre-channel]]></category>
		<category><![CDATA[hba]]></category>
		<category><![CDATA[wwn]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=291</guid>
		<description><![CDATA[My problem is that I wanted to filter access on a raid array instead of doing it on the switch.  I could login to the switch and figure out the linux hba&#8217;s wwn (world-wide-name), but I thought there must be a way to get it from the linux machine directly.

Here&#8217;s the steps

 determine the [...]]]></description>
			<content:encoded><![CDATA[My problem is that I wanted to filter access on a raid array instead of doing it on the switch.  I could login to the switch and figure out the linux hba&#8217;s wwn (world-wide-name), but I thought there must be a way to get it from the linux machine directly.<span id="more-291"></span>
<p>
Here&#8217;s the steps<p>
<ol>
 <li>determine the hba&#8217;s scsi bus number, set VENDOR to the vendor of your fibre channel array
<blockquote><code><br />
[root@host ~] grep -B1 &quot;Vendor: $VENDOR&quot; /proc/scsi/scsi |grep Host |head<br />
Host: scsi3 Channel: 00 Id: 00 Lun: 00<br />
Host: scsi3 Channel: 00 Id: 00 Lun: 01<br />
Host: scsi3 Channel: 00 Id: 00 Lun: 02<br />
Host: scsi3 Channel: 00 Id: 00 Lun: 03<br />
</code></blockquote>
In this case, my magical number is 3.
 <li>find the fc_host directory for the hba<br />
RHEL5
<blockquote><code><br />
[root@host ~] cd /sys/class/scsi_host/host3/device/fc_host:host3<br />
</code></blockquote>
RHEL6
<blockquote><code><br />
[root@host ~] cd /sys/class/scsi_host/host3/device/fc_host/host3/<br />
</code></blockquote>
 <li>look in port_name
<blockquote><code><br />
[root@host host3]# cat port_name<br />
0x2001002219&#46;...4f<br />
</code></blockquote>
</ol>

Hope that helps&#8230;]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/wwn-linux-hba/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>online resize of lvm filesystem on fibre channel or iscsi or similar when using multipath</title>
		<link>http://ramblings.narrabilis.com/wp/online-resize/</link>
		<comments>http://ramblings.narrabilis.com/wp/online-resize/#comments</comments>
		<pubDate>Thu, 27 May 2010 20:31:23 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=281</guid>
		<description><![CDATA[I had a problem with a filesystem that was full on a vm.  The vm&#8217;s hard drive is just a lun on a fibre channel.  So I resized the lun on the raid controller.  The devices (/dev/sdx) for the drive noticed the new size after I did the usual scan and partprobe, [...]]]></description>
			<content:encoded><![CDATA[I had a problem with a filesystem that was full on a vm.  The vm&#8217;s hard drive is just a lun on a fibre channel.  So I resized the lun on the raid controller.  The devices (/dev/sdx) for the drive noticed the new size after I did the usual scan and partprobe, but the multipath device didn&#8217;t see the new size and was working off the old size.  After some digging I found <a href="http://pasik.reaktio.net/rhel5-online-iscsi-resize-test.txt">this page</a> on how to get multipathd to notice the new size.  I&#8217;ll summarise here.<span id="more-281"></span>
<p>
Assuming our hard drive in question is called <tt>vm1</tt>, <tt>/dev/mapper/vm1</tt>
<blockquote><code><br />
[root@server0 ~]# multipath -ll vm1<br />
vm1 (1ACNCorp_FF01000033100008) dm-15 DUMMY,R_dummy_root<br />
[size=56G][features=0][hwhandler=0][rw]<br />
\_ round-robin 0 [prio=1][active]<br />
 \_ 3:0:0:0&nbsp;&nbsp;sdc&nbsp;&nbsp;8:32&nbsp;&nbsp; [active][ready]<br />
\_ round-robin 0 [prio=1][enabled]<br />
 \_ 3:0:1:0&nbsp;&nbsp;sdu&nbsp;&nbsp;65:64&nbsp;&nbsp;[active][ready]<br />
</code></blockquote>
This shows that the drives in question are sdc and sdu. 

When we start, we have 70GB LUNs for the vm, we&#8217;ll resize to 80GB.  After the resize, we don&#8217;t see a change on our hypervisor, we have to use blockdev to update the partition table in memory.
<blockquote><code><br />
[root@server0 ~]# fdisk -l /dev/sdc<br />
&nbsp;<br />
Disk /dev/sdc: 70.0 GB, 70002409472 bytes<br />
255 heads, 63 sectors/track, 8510 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
&nbsp;<br />
&nbsp;&nbsp; Device Boot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Blocks&nbsp;&nbsp; Id&nbsp;&nbsp;System<br />
/dev/sdc1&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;19&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;152586&nbsp;&nbsp; 83&nbsp;&nbsp;Linux<br />
/dev/sdc2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8510&nbsp;&nbsp;&nbsp;&nbsp;68203957+&nbsp;&nbsp;8e&nbsp;&nbsp;Linux LVM<br />
[root@server0 ~]# blockdev &#45;-rereadpt /dev/sdc<br />
[root@server0 ~]# fdisk -l /dev/sdc<br />
&nbsp;<br />
Disk /dev/sdc: 80.0 GB, 80003851264 bytes<br />
255 heads, 63 sectors/track, 9726 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
&nbsp;<br />
&nbsp;&nbsp; Device Boot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Blocks&nbsp;&nbsp; Id&nbsp;&nbsp;System<br />
/dev/sdc1&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;19&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;152586&nbsp;&nbsp; 83&nbsp;&nbsp;Linux<br />
/dev/sdc2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8510&nbsp;&nbsp;&nbsp;&nbsp;68203957+&nbsp;&nbsp;8e&nbsp;&nbsp;Linux LVM<br />
[root@server0 ~]# <br />
</code></blockquote>

Repeat this for the other member of the group then notice that the multipath doesn&#8217;t have the new size yet.

<blockquote><code><br />
[root@server0 ~]# fdisk -l /dev/sdu<br />
&nbsp;<br />
Disk /dev/sdu: 80.0 GB, 80003851264 bytes<br />
255 heads, 63 sectors/track, 9726 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
&nbsp;<br />
&nbsp;&nbsp; Device Boot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Blocks&nbsp;&nbsp; Id&nbsp;&nbsp;System<br />
/dev/sdu1&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;19&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;152586&nbsp;&nbsp; 83&nbsp;&nbsp;Linux<br />
/dev/sdu2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8510&nbsp;&nbsp;&nbsp;&nbsp;68203957+&nbsp;&nbsp;8e&nbsp;&nbsp;Linux LVM<br />
[root@server0 ~]# fdisk -l /dev/mapper/vm<br />
[root@server0 ~]# fdisk -l /dev/mapper/vm1<br />
&nbsp;<br />
Disk /dev/mapper/vm1: 70.0 GB, 70002409472 bytes<br />
255 heads, 63 sectors/track, 8510 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Device Boot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Blocks&nbsp;&nbsp; Id&nbsp;&nbsp;System<br />
/dev/mapper/vm1p1&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;19&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;152586&nbsp;&nbsp; 83&nbsp;&nbsp;Linux<br />
/dev/mapper/vm1p2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7294&nbsp;&nbsp;&nbsp;&nbsp;58436437+&nbsp;&nbsp;8e&nbsp;&nbsp;Linux LVM<br />
&nbsp;<br />
</code></blockquote>

 Now remove the drives from the multipath and add them, then resize

<blockquote><code><br />
[root@server0 ~]# multipathd -k<br />
multipathd&gt; del path sdc<br />
ok<br />
multipathd&gt; add path sdc<br />
ok<br />
multipathd&gt; del path sdu<br />
ok<br />
multipathd&gt; add path sdu<br />
ok<br />
multipathd&gt; resize map vm1<br />
ok<br />
multipathd&gt; <br />
[root@server0 ~]# fdisk -l /dev/mapper/vm1<br />
&nbsp;<br />
Disk /dev/mapper/vm1: 80.0 GB, 80003851264 bytes<br />
255 heads, 63 sectors/track, 9726 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Device Boot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Blocks&nbsp;&nbsp; Id&nbsp;&nbsp;System<br />
/dev/mapper/vm1p1&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;19&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;152586&nbsp;&nbsp; 83&nbsp;&nbsp;Linux<br />
/dev/mapper/vm1p2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7294&nbsp;&nbsp;&nbsp;&nbsp;58436437+&nbsp;&nbsp;8e&nbsp;&nbsp;Linux LVM<br />
</code></blockquote>
<p>
Next, resize the actual lvm.  I got most of this from <a href="http://www.linuxquestions.org/questions/fedora-35/lvm-partition-resizing-666683/">this page.</a>
<p>
<ul>
<li>reboot the vm
<li>use fdisk -u, delete the partition, make a new partition that starts on the same sector but extends to the end of the disk
<li>partprobe to reread the partition table, or reboot
<li>pvresize /dev/hda2
<li>pvdisplay to see how much is now free
<li>lvextend -l +[number free] /dev/vg/lv
<li>lvdisplay (see new size)
<li>resize2fs /dev/vg/lv
</ul>

<blockquote><code><br />
[root@vm1 ~]# fdisk -l /dev/hda<br />
&nbsp;<br />
Disk /dev/hda: 70.0 GB, 70002409472 bytes<br />
255 heads, 63 sectors/track, 8510 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
&nbsp;<br />
&nbsp;&nbsp; Device Boot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Blocks&nbsp;&nbsp; Id&nbsp;&nbsp;System<br />
/dev/hda1&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;19&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;152586&nbsp;&nbsp; 83&nbsp;&nbsp;Linux<br />
/dev/hda2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8510&nbsp;&nbsp;&nbsp;&nbsp;68203957+&nbsp;&nbsp;8e&nbsp;&nbsp;Linux LVM<br />
[root@vm1 ~]# blockdev &#45;-rereadpt /dev/hda<br />
BLKRRPART: Device or resource busy<br />
[root@vm1 ~]# poweroff<br />
&nbsp;<br />
Broadcast message from root (pts/0) (Thu May 27 16:43:09 2010):<br />
&nbsp;<br />
The system is going down for system halt NOW!<br />
</code></blockquote>

I believe a reboot is enough to make the vm reread the hard drive file&#8230;but I went for poweroff anyway

<blockquote><code><br />
[root@vm1 ~]# fdisk -l /dev/hda<br />
&nbsp;<br />
Disk /dev/hda: 80.0 GB, 80003851264 bytes<br />
255 heads, 63 sectors/track, 9726 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
&nbsp;<br />
&nbsp;&nbsp; Device Boot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Blocks&nbsp;&nbsp; Id&nbsp;&nbsp;System<br />
/dev/hda1&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;19&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;152586&nbsp;&nbsp; 83&nbsp;&nbsp;Linux<br />
/dev/hda2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8510&nbsp;&nbsp;&nbsp;&nbsp;68203957+&nbsp;&nbsp;8e&nbsp;&nbsp;Linux LVM<br />
[root@vm1 ~]# fdisk -u /dev/hda<br />
&nbsp;<br />
The number of cylinders for this disk is set to 9726.<br />
There is nothing wrong with that, but this is larger than 1024,<br />
and could in certain setups cause problems with:<br />
1) software that runs at boot time (e.g., old versions of LILO)<br />
2) booting and partitioning software from other OSs<br />
&nbsp;&nbsp; (e.g., DOS FDISK, OS/2 FDISK)<br />
&nbsp;<br />
Command (m for help): p<br />
&nbsp;<br />
Disk /dev/hda: 80.0 GB, 80003851264 bytes<br />
255 heads, 63 sectors/track, 9726 cylinders, total 156257522 sectors<br />
Units = sectors of 1 * 512 = 512 bytes<br />
&nbsp;<br />
&nbsp;&nbsp; Device Boot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Blocks&nbsp;&nbsp; Id&nbsp;&nbsp;System<br />
/dev/hda1&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;63&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;305234&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;152586&nbsp;&nbsp; 83&nbsp;&nbsp;Linux<br />
/dev/hda2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;305235&nbsp;&nbsp; 136713149&nbsp;&nbsp;&nbsp;&nbsp;68203957+&nbsp;&nbsp;8e&nbsp;&nbsp;Linux LVM<br />
&nbsp;<br />
Command (m for help): d<br />
Partition number (1-4): 2<br />
&nbsp;<br />
Command (m for help): n<br />
Command action<br />
&nbsp;&nbsp; e&nbsp;&nbsp; extended<br />
&nbsp;&nbsp; p&nbsp;&nbsp; primary partition (1-4)<br />
p<br />
Partition number (1-4): 2<br />
First sector (305235-156257521, default 305235): <br />
Using default value 305235<br />
Last sector or +size or +sizeM or +sizeK (305235-156257521, default 156257521): <br />
Using default value 156257521<br />
&nbsp;<br />
Command (m for help): w<br />
The partition table has been altered!<br />
&nbsp;<br />
Calling ioctl() to re-read partition table.<br />
&nbsp;<br />
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.<br />
The kernel still uses the old table.<br />
The new table will be used at the next reboot.<br />
Syncing disks.<br />
[root@vm1 ~]# reboot<br />
&nbsp;<br />
Broadcast message from root (pts/0) (Thu May 27 16:56:29 2010):<br />
&nbsp;<br />
The system is going down for reboot NOW!<br />
</code></blockquote>

Now the straightforward lvm stuff

<blockquote><code><br />
[root@vm1 ~]# pvdisplay /dev/hda2<br />
&nbsp;&nbsp;&#45;&#45;- Physical volume &#45;&#45;-<br />
&nbsp;&nbsp;PV Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /dev/hda2<br />
&nbsp;&nbsp;VG Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Example<br />
&nbsp;&nbsp;PV Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 65.04 GB / not usable 13.24 MB<br />
&nbsp;&nbsp;Allocatable&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes (but full)<br />
&nbsp;&nbsp;PE Size (KByte)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 32768<br />
&nbsp;&nbsp;Total PE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2081<br />
&nbsp;&nbsp;Free PE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br />
&nbsp;&nbsp;Allocated PE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2081<br />
&nbsp;&nbsp;PV UUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jUn8V8-Ca29-HlTK-8Rnn-yq1k-2jae-aCfGnH<br />
&nbsp;&nbsp; <br />
[root@vm1 ~]# pvresize /dev/hda2<br />
&nbsp;&nbsp;Physical volume &quot;/dev/hda2&quot; changed<br />
&nbsp;&nbsp;1 physical volume(s) resized / 0 physical volume(s) not resized<br />
[root@vm1 ~]# pvdisplay /dev/hda2<br />
&nbsp;&nbsp;&#45;&#45;- Physical volume &#45;&#45;-<br />
&nbsp;&nbsp;PV Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /dev/hda2<br />
&nbsp;&nbsp;VG Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Example<br />
&nbsp;&nbsp;PV Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 74.36 GB / not usable 20.39 MB<br />
&nbsp;&nbsp;Allocatable&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes <br />
&nbsp;&nbsp;PE Size (KByte)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 32768<br />
&nbsp;&nbsp;Total PE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2379<br />
&nbsp;&nbsp;Free PE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 298<br />
&nbsp;&nbsp;Allocated PE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2081<br />
&nbsp;&nbsp;PV UUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jUn8V8-Ca29-HlTK-8Rnn-yq1k-2jae-aCfGnH<br />
</code></blockquote>

Free PE is 298, so I can add that to my logical volume.
<blockquote><code><br />
[root@vm1 ~]# lvdisplay /dev/Example/RootVol <br />
&nbsp;&nbsp;&#45;&#45;- Logical volume &#45;&#45;-<br />
&nbsp;&nbsp;LV Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/dev/Example/RootVol<br />
&nbsp;&nbsp;VG Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example<br />
&nbsp;&nbsp;LV UUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eawcxY-KVZG-rcdO-Bf5E-Vck3-JOnJ-8KN2lm<br />
&nbsp;&nbsp;LV Write Access&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read/write<br />
&nbsp;&nbsp;LV Status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;available<br />
&nbsp;&nbsp;# open&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1<br />
&nbsp;&nbsp;LV Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;57.03 GB<br />
&nbsp;&nbsp;Current LE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1825<br />
&nbsp;&nbsp;Segments&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2<br />
&nbsp;&nbsp;Allocation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inherit<br />
&nbsp;&nbsp;Read ahead sectors&nbsp;&nbsp;&nbsp;&nbsp; auto<br />
&nbsp;&nbsp;- currently set to&nbsp;&nbsp;&nbsp;&nbsp; 256<br />
&nbsp;&nbsp;Block device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 253:0<br />
&nbsp;&nbsp; <br />
[root@vm1 ~]# lvextend -l +298 /dev/Example/RootVol <br />
&nbsp;&nbsp;Extending logical volume RootVol to 66.34 GB<br />
&nbsp;&nbsp;Logical volume RootVol successfully resized<br />
[root@vm1 ~]# lvdisplay /dev/Example/RootVol <br />
&nbsp;&nbsp;&#45;&#45;- Logical volume &#45;&#45;-<br />
&nbsp;&nbsp;LV Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/dev/Example/RootVol<br />
&nbsp;&nbsp;VG Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example<br />
&nbsp;&nbsp;LV UUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eawcxY-KVZG-rcdO-Bf5E-Vck3-JOnJ-8KN2lm<br />
&nbsp;&nbsp;LV Write Access&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read/write<br />
&nbsp;&nbsp;LV Status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;available<br />
&nbsp;&nbsp;# open&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1<br />
&nbsp;&nbsp;LV Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;66.34 GB<br />
&nbsp;&nbsp;Current LE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2123<br />
&nbsp;&nbsp;Segments&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2<br />
&nbsp;&nbsp;Allocation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inherit<br />
&nbsp;&nbsp;Read ahead sectors&nbsp;&nbsp;&nbsp;&nbsp; auto<br />
&nbsp;&nbsp;- currently set to&nbsp;&nbsp;&nbsp;&nbsp; 256<br />
&nbsp;&nbsp;Block device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 253:0<br />
&nbsp;&nbsp; <br />
[root@vm1 ~]#<br />
</code></blockquote>

The last step is to resize the ext4 on the logical volume
<blockquote><code><br />
[root@vm1 ~]# resize2fs /dev/Example/RootVol <br />
resize2fs 1.39 (29-May-2006)<br />
Filesystem at /dev/Example/RootVol is mounted on /; on-line resizing required<br />
Performing an on-line resize of /dev/Example/RootVol to 17391616 (4k) blocks.<br />
The filesystem on /dev/Example/RootVol is now 17391616 blocks long.<br />
[root@vm1 ~]# df -h /<br />
Filesystem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Size&nbsp;&nbsp;Used Avail Use% Mounted on<br />
/dev/mapper/Example-RootVol<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 65G&nbsp;&nbsp;1.6G&nbsp;&nbsp; 60G&nbsp;&nbsp; 3% /<br />
</code></blockquote>

Done.]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/online-resize/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>qlogic sanbox monitoring from zabbix server (hexadecimal values have spaces)</title>
		<link>http://ramblings.narrabilis.com/wp/qlogic-sanbox-zabbix/</link>
		<comments>http://ramblings.narrabilis.com/wp/qlogic-sanbox-zabbix/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 01:49:06 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=278</guid>
		<description><![CDATA[While attempting to monitor traffic on a qlogic Sanbox 5602 I noticed that the traffic (connUnitPortStatCountTxObjects) was being returned as a hexadecimal value with spaces in it (e.g. Hex-STRING: 00 00 00 00 01 4F E1 1B).  Zabbix was complaining about an invalid type of returned data because of the spaces.  I wrote [...]]]></description>
			<content:encoded><![CDATA[While attempting to monitor traffic on a qlogic Sanbox 5602 I noticed that the traffic (connUnitPortStatCountTxObjects) was being returned as a hexadecimal value with spaces in it (e.g. Hex-STRING: 00 00 00 00 01 4F E1 1B).  Zabbix was complaining about an invalid type of returned data because of the spaces.  I wrote the following simple patch to remove the spaces (I know it could be done simpler but I just needed a quick fix).
<blockquote><code><br />
diff -up zabbix-1.8.1/src/libs/zbxcommon/misc.c.spaces zabbix-1.8.1/src/libs/zbxcommon/misc.c<br />
&#45;&#45;- zabbix-1.8.1/src/libs/zbxcommon/misc.c.spaces&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2010-03-19 10:57:07.000000000 -0400<br />
+++ zabbix-1.8.1/src/libs/zbxcommon/misc.c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2010-03-22 10:31:36.000000000 -0400<br />
@@ -1322,7 +1322,7 @@ int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; is_uhex(char *str)<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (; &#039;\0&#039; != *str; str++)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((*str &lt; &#039;0&#039; || *str &gt; &#039;9&#039;) &amp;&amp; (*str &lt; &#039;a&#039; || *str &gt; &#039;f&#039;) &amp;&amp; (*str &lt; &#039;A&#039; || *str &gt; &#039;F&#039;))<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((*str &lt; &#039;0&#039; || *str &gt; &#039;9&#039;) &amp;&amp; (*str &lt; &#039;a&#039; || *str &gt; &#039;f&#039;) &amp;&amp; (*str &lt; &#039;A&#039; || *str &gt; &#039;F&#039;) &amp;&amp; (*str != &#039; &#039;))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;res = SUCCEED;<br />
diff -up zabbix-1.8.1/src/libs/zbxsysinfo/sysinfo.c.spaces zabbix-1.8.1/src/libs/zbxsysinfo/sysinfo.c<br />
&#45;&#45;- zabbix-1.8.1/src/libs/zbxsysinfo/sysinfo.c.spaces&nbsp;&nbsp; 2010-03-19 11:03:16.000000000 -0400<br />
+++ zabbix-1.8.1/src/libs/zbxsysinfo/sysinfo.c&nbsp;&nbsp;2010-03-22 10:23:53.000000000 -0400<br />
@@ -587,6 +587,19 @@ int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set_result_type(AGENT_RESULT *result<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case ITEM_DATA_TYPE_HEXADECIMAL:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (SUCCEED == is_uhex(c))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* remove spaces */<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int hex_i=0,hex_j;<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(c[hex_i]) {<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (c[hex_i] == &#039; &#039;) {<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hex_j = hex_i;<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(c[hex_j]) {<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c[hex_j] = c[hex_j+1];<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ++hex_j;<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ++hex_i;<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
+<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZBX_HEX2UINT64(value_uint64, c);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SET_UI64_RESULT(result, value_uint64);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ret = SUCCEED;<br />
</code></blockquote>

After patching I was able to monitor the individual port stats (e.g. for the first port .1.3.6.1.3.94.4.5.1.4.16.0.0.192.221.19.34.253.0.0.0.0.0.0.0.0.1)
]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/qlogic-sanbox-zabbix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>using rsync with ssh keys via authorized_keys and command=&#8221;rsync &#8230;&#8221;</title>
		<link>http://ramblings.narrabilis.com/wp/using-rsync-with-ssh/</link>
		<comments>http://ramblings.narrabilis.com/wp/using-rsync-with-ssh/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 18:58:18 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=275</guid>
		<description><![CDATA[Scenario I
Backup directory /mnt/one from server pris to client directory /home/user/two on client deckard by initiating the the copy from the client deckard. (i.e. send files from the server to the client)


create ssh keys using ssh-keygen

[user@deckard ~]$ cd .ssh
[user@deckard .ssh]$ ssh-keygen -t dsa -f deckard
Generating public/private dsa key pair.
Enter passphrase (empty for no passphrase): 
Enter [...]]]></description>
			<content:encoded><![CDATA[<h1>Scenario I</h1>
Backup directory <tt>/mnt/one</tt> from server <tt>pris</tt> to client directory <tt>/home/user/two</tt> on client <tt>deckard</tt> by initiating the the copy from the client deckard. (i.e. send files from the server to the client)
<p>
<ul>
<li>create ssh keys using ssh-keygen
<blockquote><code><br />
[user@deckard ~]$ cd .ssh<br />
[user@deckard .ssh]$ ssh-keygen -t dsa -f deckard<br />
Generating public/private dsa key pair.<br />
Enter passphrase (empty for no passphrase): <br />
Enter same passphrase again: <br />
Your identification has been saved in deckard.<br />
Your public key has been saved in deckard.pub.<br />
The key fingerprint is:<br />
17:f4:69:30:6c:67:5a:73:2e:6f:ba:4b:8b:94:2a:f9 user@deckard.example.com<br />
The key&#039;s randomart image is:<br />
+&#45;-[ DSA 1024]&#45;&#45;&#45;-+<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .o+=..&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..=++&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.o. .&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S .&nbsp;&nbsp;o&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . .&nbsp;&nbsp;o&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .&nbsp;&nbsp;o .o&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;&nbsp;o o..&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oE . +o&nbsp;&nbsp; |<br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+<br />
&nbsp;<br />
</code></blockquote>
<li>create a new user for the sync operation and copy the public key you just created to pris
<blockquote><code><br />
[root@pris ~]# useradd deckardsync<br />
[root@pris ~]# su - deckardsync<br />
[deckardsync@pris ~]$ mkdir .ssh<br />
[deckardsync@pris ~]$ cd .ssh<br />
[deckardsync@pris .ssh]$ scp user@deckard:.ssh/deckard.pub authorized_keys<br />
deckard.pub&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;100% 1194&nbsp;&nbsp;&nbsp;&nbsp; 1.2KB/s&nbsp;&nbsp; 00:00<br />
</code></blockquote>
<li>make the <tt>/mnt/one</tt> directory accessible to deckardsync (or ideally owned by this user)
<blockquote><code><br />
[root@pris ~]# chown deckardsync /mnt/one<br />
</code></blockquote>
<li>edit authorized_keys and add the commands for rsync into the key
<blockquote><code><br />
command=&quot;rsync &#45;-server&nbsp;&nbsp;&#45;-sender -vlogDtprCz . /mnt/one/&quot; ssh-dss AAAAB3NzaC1kc3MAAACBANbyPA4Vkem1tXrBcmkc9+SHeBrgHKbeBdS2MZKMBT/CsPWPSwMFQGg3GzX2KFrIVlZW/+OfkFcrZabMxtLb4CfvFgZsK18hcyYWZobhtpzqfsoolVnWbHdcmxFqyUq9fIK5iPA2UnvLoLRCDuklQNZ+V8o7fiCiPzXw5sqw3weRAAAAFQDKbAINhyt3OzJhP680PqrA9vHNFwAAAIB0mmnu9rfUKnSAH8UV068H28NEaNuIvSzQchvsPpBZmLpN/yr0mUbWdUJtVfFO72fbhQW+gQmEydCoPgehAGCx0g5jcs+0J7nhDlCqCqYAluD/79jJvEr7Tc33u0QTJSEX9My5X6OVtKByGfGPIyeLdhdsM2s70xbXKpfV4j8KpgAAAIEAnbxqsdbxpZ/vKZMJCW4TuHzOk76By5HHHHRb6XIUTsImQmoHrH1T2ioVil6eNp+V02hbYzbs8OuMqj6ne3gLzIyPqIP1OHuusisrLKgtWTC74lZnZ48d9QCyUHI48yZyoISs0HvEvC08LHYqsq1z1ntCHAde4iszE2TAMsYBat4= user@deckard.example.com<br />
</code></blockquote>
Note: there are no line breaks in the above key&#8230; the file has only one line.
<li>copy something into /mnt/one on pris
<blockquote><code><br />
[root@pris ~]# cd /mnt/one<br />
[root@pris one]# cp -a /usr/share/doc/rsync-2.6.8 .<br />
</code></blockquote>
<li> start rsync on deckard using the ssh key
<blockquote><code><br />
[user@deckard .ssh]$ rsync -e &#039;ssh -i deckard -l deckardsync&#039; -Cavz pris:/mnt/one /home/user/two/<br />
receiving file list &#46;.. done<br />
./<br />
rsync-2.6.8/<br />
rsync-2.6.8/COPYING<br />
rsync-2.6.8/README<br />
rsync-2.6.8/tech_report.tex<br />
&nbsp;<br />
sent 98 bytes&nbsp;&nbsp;received 14416 bytes&nbsp;&nbsp;29028.00 bytes/sec<br />
total size is 36507&nbsp;&nbsp;speedup is 2.52<br />
[user@deckard .ssh]$ ls ~/two<br />
rsync-2.6.8<br />
</code></blockquote>
</ul>

<h1>Scenario II</h1>
Backup directory <tt>/home/user/two</tt> from client <tt>deckard</tt> to server directory <tt>/mnt/three</tt> on server <tt>pris</tt>
<p>
The steps involved here are essentially the same with only one small change in the authorized_keys, drop the &#8212;sender option to rsync (since pris is no longer the sender)
<ul>
<li>create new ssh key for the transfer in this direction.
<blockquote><code><br />
[user@deckard .ssh]$ ssh-keygen -t dsa -f pris<br />
Generating public/private dsa key pair.<br />
Enter passphrase (empty for no passphrase): <br />
Enter same passphrase again: <br />
Your identification has been saved in pris.<br />
Your public key has been saved in pris.pub.<br />
The key fingerprint is:<br />
75:67:7a:ca:2f:b2:11:f4:83:50:27:07:50:0b:55:a3 user@deckard.math.ias.edu<br />
The key&#039;s randomart image is:<br />
+&#45;-[ DSA 1024]&#45;&#45;&#45;-+<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o+*o=&nbsp;&nbsp;&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o * .&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;. E . o&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + + +&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;S o + .&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o +&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;. o&nbsp;&nbsp;&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#46;...&nbsp;&nbsp; |<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.o ..&nbsp;&nbsp;|<br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+<br />
</code></blockquote>
<li>copy the key to pris and append it to authorized_keys
<blockquote><code><br />
[root@pris .ssh]# scp user@deckard:.ssh/pris.pub .<br />
user@deckard&#039;s password: <br />
pris.pub&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;100%&nbsp;&nbsp;617&nbsp;&nbsp;&nbsp;&nbsp; 0.6KB/s&nbsp;&nbsp; 00:00&nbsp;&nbsp;&nbsp;&nbsp;<br />
[root@pris .ssh]# echo -n &#039;command=&quot;rsync &#45;-server -vlogDtprCz . /mnt/three&quot; &#039; &gt;&gt;authorized_keys<br />
[root@pris .ssh]# cat pris.pub &gt;&gt;authorized_keys<br />
</code></blockquote>
<li>initiate the transfer from deckard, this time acting as the sender not the receiver (flip sender for receiver)
<blockquote><code><br />
[user@deckard .ssh]$ rsync -e &#039;ssh -i pris -l deckardsync&#039; -Cavz /home/user/two/ pris:/mnt/three<br />
building file list &#46;.. done<br />
./<br />
rsync-2.6.8/<br />
rsync-2.6.8/COPYING<br />
rsync-2.6.8/README<br />
rsync-2.6.8/tech_report.tex<br />
&nbsp;<br />
sent 14422 bytes&nbsp;&nbsp;received 98 bytes&nbsp;&nbsp;29040.00 bytes/sec<br />
total size is 36507&nbsp;&nbsp;speedup is 2.51<br />
</code></blockquote>
</ul>

Now you just need to put that rsync line in a cronjob and you&#8217;ll have automatic syncing.  (if you do, remember to use the full path for the ssh-keys you generated).  The nice thing here is that if the key should be discovered, the only thing the attacker can do is run rsync.]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/using-rsync-with-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>puppetserver certificates being signed in the future</title>
		<link>http://ramblings.narrabilis.com/wp/puppetserver-something/</link>
		<comments>http://ramblings.narrabilis.com/wp/puppetserver-something/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 16:37:11 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=270</guid>
		<description><![CDATA[We had a problem where new clients couldn&#8217;t get their keys signed properly by the puppetmaster.  Both the client and the server were in perfect sync with our ntp server.  date on both machines returned the expected results.  We are running mongrel so I went down the wrong path of thinking apache [...]]]></description>
			<content:encoded><![CDATA[We had a problem where new clients couldn&#8217;t get their keys signed properly by the puppetmaster.  Both the client and the server were in perfect sync with our ntp server.  date on both machines returned the expected results.  We are running mongrel so I went down the wrong path of thinking apache was to blame for the time problem.  It wasn&#8217;t until I started going through the certificate_factory stuff that I found the problem.
<span id="more-270"></span>
We&#8217;d errors on the certs like this:
<blockquote><code><br />
[root@puppet ~]# cd /var/lib/puppet/ssl<br />
[root@puppet ssl]# openssl verify<br />
&gt; -CAfile ./certs/ca.pem ./certs/client.example.com.pem<br />
&gt; ./certs/client.example.com.pem: /CN= client.example.com<br />
&gt; error 9 at 1 depth lookup:certificate is not yet valid<br />
&lt;/blockquote&gt;</code>

Outputing the certificate showed that the cert was being signed for a future date, even though the time on the machines is correct.
<blockquote><code><br />
[root@puppet ssl]# date<br />
Fri Jan 29 11:31:32 EST 2010<br />
[root@puppet ssl]# openssl x509 -text -in ca/signed/client.example.com.pem&nbsp;&nbsp;|grep -A2 Valid<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Validity<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Not Before: Feb 17 13:28:04 2010 GMT<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Not After : Feb 16 13:28:04 2015 GMT<br />
&lt;/blockquote&gt;</code>

Going through the code I found that the date was being set in certificate_factory.rb
<blockquote><code><br />
def set_ttl<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make the certificate valid as of yesterday, because<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# so many people&#039;s clocks are out of sync.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from = Time.now - (60*60*24)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@cert.not_before = from<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@cert.not_after = from + ttl<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
</code></blockquote>

Just for fun I ran the command through interactive ruby (irb) and discovered the source of the problem.
<blockquote><code><br />
[root@puppet ~]# ntpdate time.example.com<br />
29 Jan 09:02:45 ntpdate[9117]: step time server 192.168.0.1 offset -6377207.794727 sec<br />
[root@puppet ~]# irb<br />
irb(main):001:0&gt; Time.now<br />
=&gt; Tue Apr 13 05:25:50 -0400 2010<br />
irb(main):002:0&gt; quit<br />
[root@puppet ~]# date<br />
Fri Jan 29 08:59:07 EST 2010<br />
&lt;/blockquote&gt;</code>

I still don&#8217;t know why this happened, it&#8217;s not a puppet bug, it&#8217;s a ruby bug.  date was returning the expected results.  I checked Timezones, everything, all were good.  It was time for a kernel upgrade, so I did the upgrade and rebooted.  I haven&#8217;t seen the problem since :-/  The machine in question is a kvm running on version 88, I know there are some clock skew problems with earlier kvm&#8217;s but this is not really a skew, it&#8217;s far in the future&#8230;and the date was still being show as correct.  So ruby must&#8217;ve been calculating the date wrong somehow, it doesn&#8217;t really make sense&#8230;comments welcome.

Anyway, if this happens to you, maybe try irb and see if ruby thinks the date is wrong.]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/puppetserver-something/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>extract private key and cert from pkcs12 (cert8.db/key3.db)</title>
		<link>http://ramblings.narrabilis.com/wp/extract-private-key-and-cert-from-pkcs12/</link>
		<comments>http://ramblings.narrabilis.com/wp/extract-private-key-and-cert-from-pkcs12/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 18:55:41 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=267</guid>
		<description><![CDATA[using fedora-ds/redhat-ds it creates cert8.db and key3.db to store the certs.   I wanted to extract the private key as PEM so I could import it elsewhere.


[root@ldap] cd /etc/dirsrv/slapd-ldap
[root@ldap] pk12util -o cert.p12 -n &#039;server-cert&#039; -d .
Enter Password or Pin for &#34;NSS Certificate DB&#34;:
Enter password for PKCS12 file: 
Re-enter password: 
pk12util: PKCS12 EXPORT SUCCESSFUL
[root@ldap] openssl [...]]]></description>
			<content:encoded><![CDATA[using fedora-ds/redhat-ds it creates cert8.db and key3.db to store the certs.   I wanted to extract the private key as PEM so I could import it elsewhere.
<span id="more-267"></span>
<blockquote><code><br />
[root@ldap] cd /etc/dirsrv/slapd-ldap<br />
[root@ldap] pk12util -o cert.p12 -n &#039;server-cert&#039; -d .<br />
Enter Password or Pin for &quot;NSS Certificate DB&quot;:<br />
Enter password for PKCS12 file: <br />
Re-enter password: <br />
pk12util: PKCS12 EXPORT SUCCESSFUL<br />
[root@ldap] openssl pkcs12 -in cert.p12 -out cert.pem -nodes -clcerts<br />
Enter Import Password:<br />
MAC verified OK<br />
[root@ldap] cat cert.pem<br />
Bag Attributes<br />
&nbsp;&nbsp;&nbsp;&nbsp;friendlyName: server-cert<br />
&nbsp;&nbsp;&nbsp;&nbsp;localKeyID: 10 F4 C2 F6 01 3C 66 AA 72 35 C9 A7 DA B9 12 3F 11 A1 98 F6 <br />
Key Attributes: &lt;No Attributes&gt;<br />
&#45;&#45;&#45;--BEGIN PRIVATE KEY&#45;&#45;&#45;--<br />
MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBALA7rSWdSk4CVHef<br />
&#46;..<br />
BnevX/uQwZ3L1Qo=<br />
&#45;&#45;&#45;--END PRIVATE KEY&#45;&#45;&#45;--<br />
Bag Attributes<br />
&nbsp;&nbsp;&nbsp;&nbsp;friendlyName: server-cert<br />
&nbsp;&nbsp;&nbsp;&nbsp;localKeyID: 10 DD CC EE BB 3C 33 AC 72 35 C9 A7 DA B9 12 3F 11 A1 98 F6 <br />
subject=/C=US/ST=Any State/L=Any Town/O=Example/CN=ldap.example.com<br />
issuer=/C=US/ST=Any State/L=Any Town/O=Example/CN=certmaster.example.com<br />
&#45;&#45;&#45;--BEGIN CERTIFICATE&#45;&#45;&#45;--<br />
ChMcSW5zdGl0dXRlIGZvciBBZHZhbmNlZCBTdHVkeTEeMBwGA1UECxMVU2Nob29s<br />
&#46;..<br />
gIP23WbaOw4DygMwXfbJwF5K0xxv+NALlpoaZw==<br />
&#45;&#45;&#45;--END CERTIFICATE&#45;&#45;&#45;--<br />
&nbsp;<br />
</code></blockquote>

I couldn&#8217;t figure out how to do it with pk12util and certutil alone, the key was using openssl after exporting with pk12util&#8230;]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/extract-private-key-and-cert-from-pkcs12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>puppetmaster Error 400 on SERVER: Too many connections</title>
		<link>http://ramblings.narrabilis.com/wp/puppetmaster-error-400-on-server-too-many-connections/</link>
		<comments>http://ramblings.narrabilis.com/wp/puppetmaster-error-400-on-server-too-many-connections/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 19:30:52 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=263</guid>
		<description><![CDATA[Was getting this error on our puppetmaster that only had a few clients.
Turns out it&#8217;s just an error from mysql being passed down the line.  We share our mysql for puppet with multiple servers.  Restarting mysql saved the day&#8230;
Read http://dev.mysql.com/doc/refman/5.1/en/too-many-connections.html for instructions on increasing the limit&#8230;


mysql&#62; show variables like &#039;max_connections&#039;;
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+&#45;&#45;-&#45;&#45;&#45;-+
&#124; Variable_name&#160;&#160; &#124; Value [...]]]></description>
			<content:encoded><![CDATA[Was getting this error on our puppetmaster that only had a few clients.<span id="more-263"></span>
Turns out it&#8217;s just an error from mysql being passed down the line.  We share our mysql for puppet with multiple servers.  Restarting mysql saved the day&#8230;
Read <a href="http://dev.mysql.com/doc/refman/5.1/en/too-many-connections.html">http://dev.mysql.com/doc/refman/5.1/en/too-many-connections.html</a> for instructions on increasing the limit&#8230;

<blockquote><code><br />
mysql&gt; show variables like &#039;max_connections&#039;;<br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+&#45;&#45;-&#45;&#45;&#45;-+<br />
| Variable_name&nbsp;&nbsp; | Value |<br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+&#45;&#45;-&#45;&#45;&#45;-+<br />
| max_connections | 100&nbsp;&nbsp; | <br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+&#45;&#45;-&#45;&#45;&#45;-+<br />
1 row in set (0.00 sec)<br />
&nbsp;<br />
mysql&gt; <br />
</code></blockquote>

increasing the limit in /etc/my.cnf
<blockquote><code><br />
[mysqld]<br />
datadir=/var/lib/mysql<br />
&#46;..<br />
max_connections=200<br />
mysql&gt; show variables like &#039;max_connections&#039;;<br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+&#45;&#45;-&#45;&#45;&#45;-+<br />
| Variable_name&nbsp;&nbsp; | Value |<br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+&#45;&#45;-&#45;&#45;&#45;-+<br />
| max_connections | 200&nbsp;&nbsp; | <br />
+&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;&#45;--+&#45;&#45;-&#45;&#45;&#45;-+<br />
1 row in set (0.00 sec)<br />
&nbsp;<br />
mysql&gt;<br />
</code></blockquote>]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/puppetmaster-error-400-on-server-too-many-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>weird device names like devXXXXX with ifconfig on Fedora/RHEL</title>
		<link>http://ramblings.narrabilis.com/wp/weird-device-names-like-devxxxxx-with-ifconfig-on-fedorarhel/</link>
		<comments>http://ramblings.narrabilis.com/wp/weird-device-names-like-devxxxxx-with-ifconfig-on-fedorarhel/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 20:44:46 +0000</pubDate>
		<dc:creator>uphill</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ramblings.narrabilis.com/wp/?p=261</guid>
		<description><![CDATA[We had a machine that would keep coming up with devXXXXX where XXXXX is a seemingly random number.
We tried ifrename to no avail, modprobe -r didn&#8217;t help, modules.conf didn&#8217;t help.  It turned out that the HWADDR line in the ifcfg-ethX file was wrong. After fixing the line we were able to do ifup ethX [...]]]></description>
			<content:encoded><![CDATA[We had a machine that would keep coming up with devXXXXX where XXXXX is a seemingly random number.<span id="more-261"></span>
We tried ifrename to no avail, modprobe -r didn&#8217;t help, modules.conf didn&#8217;t help.  It turned out that the HWADDR line in the ifcfg-ethX file was wrong. After fixing the line we were able to do ifup ethX and the devXXXXX went away.
]]></content:encoded>
			<wfw:commentRss>http://ramblings.narrabilis.com/wp/weird-device-names-like-devxxxxx-with-ifconfig-on-fedorarhel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
