<?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>www.LinuxGeek.net &#187; Uncategorized</title>
	<atom:link href="http://www.linuxgeek.net/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linuxgeek.net</link>
	<description>Open Source and Linux Opinions and Reviews</description>
	<lastBuildDate>Sat, 10 Dec 2011 02:42:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Replacing failed software raided drive</title>
		<link>http://www.linuxgeek.net/2011/12/07/replacing-failed-software-raided-drive/</link>
		<comments>http://www.linuxgeek.net/2011/12/07/replacing-failed-software-raided-drive/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 08:42:48 +0000</pubDate>
		<dc:creator>pacneil</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.linuxgeek.net/?p=943</guid>
		<description><![CDATA[<p>I referenced these instructions to remind me how to replace a drive.</p>
<p>In my case the output of mdstat looks like this:</p>
<p># cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sda2[0] sdb2[1]
33615936 blocks [2/2] [UU]</p>
<p>md1 : active raid1 sda3[2](F) sdb3[1]
2096384 blocks [2/1] [_U]</p>
<p>md0 : active raid1 sda1[0] sdb1[1]
128384 blocks [2/2] [UU]</p>
<p>unused devices:</p>
<p>So I have three partitions on <p>keep reading <a href="http://www.linuxgeek.net/2011/12/07/replacing-failed-software-raided-drive/">Replacing failed software raided drive</a></p>]]></description>
			<content:encoded><![CDATA[<p>I referenced these <a href="http://www.kernelhardware.org/replacing-failed-raid-drive/">instructions</a> to remind me how to replace a drive.</p>
<p>In my case the output of mdstat looks like this:</p>
<p># cat /proc/mdstat<br />
Personalities : [raid1]<br />
md2 : active raid1 sda2[0] sdb2[1]<br />
33615936 blocks [2/2] [UU]</p>
<p>md1 : active raid1 sda3[2](F) sdb3[1]<br />
2096384 blocks [2/1] [_U]</p>
<p>md0 : active raid1 sda1[0] sdb1[1]<br />
128384 blocks [2/2] [UU]</p>
<p>unused devices:</p>
<p>So I have three partitions on two drives raided together. And sda3 is failing. This is the message I received in email.</p>
<pre>This is an automatically generated mail message from mdadm
running on host.domain.com

A Fail event had been detected on md device /dev/md1.

Faithfully yours, etc.
</pre>
<p>Device Boot      Start         End      Blocks   Id  System<br />
/dev/sda1   *           1          16      128488+  fd  Linux raid autodetect<br />
/dev/sda2              17        4201    33616012+  fd  Linux raid autodetect<br />
/dev/sda3            4202        4462     2096482+  fd  Linux raid autodetect</p>
<p>Device Boot      Start         End      Blocks   Id  System<br />
/dev/sdb1   *           1          16      128488+  fd  Linux raid autodetect<br />
/dev/sdb2              17        4201    33616012+  fd  Linux raid autodetect<br />
/dev/sdb3            4202        4462     2096482+  fd  Linux raid autodetect</p>
<p>Disk /dev/md0: 131 MB, 131465216 bytes<br />
Disk /dev/md1: 2146 MB, 2146697216 bytes<br />
Disk /dev/md2: 34.4 GB, 34422718464 bytes</p>
<h2>Removing the failed partition(s) and disk:</h2>
<p>I used the mdadm command to first fail</p>
<p>mdadm &#8211;manage -dev/md0 &#8211;fail /dev/sda2<br />
mdadm &#8211;manage -dev/md1 &#8211;fail /dev/sda3<br />
mdadm &#8211;manage -dev/md2 &#8211;fail /dev/sda1</p>
<p>then remove the raid devices on the failing drive.</p>
<p>madam &#8211;manage /dev/md0 &#8211;remove /dev/sda2<br />
madam &#8211;manage /dev/md1 &#8211;remove /dev/sda3<br />
madam &#8211;manage /dev/md2 &#8211;remove /dev/sda1</p>
<p>Then I shut down the system</p>
<p>shutdown -h now</p>
<p>and replaced the drive with a new one. Then I tried to reboot. But because the failed drive was the first drive in the scsi chain, it failed to boot with the message.</p>
<pre>No Operating System Present
</pre>
<h3>Adding the new disk to the RAID Array:</h3>
<p>So I ended up having to switch the drives, putting sdb in as sda and then proceeding. I used sfdisk to mirror the partitioning between the two drives.</p>
<p>sfdisk -d /dev/sd1 | sfdisk /dev/sdb</p>
<h3>Add the partitions back into the RAID Arrays:</h3>
<p>mdadm &#8211;manage /dev/md0 &#8211;add /dev/sdb2<br />
mdadm &#8211;manage /dev/md1 &#8211;add /dev/sdb3<br />
mdadm &#8211;manage /dev/md2 &#8211;add /dev/sdb1</p>
<p>cat /proc/mdstat</p>
<p>I could see the drive rebuilding. When it finished I hot swapped out sda and did the whole process over again, this time without rebooting the system, since the system uses hot swap drives. It worked fine and I had both drives up and running. I could have done the whole process without rebooting the machine.</p>
<h3>Install Grub on new hard drive MBR:</h3>
<p># grub<br />
grub&gt; find /grub/stage1<br />
(hd0,0)<br />
grub&gt; device (hd0) /dev/sdb<br />
grub&gt; root (hd0,0)<br />
grub&gt; setup (hd0)<br />
grub&gt; find /grub/stage1<br />
(hd0,0)<br />
(hd1,0)</p>
<p>grub&gt; quit</p>
<p>So now I have the boot manager mirrored on both drives. I can reboot with either single drive and it will work fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxgeek.net/2011/12/07/replacing-failed-software-raided-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios monitoring mysql</title>
		<link>http://www.linuxgeek.net/2010/06/24/nagios-monitoring-mysql/</link>
		<comments>http://www.linuxgeek.net/2010/06/24/nagios-monitoring-mysql/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 23:34:11 +0000</pubDate>
		<dc:creator>pacneil</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.linuxgeek.net/?p=906</guid>
		<description><![CDATA[<p>I was asked by a client to configure nagios to monitor two database servers, running on Redhat
Enterprise Linux 5. Here are the steps, including a couple mis-steps to get it working. Nagios
was already set up and running on a server called monitor, which is running CentOS5.</p>
<p>I had two options. I could directly monitor the databases <p>keep reading <a href="http://www.linuxgeek.net/2010/06/24/nagios-monitoring-mysql/">Nagios monitoring mysql</a></p>]]></description>
			<content:encoded><![CDATA[<p>I was asked by a client to configure nagios to monitor two database servers, running on Redhat<br />
Enterprise Linux 5. Here are the steps, including a couple mis-steps to get it working. Nagios<br />
was already set up and running on a server called monitor, which is running CentOS5.</p>
<p>I had two options. I could directly monitor the databases from monitor using the check_mysql or<br />
run check_mysql on the database server and call it through check_by_ssh. I started out configuring<br />
the method over ssh.</p>
<p>First, in each database server I created a user nagios and set a password for that user. I then<br />
created a set of keys:</p>
<blockquote><p>ssh-keygen -t dsa </p></blockquote>
<p>I set no  passphrase for the key, since I intended it to have a single purpose and limited<br />
access to the database servers. I then tested the access to see if there were any glitches.<br />
It worked on one server but not the other. After  a quick once over, I decided to proceed and<br />
solve that problem later. Since I needed check_mysql I compiled the plugins</p>
<p>From the <a title="Ngios Plugins" href="http://nagiosplugins.org/" target="_blank">nagios plugins web site</a>, I downloaded <strong>nagios-plugins-1.4.14.tar.gz</strong> to each of the<br />
database servers. However, because not all the necessary mysql packages were in place, it<br />
threw some errors during the configure stage.</p>
<blockquote><p>./configure &#8211;with-nagios-user=nagios &#8211;with-nagios-group=nagios &#8211;with-mysql=/usr</p></blockquote>
<p>The main error that interfered with my plans was the failure to build the check_mysql plugin.<br />
After some research I discovered that the failure was probably due to the absence of some<br />
mysql libraries that would be in a development package. However, RHEL5 doesn&#8217;t have such a<br />
package in their repository for RHEL5. It is available in some of the alternate repositories. It&#8217;s not really that surprising, when I think about it, that the package is unavailable, RHEL isn&#8217;t intended to be a development platform, it&#8217;s a server platform. I didn&#8217;t want to add alternate repositories without permission from the client.</p>
<p>So I went for plan B. I decided to configure the check-mysql to run on the monitor server<br />
and attach to the mysql database over the network. There is a danger that If not carefully configured  this could represent a security vulnerability for the database server. To make it as secure as possible<br />
I logged into mysql on each of the database servers and created special access rules for this<br />
purpose. I created a special nagios user with it&#8217;s own password and gave it read only permissions<br />
and only on one database.</p>
<blockquote><p>grant select on database.* to nagios@monitor identified by &#8220;password&#8221;</p></blockquote>
<p>Now the user nagios can read that database. It doesn&#8217;t have any more privileges, so it&#8217;s unlikely to be used to damage the database, even if the monitor were compromised. The bad guys won&#8217;t<br />
be able to use the compromise of the monitor to also compromise or damage the database server.</p>
<p>To test my work I issued the following command:</p>
<blockquote><p>/usr/local/nagios/libexec/check_mysql  -d database -u nagios -p password -H $HOSTNAME$ </p></blockquote>
<p><strong>$HOSTNAME</strong> is the ip of the database server.<br />
The data came back:</p>
<blockquote><p>Uptime: 528011  Threads: 61  Questions: 83799845  Slow queries: 38527  Opens:<br />
11365  Flush tables: 1  Open tables: 1003  Queries per second avg: 158.709</p></blockquote>
<p>To prevent the username and password from being exposed in the web interface I put some of the command values in resource.cfg</p>
<blockquote><p>###########################################################################<br />
#<br />
# RESOURCE.CFG &#8211; Sample Resource File for Nagios 3.0b6<br />
#<br />
# Last Modified: 09-10-2003<br />
#<br />
# You can define $USERx$ macros in this file, which can in turn be used<br />
# in command definitions in your host config file(s).  $USERx$ macros are<br />
# useful for storing sensitive information such as usernames, passwords,<br />
# etc.  They are also handy for specifying the path to plugins and</em><br />
# event handlers &#8211; if you decide to move the plugins or event handlers to<br />
# a different directory in the future, you can just update one or two<br />
# $USERx$ macros, instead of modifying a lot of command definitions.<br />
#<br />
# The CGIs will not attempt to read the contents of resource files, so<br />
# you can set restrictive permissions (600 or 660) on them.<br />
#<br />
# Nagios supports up to 32 $USERx$ macros ($USER1$ through $USER32$)<br />
#<br />
# Resource files may also be used to store configuration directives for<br />
# external data sources like MySQL&#8230;<br />
#<br />
###########################################################################</p>
<p># Sets $USER1$ to be the path to the plugins<br />
$USER1$=/usr/local/nagios/libexec<br />
# Sets $USER2$ to be the path to event handlers</p>
<p>#$USER2$=/usr/local/nagios/libexec/eventhandlers<br />
# Store some usernames and passwords (hidden from the CGIs)</p>
<p>$USER3$=nagios<br />
$USER4$=password</p>
<p>############################################################################################### </p></blockquote>
<p><em><strong>commands.cfg</strong></em> is where I put my tested command</p>
<blockquote><p>############################### commands.cfg ######################<br />
define command{<br />
        command_name                    check-mysql<br />
        command_line                    $USER1$/check_mysql -d tracking -u $USER3$ -p $USER4$ -H $HOSTADDRESS$<br />
}<br />
####################################################################
</p></blockquote>
<p>Next I need to tell nagios where to send messages.</p>
<blockquote><p>############################### contacts.cfg #######################<br />
define contact{<br />
  contact_name                    pacneil<br />
  use                             generic-contact<br />
  alias                           Neil Schneider<br />
  email                           pacneil@linuxgeek.net<br />
}</p>
<p>define contactgroup {<br />
    contactgroup_name                   pacneil<br />
    alias                               Test Group<br />
    members                             pacneil<br />
}<br />
######################################################################</p></blockquote>
<p>What group of servers are we going to monitor?</p>
<blockquote><p>###############################  host_groups.cfg #####################<br />
define hostgroup{<br />
  hostgroup_name      db-host-group<br />
  alias               Database Servers Host Group<br />
  hostgroup_members   db-slave-host-group<br />
}</p>
<p>define hostgroup{<br />
  hostgroup_name      db-slave-host-group<br />
  alias               Slave Database Servers Host Group<br />
}<br />
######################################################################</p></blockquote>
<p>And we need to configure some parameters how we want to display the hosts in the web interface.</p>
<blockquote><p>############################### hosts.cfg ############################<br />
define host{<br />
  use                     db-server<br />
  host_name               db3.servers.pmc<br />
  hostgroups              db-slave-host-group,lb1-host-group,rackspace-host-group<br />
  alias                   db3<br />
  display_name            Db3<br />
  address                 74.205.65.35<br />
  parents                 app2.servers.pmc<br />
  2d_coords               100,0<br />
  3d_coords               -5,4,1<br />
}</p>
<p>define host{<br />
  use                     db-server<br />
  host_name               db4.servers.pmc<br />
  hostgroups              db-slave-host-group,lb1-host-group,rackspace-host-group<br />
  alias                   db4<br />
  display_name            Db4<br />
  address                 74.205.65.36<br />
  parents                 app2.servers.pmc<br />
  2d_coords               200,0<br />
  3d_coords               -5,4,-1<br />
}</p>
<p>######################################################################</p></blockquote>
<p>And I create a service group just for database servers.</p>
<blockquote><p>########################## service_groups.cfg ########################</p>
<p>define servicegroup{<br />
  servicegroup_name           db-server-service-group<br />
  alias                       Database Server Service Group<br />
  servicegroup_members        server-service-group<br />
}<br />
######################################################################</p></blockquote>
<p>Then I define the service</p>
<blockquote><p>############################ services.cfg ############################<br />
define service{<br />
        use                     server-service<br />
        name                    db-server-service<br />
        servicegroups           db-server-service-group<br />
        hostgroup_name          db-host-group<br />
        register                0<br />
}</p>
<p>######################################################################</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxgeek.net/2010/06/24/nagios-monitoring-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redhat Enterprise 5.4 Released</title>
		<link>http://www.linuxgeek.net/2009/09/03/redhat-enterprise-5-4-released/</link>
		<comments>http://www.linuxgeek.net/2009/09/03/redhat-enterprise-5-4-released/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 19:26:34 +0000</pubDate>
		<dc:creator>pacneil</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[GFS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[openoffice]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[RHEL 5.4]]></category>
		<category><![CDATA[Samba]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.linuxgeek.net/?p=716</guid>
		<description><![CDATA[<p>This is at it&#8217;s heart an update to RHEL 5. But Redhat is promoting it as &#8220;the first product to deliver commercial quality open source virtualization featuring Kernel-based Virtual Machine (KVM) hypervisor technology.&#8221; The kernel version is still 2.6.18, with backported patches. Redhat is promoting upcoming Red Hat Enterprise Virtualization products along with RHEL 5.4 <p>keep reading <a href="http://www.linuxgeek.net/2009/09/03/redhat-enterprise-5-4-released/">Redhat Enterprise 5.4 Released</a></p>]]></description>
			<content:encoded><![CDATA[<p>This is at it&#8217;s heart an update to RHEL 5. But Redhat is promoting it as &#8220;the first product to deliver commercial quality open source virtualization featuring Kernel-based Virtual Machine (KVM) hypervisor technology.&#8221; The kernel version is still 2.6.18, with backported patches. Redhat is promoting upcoming Red Hat Enterprise Virtualization products along with RHEL 5.4 on the <a href="http://www.redhat.com/rhel/virtualization/" target="_blank"> announcement page </a>. </p>
<p>The server release is touted as providing &#8220;the most cost-effective, flexible, and scalable environment&#8221;. There are two flavors, Red Hat Enterprise Linux and Red Hat Enterprise Linux Advanced Platform. The number of guests on Advanced Platform is unlimited while the standard release is limited to four guests. </p>
<p>Redhat Enterprise Linux is certified as a guest OS on the following platforms: </p>
<ul>
<li>VMware ESX and VMware ESXi</li>
<li>BM POWER LPARs</li>
<li>IBM System z</li>
</ul>
<p>Redhat Enterprise Linux supports three distributed system technologies:</p>
<ul>
<li>Logical Volume Manager (LVM)</li>
<li>Global File System (GFS)</li>
<li>Distributed Lock Manager (DLM)</li>
</ul>
<p>Redhat also has new managment tools for managing virtualized environments. And of course it provides tools like Samba for integration into Windows environments, Apache Web server, MySQL and Postgresql databases. And of course all the enterprise network services such as DNS, dhcp, and firewall capabilities are included. </p>
<p>Redhat is also promoting Redhat Enterprise Desktop as an alternative to &#8220;proprietary&#8221; desktop operating systems. They&#8217;re selling the &#8220;security&#8221; features and cost benefits of managing their system. And if you must run one of those &#8220;proprietary&#8221; systems, they offer virtualization to run it as a guest OS. </p>
<p>While not everything on RHEL 5.4 is the latest release, it does provide the kind of system and support that will make management comfortable. </p>
<p>Subscribers to RHEL 5 will get the updates automatically for free. New subscribers will pay about $349 for the server version and prices start at $80 for the desktop version. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxgeek.net/2009/09/03/redhat-enterprise-5-4-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML Flaws disclosed</title>
		<link>http://www.linuxgeek.net/2009/08/07/xml-flaws-disclosed/</link>
		<comments>http://www.linuxgeek.net/2009/08/07/xml-flaws-disclosed/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 21:14:06 +0000</pubDate>
		<dc:creator>pacneil</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Codenomicon]]></category>
		<category><![CDATA[CROSS]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[openoffice]]></category>
		<category><![CDATA[programming flaws]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web browser]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.linuxgeek.net/?p=706</guid>
		<description><![CDATA[<p>http://www.sdlinux.com/2009/08/xml-flaws-disclosed/</p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sdlinux.com/2009/08/xml-flaws-disclosed/" target="_blank">http://www.sdlinux.com/2009/08/xml-flaws-disclosed/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxgeek.net/2009/08/07/xml-flaws-disclosed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Home</title>
		<link>http://www.linuxgeek.net/2008/04/03/hello-world/</link>
		<comments>http://www.linuxgeek.net/2008/04/03/hello-world/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 22:11:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.linuxgeek.net/?p=1</guid>
		<description><![CDATA[<p>Well there&#8217;s a new look here at LinuxGeek.net. I decided to join the next step in internet evolution and create a blog. I don&#8217;t know how well I&#8217;ll do at blogging. First I need to get all my old content over here, then I can start writing.</p>
<p>If you&#8217;ve been here before then you know this <p>keep reading <a href="http://www.linuxgeek.net/2008/04/03/hello-world/">Home</a></p>]]></description>
			<content:encoded><![CDATA[<p>Well there&#8217;s a new look here at LinuxGeek.net. I decided to join the next step in internet evolution and create a blog. I don&#8217;t know how well I&#8217;ll do at blogging. First I need to get all my old content over here, then I can start writing.</p>
<p>If you&#8217;ve been here before then you know this is my hobby site.  I&#8217;ve been using Unix/Linux since 1988. Linux is my primary OS and I rarely touch Windows unless I have to.</p>
<p>I&#8217;m the president of the local Linux User Group <a href="http://www.kernel-panic.org">Kernel Panic Linux User Group</a> I participate in local  <a href="http://www.kernel-panic.org/wiki/Installfest">installfests</a>, TechFests and of course our monthly meetings, where I and other members of the group give presentations on Linux topics.</p>
<p>I also do Computer consulting, including network security, network design and integration, system administration and of course my specialty is Linux . The name of my company is <a href="http://www.paccomp.com">Pacific Rim Computer Products</a>. Feel free to contact me, if you need some help.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxgeek.net/2008/04/03/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

