<?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"
	>

<channel>
	<title>UtahSysAdmin.com</title>
	<atom:link href="http://www.utahsysadmin.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.utahsysadmin.com</link>
	<description>Ramblings of a Utah System Administrator</description>
	<pubDate>Sun, 15 Jun 2008 19:44:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Find large files in multiple directories</title>
		<link>http://www.utahsysadmin.com/2008/06/15/find-large-files-in-multiple-directories/</link>
		<comments>http://www.utahsysadmin.com/2008/06/15/find-large-files-in-multiple-directories/#comments</comments>
		<pubDate>Sun, 15 Jun 2008 19:37:57 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
		
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/?p=104</guid>
		<description><![CDATA[I haven&#8217;t posted for awhile because I have been super busy.  I don&#8217;t think I have had a chance to post anything since EMC announced they were going to buy Iomega in the beginning of May.  That sale has now gone through earlier this week, but the workload has not decreased in the [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t posted for awhile because I have been super busy.  I don&#8217;t think I have had a chance to post anything since EMC announced they were going to buy Iomega in the beginning of May.  That sale has now gone through earlier this week, but the workload has not decreased in the slightest.</p>
<p>Anyway, most admins know how to find the largest files inside a single directory:</p>
<blockquote><p>du -sk * | sort -n</p></blockquote>
<p>The other day I needed to find the largest of over 10k+ files spread across hundreds of directories.  So with a little command combo magic, I used this:</p>
<blockquote><p>for i in `find . -type f`; do du -sk $i; done | sort -n</p></blockquote>
<p>Which runs a du -sk on every single file within the current directory and all sub-directories, pipes it to a sort, with the last files being output to the screen being the largest.</p>
<p>Looking at it again today, I guess I probably could have removed the for loop and just done:</p>
<blockquote><p>du -sk `find . -type f` | sort -n</p></blockquote>
<p>Testing it out real quick shows that it works; however, if you have as many files as I had to go through, you would have quickly exhausted du and it would have complained:</p>
<blockquote><p>-bash: /usr/bin/du: Argument list too long</p></blockquote>
<p>So it looks like the for loop was needed after all.  Personally, I love running for loops on the command line.</p>
<p>Happy Father&#8217;s Day to all you fathers out there!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2008/06/15/find-large-files-in-multiple-directories/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Author Highlighting</title>
		<link>http://www.utahsysadmin.com/2008/04/29/author-highlighting/</link>
		<comments>http://www.utahsysadmin.com/2008/04/29/author-highlighting/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 03:27:34 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
		
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/?p=102</guid>
		<description><![CDATA[I read this post by Matt Cutts awhile back (I recommend subscribing to his blog, some useful stuff there) and now that my blog is getting to the point where people are commenting on my posts and I am commenting back, it made sense to implement this on my blog.  Going through his instructions [...]]]></description>
			<content:encoded><![CDATA[<p>I read this <a href="http://www.mattcutts.com/blog/highlight-author-comments-wordpress/" target="_blank">post</a> by Matt Cutts awhile back (I recommend subscribing to his blog, some useful stuff there) and now that my blog is getting to the point where people are commenting on my posts and I am commenting back, it made sense to implement this on my blog.  Going through his instructions I had a couple things to add.  Instead of just adding a new line to your css file with a background color, I would recommend duplicating the .alt section of your css and then changing the color there.  That way all the other formatting sticks with your comment.  For example, all of my comments have rounded corners, if I just added the line he recommends, my comments are square.  Enough said there.</p>
<p>The other section I wonder about but doesn&#8217;t really apply to my blog, is for blogs with multiple authors.  His code says:</p>
<p><code>if (1 == $comment-&gt;user_id)</code></p>
<p>which only highlights the comments of the admin user - who may not even be the original author.  Someday, when I&#8217;m a WordPress hacker, I&#8217;ll tell you what the correct line should be, or some other guru can add it.  But there should be something like:</p>
<p><code>if ($article-&gt;user_id == $comment-&gt;user_id)</code></p>
<p>Again I don&#8217;t know what the right variable for the $article-&gt;user_id would be.  If you take the time to figure it out, let us know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2008/04/29/author-highlighting/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Upgrading WordPress</title>
		<link>http://www.utahsysadmin.com/2008/04/25/upgrading-wordpress/</link>
		<comments>http://www.utahsysadmin.com/2008/04/25/upgrading-wordpress/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 04:52:56 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
		
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/?p=101</guid>
		<description><![CDATA[Well, it&#8217;s one of the great and annoying things about open source software - frequent code changes, updates, and security releases.  Version 2.5 of WordPress came out less then a month ago.  I decided, I&#8217;d wait for the first subversion release (2.5.1), which, of course, would inevitably fix problems with all the new features introduced.  [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it&#8217;s one of the great and annoying things about open source software - frequent code changes, updates, and security releases.  Version 2.5 of WordPress came out less then a month ago.  I decided, I&#8217;d wait for the first subversion release (2.5.1), which, of course, would inevitably fix problems with all the new features introduced.  Unfortunately, one of my blogs (not this one), was &#8220;hacked&#8221; and had malware inserted into a post.  So, I went ahead and upgraded all my blogs.  Now, three days later, WordPress releases 2.5.1.  Some guys just have all the luck, maybe sometime I&#8217;ll have some!  Since 2.5.1 fixes a &#8220;very important security fix&#8221;, I installed it immediately. . . let the script kiddies hack somebody else.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2008/04/25/upgrading-wordpress/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to add a swap drive to Solaris 10</title>
		<link>http://www.utahsysadmin.com/2008/04/10/how-to-add-a-swap-drive-to-solaris-10/</link>
		<comments>http://www.utahsysadmin.com/2008/04/10/how-to-add-a-swap-drive-to-solaris-10/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 17:46:34 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
		
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/2008/04/10/how-to-add-a-swap-drive-to-solaris-10/</guid>
		<description><![CDATA[So I needed more swap space, but didn&#8217;t have any more space on the current disk.  What to do?  Add another drive and set it up as swap space.  The only caveat is that I am running the 32 bit version of Solaris 10, which has a limitation on maximum swap size [...]]]></description>
			<content:encoded><![CDATA[<p>So I needed more swap space, but didn&#8217;t have any more space on the current disk.  What to do?  Add another drive and set it up as swap space.  The only caveat is that I am running the 32 bit version of Solaris 10, which has a limitation on maximum swap size of 2 GB.  So if you have a  hard drive that is larger then 2 GB, you need to partition the drive into multiple 2 GB slices.</p>
<p>First, check what your swap space is already set to:</p>
<blockquote><p># swap -l<br />
swapfile             dev  swaplo blocks   free<br />
/dev/dsk/c1t0d0s1   61,1       8 4194288 4194288</p></blockquote>
<p>In this case, it is set to 2 GB (4194288 x 512 bytes = 1.99999237 gigabytes) and is set to partition 1 on the first drive.</p>
<p>So in this example, I added a 4 GB drive and ran devfsadm.  Format shows the second drive available:</p>
<blockquote><p># format<br />
Searching for disks&#8230;done</p>
<p>AVAILABLE DISK SELECTIONS:<br />
0. c1t0d0 <default><br />
/pci@0,0/pci1000,30@10/sd@0,0<br />
1. c1t1d0 <default><br />
/pci@0,0/pci1000,30@10/sd@1,0</default></default></p></blockquote>
<p>Next, the drive needs some partitions, so we use fdisk (after choosing 1, the new drive):</p>
<blockquote><p>format&gt; fdisk<br />
No fdisk table exists. The default partition for the disk is:</p>
<p>a 100% &#8220;SOLARIS System&#8221; partition</p>
<p>Type &#8220;y&#8221; to accept the default partition,  otherwise type &#8220;n&#8221; to edit the<br />
partition table.<br />
y</p>
<p>format&gt; part</p>
<p>PARTITION MENU:<br />
&#8230;.</p>
<p>partition&gt; print<br />
Current partition table (original):<br />
Total disk cylinders available: 2044 + 2 (reserved cylinders)</p>
<p>Part      Tag    Flag     Cylinders        Size            Blocks<br />
0 unassigned    wm       0               0         (0/0/0)          0<br />
1 unassigned    wm       0               0         (0/0/0)          0<br />
2     backup    wu       0 - 2044        3.99GB    (2045/0/0) 8376320<br />
3 unassigned    wm       0               0         (0/0/0)          0<br />
4 unassigned    wm       0               0         (0/0/0)          0<br />
5 unassigned    wm       0               0         (0/0/0)          0<br />
6 unassigned    wm       0               0         (0/0/0)          0<br />
7 unassigned    wm       0               0         (0/0/0)          0<br />
8       boot    wu       0 -    0        2.00MB    (1/0/0)       4096<br />
9 unassigned    wm       0               0         (0/0/0)          0</p>
<p>partition&gt; 0<br />
Part      Tag    Flag     Cylinders        Size            Blocks<br />
0 unassigned    wm       0               0         (0/0/0)          0</p>
<p>Enter partition id tag[unassigned]: swap<br />
Enter partition permission flags[wm]:<br />
Enter new starting cyl[1]:<br />
Enter partition size[0b, 0c, 1e, 0.00mb, 0.00gb]: 1021c</p>
<p>partition&gt; 1<br />
Part      Tag    Flag     Cylinders        Size            Blocks<br />
1 unassigned    wm       0               0         (0/0/0)          0</p>
<p>Enter partition id tag[unassigned]: swap<br />
Enter partition permission flags[wm]:<br />
Enter new starting cyl[1]: 1022<br />
Enter partition size[0b, 0c, 1025e, 0.00mb, 0.00gb]: 1021c</p>
<p>partition&gt; print<br />
Volume:  swap<br />
Current partition table (unnamed):<br />
Total disk cylinders available: 2044 + 2 (reserved cylinders)</p>
<p>Part      Tag    Flag     Cylinders        Size            Blocks<br />
0       swap    wm       1 - 1021        1.99GB    (1021/0/0) 4182016<br />
1       swap    wm    1022 - 2042        1.99GB    (1021/0/0) 4182016<br />
2     backup    wu       0 - 2043        3.99GB    (2044/0/0) 8372224<br />
3 unassigned    wm       0               0         (0/0/0)          0<br />
4 unassigned    wm       0               0         (0/0/0)          0<br />
5 unassigned    wm       0               0         (0/0/0)          0<br />
6 unassigned    wm       0               0         (0/0/0)          0<br />
7 unassigned    wm       0               0         (0/0/0)          0<br />
8       boot    wu       0 -    0        2.00MB    (1/0/0)       4096<br />
9 unassigned    wm       0               0         (0/0/0)          0<br />
partition&gt; label<br />
Ready to label disk, continue? y<br />
partition&gt; quit<br />
format&gt; label<br />
Ready to label disk, continue? y<br />
format&gt; quit</p></blockquote>
<p>Now to add the partitions as swap space:</p>
<blockquote><p>swap -a /dev/dsk/c1t1d0s0<br />
swap -a /dev/dsk/c1t1d0s1</p></blockquote>
<p>And check that it is now available:</p>
<blockquote><p>swap -l<br />
swapfile             dev  swaplo blocks   free<br />
/dev/dsk/c1t0d0s1   61,1       8 4194288 4194288<br />
/dev/dsk/c1t1d0s0   61,64      8 4182008 4182008<br />
/dev/dsk/c1t1d0s1   61,65      8 4182008 4182008</p></blockquote>
<p>Now we need to add them to /etc/vfstab so that they are used after a reboot by /sbin/swapadd.  This one was already in there:</p>
<blockquote><p>/dev/dsk/c1t0d0s1       -       -       swap    -       no      -</p></blockquote>
<p>So then we add the additional partitions:</p>
<blockquote><p>/dev/dsk/c1t1d0s0       -       -       swap    -       no      -<br />
/dev/dsk/c1t1d0s1       -       -       swap    -       no      -</p></blockquote>
<p>If you decide to delete your old swap swap, use the `swap -d` command and don&#8217;t forget to change your dump space with `dumpadm -d`.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2008/04/10/how-to-add-a-swap-drive-to-solaris-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rename a Solaris 10 server</title>
		<link>http://www.utahsysadmin.com/2008/04/08/rename-a-solaris-10-server/</link>
		<comments>http://www.utahsysadmin.com/2008/04/08/rename-a-solaris-10-server/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 22:10:33 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
		
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/2008/04/08/rename-a-solaris-10-server/</guid>
		<description><![CDATA[To rename a Solaris 10 server, simply change these three files and then reboot:
/etc/nodename
/etc/inet/hosts
/etc/hostname.hme0 (change hme0 to whatever the network interface name is)
Another piece that makes sense to change, although not necessary is the dump space where you save crash dumps.  To fix this is also easy:
 cd /var/crash
mv oldname newname
dumpadm -s /var/crash/newname
To change [...]]]></description>
			<content:encoded><![CDATA[<p>To rename a Solaris 10 server, simply change these three files and then reboot:</p>
<blockquote><p>/etc/nodename<br />
/etc/inet/hosts<br />
/etc/hostname.<em>hme0</em> (change hme0 to whatever the network interface name is)</p></blockquote>
<p>Another piece that makes sense to change, although not necessary is the dump space where you save crash dumps.  To fix this is also easy:</p>
<blockquote><p> cd /var/crash<br />
mv <em>oldname newname</em><br />
dumpadm -s /var/crash/<em>newname</em></p></blockquote>
<p>To change the IP, all you need to do is change the IP address in /etc/hosts.</p>
<p>Note:  /etc/inet/ipnodes may also need to be changed when using IPv6.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2008/04/08/rename-a-solaris-10-server/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Premium EV SSL Certificates</title>
		<link>http://www.utahsysadmin.com/2008/04/05/premium-ev-ssl-certificates/</link>
		<comments>http://www.utahsysadmin.com/2008/04/05/premium-ev-ssl-certificates/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 20:35:04 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
		
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/2008/04/05/premium-ev-ssl-certificates/</guid>
		<description><![CDATA[So I purchased a premium SSL EV (Extended Validation) certificate from GoDaddy awhile back for a customer.  It all sounded like a good idea, there are many reports that talk about the lower abandonment rates in shopping carts, thanks to the green address bar.  Besides the fact that they cost ten times as much, I [...]]]></description>
			<content:encoded><![CDATA[<p>So I purchased a premium SSL EV (Extended Validation) certificate from GoDaddy awhile back for a customer.  It all sounded like a good idea, there are many reports that talk about the lower abandonment rates in shopping carts, thanks to the green address bar.  Besides the fact that they cost ten times as much, I figured there would be a little bit more validation then simply e-mailing the administrative record in DNS for the domain asking for verification, but I had no idea how complex the process was to validate ownership of the domain.</p>
<p>First, you had to provide all of the details on the company from the registered number of incorporation, location of incorporation, etc., but then there was a 13 page contract and then after you get that to them they ask for a legal opinion letter from a registered attorney in the location of the company&#8217;s incorporation verifying the company&#8217;s identity.  Who knows, they may want more after that - I&#8217;ll never know.  This was enough for the company to decide they no longer wanted one.  I called up the billing department and was able to get a refund pretty quickly.</p>
<p>I then purchased a standard SSL and had a new certificate the next day.  I don&#8217;t think I would ever recommend the EV certificate again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2008/04/05/premium-ev-ssl-certificates/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Validating a CSR with openssl</title>
		<link>http://www.utahsysadmin.com/2008/04/01/validating-a-csr-with-openssl/</link>
		<comments>http://www.utahsysadmin.com/2008/04/01/validating-a-csr-with-openssl/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 17:38:35 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
		
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/2008/04/01/validating-a-csr-with-openssl/</guid>
		<description><![CDATA[I had a problem getting a CSR to work in GoDaddy&#8217;s SSL certificate wizard, it would never accept the CSR.  I am working with their support currently, but I wanted to validate the CSR on my own first. This is how I did it:
openssl req -noout -text -in domain.com.csr
Update:  I&#8217;m sure you&#8217;re all [...]]]></description>
			<content:encoded><![CDATA[<p>I had a problem getting a CSR to work in GoDaddy&#8217;s SSL certificate wizard, it would never accept the CSR.  I am working with their support currently, but I wanted to validate the CSR on my own first. This is how I did it:</p>
<blockquote><p>openssl req -noout -text -in domain.com.csr</p></blockquote>
<p>Update:  I&#8217;m sure you&#8217;re all wondering what the problem was!  Well, I was copying and pasting the CSR from gedit into their web form.  For some reason, gedit was doing something with the text that was not visible - ok, maybe it was visible, perhaps it could have been the color syntax highlighting?    I wouldn&#8217;t think that would copy over, and it looked correct in their web form.  Anyway, I simply `cat` the CSR in a terminal window and copied that over and it worked perfectly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2008/04/01/validating-a-csr-with-openssl/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Validate Packages in Solaris 10</title>
		<link>http://www.utahsysadmin.com/2008/03/27/validate-packages-in-solaris-10/</link>
		<comments>http://www.utahsysadmin.com/2008/03/27/validate-packages-in-solaris-10/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 04:21:07 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
		
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/2008/03/27/validate-packages-in-solaris-10/</guid>
		<description><![CDATA[I previously posted in my useful comments entry how to validate rpm files on an rpm based Linux server using `rpm -Va` and then checking the output.  So how do you do this on Solaris 10?   It&#8217;s actually quite simple.  Use the pgkchk command.  If you want to check a [...]]]></description>
			<content:encoded><![CDATA[<p>I previously posted in my <a href="http://www.utahsysadmin.com/2007/01/25/useful-commands/" title="Useful Commands" target="_blank">useful comments entry</a> how to validate rpm files on an rpm based Linux server using `rpm -Va` and then checking the output.  So how do you do this on Solaris 10?   It&#8217;s actually quite simple.  Use the pgkchk command.  If you want to check a specific package use:</p>
<blockquote><p>pkgchk &lt;package name&gt;</p></blockquote>
<p>If it doesn&#8217;t return anything that package is fine.  If you want to make sure it is checking the files you can always use the -v parameter:</p>
<blockquote><p>pkgchk -v &lt;package name&gt;</p></blockquote>
<p>If you want to validate all of the packages on the system, don&#8217;t add any parameters (of course, you can always use -v here, but then you won&#8217;t be able to keep track of the errors.</p>
<blockquote><p>pkgchk</p></blockquote>
<p>Of course, just because something comes up doesn&#8217;t mean that you&#8217;ve been hacked or anything, just that someone or something has modified the particular file since it was installed. You will need to go through each of the files it finds and decide if that is normal or not for your own individual installation.  You can also just check file attributes only (-a) or file content only (-c).</p>
<p>Note:  Since all of the errors that pkgchk finds are sent to standard error, you need to make sure you redirect standard error to a file if you want to save the contents somewhere.  So to save to a file you may want to run something like this:</p>
<blockquote><p>pkgchk &gt; /root/pkgchk.errors 2&gt;&amp;1</p></blockquote>
<p>Follow up - How do you easily list what packages are installed on your system (rpm -qa)? With the pkginfo command without any parameters!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2008/03/27/validate-packages-in-solaris-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Configuring Nagios Plugins &#038; NRPE on Solaris 10</title>
		<link>http://www.utahsysadmin.com/2008/03/14/configuring-nagios-plugins-nrpe-on-solaris-10/</link>
		<comments>http://www.utahsysadmin.com/2008/03/14/configuring-nagios-plugins-nrpe-on-solaris-10/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 16:48:36 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
		
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/2008/03/14/configuring-nagios-plugins-nrpe-on-solaris-10/</guid>
		<description><![CDATA[Here&#8217;s a step by step installation of the Nagios plugin NRPE for Solaris 10 x86 (as the remote host):
useradd -c &#8220;nagios system user&#8221; -d /usr/local/nagios -m nagios
chown nagios:nagios /usr/local/nagios/
cd /usr/local/src # or wherever you like to put source code
wget http://internap.dl.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz
wget http://internap.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz
gunzip nagios-plugins-1.4.11.tar.gz
tar -xvf nagios-plugins-1.4.11.tar
gunzip nrpe-2.12.tar.gz
tar -xvf nrpe-2.12.tar
First we&#8217;ll compile the nagios plugins:
 cd nagios-plugins-1.4.11
./configure
make
make install
chown [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a step by step installation of the Nagios plugin NRPE for Solaris 10 x86 (as the remote host):</p>
<blockquote><p>useradd -c &#8220;nagios system user&#8221; -d /usr/local/nagios -m nagios<br />
chown nagios:nagios /usr/local/nagios/<br />
cd /usr/local/src # or wherever you like to put source code<br />
wget http://internap.dl.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz<br />
wget http://internap.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz<br />
gunzip nagios-plugins-1.4.11.tar.gz<br />
tar -xvf nagios-plugins-1.4.11.tar<br />
gunzip nrpe-2.12.tar.gz<br />
tar -xvf nrpe-2.12.tar</p></blockquote>
<p>First we&#8217;ll compile the nagios plugins:</p>
<blockquote><p> cd nagios-plugins-1.4.11<br />
./configure<br />
make<br />
make install<br />
chown -R nagios:nagios /usr/local/nagios/libexec<br />
cd ..</p></blockquote>
<p>Run a quick check to make sure the plugins are working:</p>
<blockquote><p>/usr/local/nagios/libexec/check_disk -w 10 -c 5 -p /</p></blockquote>
<p>Next, we&#8217;ll compile NRPE.  Normally at this point we would just run `cd nrpe-2.12; ./configure`.  Unfortunately, the configure script can not find the SSH headers and libraries on Solaris 10.  You get errors like this:</p>
<blockquote><p>checking for SSL headers&#8230; configure: error: Cannot find ssl headers</p></blockquote>
<blockquote><p>checking for SSL libraries&#8230; configure: error: Cannot find ssl libraries</p></blockquote>
<p>The answer to this is, of course, to tell configure where to find them:</p>
<blockquote><p>cd nrpe-2.12<br />
./configure &#8211;with-ssl=/usr/sfw/ &#8211;with-ssl-lib=/usr/sfw/lib/</p></blockquote>
<p>Currently there is a bug in 2.12 that it assumes that all systems have 2 syslog facilities that Solaris doesn&#8217;t have, so if you try and compile it generates the following errors:</p>
<blockquote><p>nrpe.c: In function `get_log_facility&#8217;:<br />
nrpe.c:617: error: `LOG_AUTHPRIV&#8217; undeclared (first use in this function)<br />
nrpe.c:617: error: (Each undeclared identifier is reported only once<br />
nrpe.c:617: error: for each function it appears in.)<br />
nrpe.c:619: error: `LOG_FTP&#8217; undeclared (first use in this function)<br />
*** Error code 1<br />
make: Fatal error: Command failed for target `nrpe&#8217;<br />
Current working directory /usr/local/src/nrpe-2.12/src<br />
*** Error code 1<br />
make: Fatal error: Command failed for target `all&#8217;</p></blockquote>
<p>Unfortunately, the fix at this time is to comment out the code that calls these two facilities, lines 616-619, in src/nrpe.c:</p>
<blockquote><p>        /*else if(!strcmp(varvalue,&#8221;authpriv&#8221;))<br />
log_facility=LOG_AUTHPRIV;<br />
else if(!strcmp(varvalue,&#8221;ftp&#8221;))<br />
log_facility=LOG_FTP;*/</p></blockquote>
<p>Now it will compile:</p>
<blockquote><p># make all<br />
cd ./src/; make ; cd ..<br />
gcc -g -O2 -I/usr/sfw//include/openssl -I/usr/sfw//include -DHAVE_CONFIG_H -o nrpe nrpe.c utils.c -L/usr/sfw/lib/  -lssl -lcrypto -lnsl -lsocket  ./snprintf.o<br />
gcc -g -O2 -I/usr/sfw//include/openssl -I/usr/sfw//include -DHAVE_CONFIG_H -o check_nrpe check_nrpe.c utils.c -L/usr/sfw/lib/  -lssl -lcrypto -lnsl -lsocket</p>
<p>*** Compile finished ***</p></blockquote>
<p>Next install the new binaries:</p>
<blockquote><p># make install<br />
cd ./src/ &amp;&amp; make install<br />
make install-plugin<br />
.././install-sh -c -m 775 -o nagios -g nagios -d /usr/local/nagios/libexec<br />
.././install-sh -c -m 775 -o nagios -g nagios check_nrpe /usr/local/nagios/libexec<br />
make install-daemon<br />
.././install-sh -c -m 775 -o nagios -g nagios -d /usr/local/nagios/bin<br />
.././install-sh -c -m 775 -o nagios -g nagios nrpe /usr/local/nagios/bin</p></blockquote>
<p>Optionally, if you want to use the sample config file run (Recommended if you don&#8217;t already have a standard config):</p>
<blockquote><p># make install-daemon-config<br />
./install-sh -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc<br />
./install-sh -c -m 644 -o nagios -g nagios sample-config/nrpe.cfg /usr/local/nagios/etc</p></blockquote>
<p>Modify the nrpe.cfg file with your settings:</p>
<blockquote><p>vi /usr/local/nagios/etc/nrpe.cfg</p></blockquote>
<p>With Solaris 10, we don&#8217;t use either inetd or xinetd, but SMF.  Thankfully, we can convert inetd entires into the SMF repository with the inetconv command.  So first, add the following entry to /etc/services:</p>
<blockquote><p>nrpe            5666/tcp                        # NRPE</p></blockquote>
<p>Then add the following line to the end of /etc/inet/inetd.conf:</p>
<blockquote><p>nrpe stream tcp nowait nagios /usr/sfw/sbin/tcpd /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -i</p></blockquote>
<p>Next, we need to convert it to SMF:</p>
<blockquote><p># inetconv<br />
nrpe -&gt; /var/svc/manifest/network/nrpe-tcp.xml<br />
Importing nrpe-tcp.xml &#8230;Done<br />
# inetconv -e<br />
svc:/network/nrpe/tcp:default enabled</p></blockquote>
<p>Check to make sure it went online:</p>
<blockquote><p># svcs svc:/network/nrpe/tcp:default<br />
STATE          STIME    FMRI<br />
online         15:53:39 svc:/network/nrpe/tcp:default<br />
# netstat -a | grep nrpe<br />
*.nrpe               *.*                0      0 49152      0 LISTEN</p></blockquote>
<p>Check the default installed parameters:</p>
<blockquote><p># inetadm -l svc:/network/nrpe/tcp:default<br />
SCOPE    NAME=VALUE<br />
name=&#8221;nrpe&#8221;<br />
endpoint_type=&#8221;stream&#8221;<br />
proto=&#8221;tcp&#8221;<br />
isrpc=FALSE<br />
wait=FALSE<br />
exec=&#8221;/usr/sfw/sbin/tcpd -c /usr/local/nagios/etc/nrpe.cfg -i&#8221;<br />
arg0=&#8221;/usr/local/nagios/bin/nrpe&#8221;<br />
user=&#8221;nagios&#8221;<br />
default  bind_addr=&#8221;"<br />
default  bind_fail_max=-1<br />
default  bind_fail_interval=-1<br />
default  max_con_rate=-1<br />
default  max_copies=-1<br />
default  con_rate_offline=-1<br />
default  failrate_cnt=40<br />
default  failrate_interval=60<br />
default  inherit_env=TRUE<br />
default  tcp_trace=FALSE<br />
default  tcp_wrappers=FALSE<br />
default  connection_backlog=10</p></blockquote>
<p>Change it so that it uses tcp_wrappers:</p>
<blockquote><p># inetadm -m svc:/network/nrpe/tcp:default tcp_wrappers=TRUE</p></blockquote>
<p>And check to make sure it took effect:</p>
<blockquote><p># inetadm -l svc:/network/nrpe/tcp:default<br />
SCOPE    NAME=VALUE<br />
name=&#8221;nrpe&#8221;<br />
endpoint_type=&#8221;stream&#8221;<br />
proto=&#8221;tcp&#8221;<br />
isrpc=FALSE<br />
wait=FALSE<br />
exec=&#8221;/usr/sfw/sbin/tcpd -c /usr/local/nagios/etc/nrpe.cfg -i&#8221;<br />
arg0=&#8221;/usr/local/nagios/bin/nrpe&#8221;<br />
user=&#8221;nagios&#8221;<br />
default  bind_addr=&#8221;"<br />
default  bind_fail_max=-1<br />
default  bind_fail_interval=-1<br />
default  max_con_rate=-1<br />
default  max_copies=-1<br />
default  con_rate_offline=-1<br />
default  failrate_cnt=40<br />
default  failrate_interval=60<br />
default  inherit_env=TRUE<br />
default  tcp_trace=FALSE<br />
tcp_wrappers=TRUE<br />
default  connection_backlog=10</p></blockquote>
<p>Modify your hosts.allow and hosts.deny to only allow your nagios server access to the NRPE port.  Note that tcpd always looks at hosts.allow first, so even though we specify that everyone is rejected in the hosts.deny file, the ip addresses specified in hots.allow are allowed.<br />
/etc/hosts.allow:</p>
<blockquote><p>nrpe: LOCAL, 10.0.0.45</p></blockquote>
<p>/etc/hosts.deny:</p>
<blockquote><p>nrpe: ALL</p></blockquote>
<p>Finally, check to make sure you have everything installed correctly (should return version information):</p>
<blockquote><p>/usr/local/nagios/libexec/check_nrpe -H localhost<br />
NRPE v2.12</p></blockquote>
<p>Optionally, modify any firewalls between your nagios server and the remote host to allow port 5666.<br />
Don&#8217;t forget to configure your nagios server to check your new service.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2008/03/14/configuring-nagios-plugins-nrpe-on-solaris-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Registering Solaris 10 and updating patches from the command line (CLI)</title>
		<link>http://www.utahsysadmin.com/2008/03/11/registering-solaris-10-from-the-command-line-cli/</link>
		<comments>http://www.utahsysadmin.com/2008/03/11/registering-solaris-10-from-the-command-line-cli/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 22:11:55 +0000</pubDate>
		<dc:creator>Kevin Pendleton</dc:creator>
		
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.utahsysadmin.com/2008/03/11/registering-solaris-10-from-the-command-line-cli/</guid>
		<description><![CDATA[All the mainstream Sun documentation on the Sun Connection or Update Manager expects the server to have a GUI, which I completely don&#8217;t understand.  As a matter of fact, their whole installation process is just as backwards and assumes the same thing.  They have a server package installation, and it installs GNOME, duh! [...]]]></description>
			<content:encoded><![CDATA[<p>All the mainstream Sun documentation on the Sun Connection or Update Manager expects the server to have a GUI, which I completely don&#8217;t understand.  As a matter of fact, their whole installation process is just as backwards and assumes the same thing.  They have a server package installation, and it installs GNOME, duh!  Anyway, you do a <a href="http://www.utahsysadmin.com/2008/03/11/minimal-install-of-solaris-10/" target="_blank">custom install</a> and check and uncheck all the little boxes and deal with all the dependency issues to install a normal server installation without a GUI.  But then, you want to be able to update your server to the latest patch levels, but you don&#8217;t have a GUI to register your system.  Well, I finally found the tech note that shows how to register from the command line.  Here&#8217;s how you do it:</p>
<blockquote><p>cp /usr/lib/breg/data/RegistrationProfile.properties /tmp<br />
vi /tmp/ RegistrationProfile.properties</p></blockquote>
<p>Fill in the appropriate settings, then run the following command:</p>
<blockquote><p>#  /usr/sbin/sconadm register -a -r /tmp/RegistrationProfile.properties<br />
sconadm is running<br />
Authenticating user &#8230;<br />
finish registration!</p></blockquote>
<p>Note:  If you can&#8217;t find  /usr/lib/breg/data/RegistrationProfile.properties, just create a file in /tmp with the following values (since it has your Sun Online password in it, make sure you set the file permissions to 400) :</p>
<blockquote><p>userName=<br />
password=<br />
hostName=<br />
subscriptionKey= (if you don&#8217;t include this you only get security updates)<br />
portalEnabled=false<br />
proxyHostName=<br />
proxyPort=<br />
proxyUserName=<br />
proxyPassword=</p></blockquote>
<p>Now you can update your system using the smpatch command which will download and install the updates for you:</p>
<blockquote><p># smpatch analyze<br />
119253-24 SunOS 5.10_x86: System Administration Applications Patch<br />
124631-15 SunOS 5.10_x86: System Administration Applications, Network, and Core Libraries Patch<br />
121431-22 SunOS 5.8_x86 5.9_x86 5.10_x86: Live Upgrade Patch<br />
119535-13 SunOS 5.10_x86: Flash Archive Patch<br />
119255-52 SunOS 5.10_x86: Install and Patch Utilities Patch<br />
125387-04 SunOS 5.10_x86: aac driver patch<br />
119813-07 X11 6.6.2_x86: Freetype patch<br />
127887-05 SunOS 5.10_x86: ipf patch<br />
126267-01 SunOS 5.10_x86: ibd patch<br />
126648-02 SunOS 5.10_x86: InfiniBand patch<br />
128029-04 SunOS 5.10_x86: e1000g patch<br />
&#8230;</p></blockquote>
<blockquote><p># smpatch update<br />
119253-24 has been validated.<br />
124631-15 has been validated.<br />
121431-22 has been validated.<br />
119535-13 has been validated.<br />
119255-52 has been validated.<br />
125387-04 has been validated.<br />
119813-07 has been validated.<br />
127887-05 has been validated.<br />
126267-01 has been validated.<br />
126648-02 has been validated.<br />
128029-04 has been validated.<br />
&#8230;<br />
Installing patches from /var/sadm/spool&#8230;<br />
119253-24 has been applied.<br />
124631-15 has been applied.<br />
NOTICE: Patch 121431-22 cannot be installed because it is typed as &#8220;interactive&#8221; which is prohibited by policy.<br />
119535-13 has been applied.<br />
119255-52 has been applied.<br />
NOTICE: Update 125387-04 cannot be applied at this time since it is typed as &#8220;single user&#8221; which is disallowed by installation policy.<br />
NOTICE: Patch 125387-04 cannot be installed until the next system shutdown.<br />
119813-07 has been applied.<br />
NOTICE: Update 127887-05 cannot be applied at this time since it is typed as &#8220;reboot immediate&#8221; which is disallowed by installation policy.<br />
NOTICE: Patch 127887-05 cannot be installed until the next system shutdown.<br />
126267-01 has been applied.<br />
126648-02 has been applied.<br />
128029-04 has been applied.<br />
&#8230;<br />
ID&#8217;s of the updates that are disallowed by installation policy have been<br />
written to file<br />
/var/sadm/spool/disallowed_patch_list</p>
<p>One or more updates that you installed requires a system shutdown to activate it. To initiate the system shutdown, you must use one of the following commands:<br />
o Drop to the firmware prompt - init 0 or shutdown -i 0<br />
o Power down the system - init 5 or shutdown -i 5<br />
o Restart the system - init 6 or shutdown -i 6</p></blockquote>
<p>Reboot to install additional patches (obviously during a maintenance window):</p>
<blockquote><p># init 6</p></blockquote>
<p>Here&#8217;s what you will see on the console during the reboot:<br />
<a href="http://www.utahsysadmin.com/wp-content/uploads/2008/03/console.jpg" title="Installing patches on the console"><br />
</a></p>
<p><a href="http://www.utahsysadmin.com/wp-content/uploads/2008/03/console.jpg" title="Patches on the console"><img src="http://www.utahsysadmin.com/wp-content/uploads/2008/03/console.jpg" alt="Patches on the console" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.utahsysadmin.com/2008/03/11/registering-solaris-10-from-the-command-line-cli/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
