<?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>Morgajel.net</title>
	<atom:link href="http://morgajel.net/feed" rel="self" type="application/rss+xml" />
	<link>http://morgajel.net</link>
	<description>Stemming the flow of evincible Ignorance. We must try to understand for the sake of understanding.</description>
	<lastBuildDate>Sun, 25 Jul 2010 20:48:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Revisited: Epson Perfection v350 on Ubuntu</title>
		<link>http://morgajel.net/2010/07/25/893</link>
		<comments>http://morgajel.net/2010/07/25/893#comments</comments>
		<pubDate>Sun, 25 Jul 2010 20:48:11 +0000</pubDate>
		<dc:creator>morgajel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://morgajel.net/?p=893</guid>
		<description><![CDATA[Jackie wanted me to reconfigure her scanner (since she hasn&#8217;t used it since I reloaded her system a while back) and I remembered what a pain it was to configure. A quick google search turned up the article I wrote three years ago, so I thought I&#8217;d do follow-up article to see what&#8217;s changed. Get [...]]]></description>
			<content:encoded><![CDATA[<p>Jackie wanted me to reconfigure her scanner (since she hasn&#8217;t used it since I reloaded her system a while back) and I remembered what a pain it was to configure. A quick google search turned up the <a href="http://morgajel.net/2007/09/02/219">article I wrote three years ago</a>, so I thought I&#8217;d do follow-up article to see what&#8217;s changed.</p>
<h2>Get the Drivers</h2>
<p>Since my last installation, things have changed. a bit. Many different <a href="http://avasys.jp/eng/linux_driver/download/">distros are now supported</a>, so we don&#8217;t have to shoehorn the RPMs onto the system with Alien. Here are the packages I grabbed off their site:<br />
<code><br />
iscan-data_1.0.1-1_all.deb<br />
iscan_2.25.0-1.ltdl7_i386.deb<br />
iscan-plugin-gt-f700_2.1.0-3_i386.deb<br />
</code></p>
<p>Once you have them, you can install them along with sane and sane utils:<br />
<code><br />
sudo dpkg -i iscan_2.25.0-1.ltdl7_i386.deb iscan-data_1.0.1-1_all.deb iscan-plugin-gt-f700_2.1.0-3_i386.deb<br />
sudo apt-get install sane sane-utils<br />
</code></p>
<h2>Edit the Configs</h2>
<p>Edit /etc/sane.d/dll.conf, adding <em>epkowa</em> to the list.</p>
<p>Create /etc/udev/rules.d/45-libsane.rules, adding the following:<br />
<code><br />
# Epson Perfection v350<br />
SYSFS{idVendor}=="04b8", SYSFS{idProduct}=="012f", MODE="664", GROUP="scanner"<br />
</code><br />
I use the group &#8220;scanner&#8221; above; You could go the easy route and use a group that you&#8217;re already part of, such as &#8220;users&#8221; or &#8220;admin&#8221;, otherwise you&#8217;ll have to create the scanner group, add yourself to it, then log out and log back in.</p>
<h2>Finishing Up</h2>
<p>Afterwards, connect your scanner and run the following command:<br />
<code><br />
scanimage -L<br />
</code></p>
<p>The scanner should fire up now, which means you can use your newly installed iscan app to scan pictures.</p>
]]></content:encoded>
			<wfw:commentRss>http://morgajel.net/2010/07/25/893/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Raw WinXP Virtualbox Partitions on a Thinkpad</title>
		<link>http://morgajel.net/2010/07/13/879</link>
		<comments>http://morgajel.net/2010/07/13/879#comments</comments>
		<pubDate>Tue, 13 Jul 2010 17:50:30 +0000</pubDate>
		<dc:creator>morgajel</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://morgajel.net/?p=879</guid>
		<description><![CDATA[New job, new laptop. Many utilities here are windows only, so it requires a bit of&#8230; effort&#8230; to get myself up and running efficiently. The solution to the windows problem is VirtualBox. I had set this up on my last laptop with little effort, but this time around required a bit more effort. Hopefully the [...]]]></description>
			<content:encoded><![CDATA[<p>New job, new laptop. Many utilities here are windows only, so it requires a bit of&#8230; effort&#8230; to get myself up and running efficiently. The solution to the windows problem is VirtualBox. I had set this up on my last laptop with little effort, but this time around required a bit more effort. Hopefully the instructions below will help others get up and running quickly.</p>
<p><strong>Disclaimer</strong>- your laptop may catch on fire and explode (or worse) if you attempt this&#8230; or something.</p>
<p>We&#8217;ll be presuming that you&#8217;ve already resized your windows partition and have both a working Windows and Linux partition.</p>
<h2>In Windows</h2>
<p>Log into XP, grab <a rel="nofollow" href="http://www.virtualbox.org/attachment/wiki/Migrate_Windows/MergeIDE.zip">MergeIDE.zip</a> from Virtualbox&#8217;s site, extract and run it. It should be a quick flash and be done. (Note: I am not 100% sure this step is needed)</p>
<p>Create a new hardware profile and name it <strong>virtualbox</strong>. Make sure to set it as a choice during boot. Try rebooting into native windows once to ensure that it does offer you profile options.</p>
<h2>In Linux</h2>
<p>You&#8217;ll need the following packages installed (May differ for non-ubuntu systems):<br />
<code>mbr, virtualbox-ose, virtualbox-ose-qt</code></p>
<p>Create a stand-alone mbr file to use for booting (yes, you need the force flag):</p>
<p><code>install-mbr ~/.VirtualBox/WindowsXP.mbr --force</code></p>
<p>We&#8217;re presuming that your windows partition is /dev/sda1. In the below command, we are defining</p>
<ul>
<li>a vmdk file (WindowsXP.vmdk)</li>
<li>which raw disk to read (/dev/sda)</li>
<li>which partition (1)</li>
<li>the new MBR file we just created</li>
</ul>
<p><code>VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/WindowsXP.vmdk -rawdisk /dev/sda -partitions 1 -mbr ~/.VirtualBox/WindowsXP.mbr -relative -register</code></p>
<p>Note that you&#8217;ll need read/write access to that drive as your user, so you may want to figure out a cleaner/securer way to implement this, rather than adding your user to the disk group (which is very dumb and insecure). I would, but it&#8217;s working and I have more important things to do at the moment.</p>
<p>Another issue- apparently thinkpads report the <a href="http://ubuntuforums.org/showthread.php?p=6716355">drive heads and cylinders oddly</a> (T410 for me and T60p in article), so we have to add some vmdk settings before virtualbox creates them incorrectly. Open ~/.VirtualBox/WindowsXP.vmdk and add the following at the bottom:<br />
<code><br />
ddb.geometry.biosCylinders="1024"<br />
ddb.geometry.biosHeads="240"<br />
ddb.geometry.biosSectors="63"<br />
</code><br />
The biosHeads appears to be the magic value- it seems to work if it&#8217;s set to 240, but the default is 255 (which fails).</p>
<p>Once you add those, start up virtualbox and check the virtual media manager, your new vmdk should be listed there. Once it&#8217;s confirmed, create a new virtual machine. Rather than creating a disk, select your vmdk as an existing disk.</p>
<p>After you finish, go the the VM settings-&gt;system and make sure the motherboard tab as io-apic  enabled (I also had PAE/NX enabled under processor and VT-x enabled under Acceleration).</p>
<h2>Start the VM</h2>
<p>There are several errors that could pop up. I&#8217;m sure there are plenty more that I stumbled across, but these were the two big ones:</p>
<ul>
<li><strong>a disk read error occurred, press ctrl+alt+del to restart </strong>- Caused by incorrect biosHeads- check and make sure it&#8217;s set to 240 (this was the fix for me, results may vary).</li>
<li><strong>Complaint about kvm/vmx</strong> &#8211; Virtualbox does not like kvm. Uninstall qemu-kvm.</li>
</ul>
<p>If things go well, it should flicker mbr in the corner, then go to the hardware profile selection screen. Select the virtualbox profile, and continue, then log in.</p>
<p>What follows is a half-hour of installing generic drivers and dealing with hardware specific auto start apps complaining that they won&#8217;t work on this installation. Windows will warn that the new drivers are not blessed, so be forewarned.</p>
<p>Once completed, at the top of the VM windows select Devices-&gt; Install Guest Additions. This will download and mount an ISO, and windows will pop open a folder with the addition executables. Select the one best for you and run the installer. It will prompt you for video and mouse drivers (and trust me, you want them).</p>
<p>The final step is to shut down the windows VM, then reboot into the native windows partition to make sure it still works.  I did receive a few blue-screens before logging in at the beginning, but they appeared random and haven&#8217;t happened since.</p>
<p>And that&#8217;s all there is to it- simple, eh? Your windows partition should now run in native mode and vm mode.</p>
]]></content:encoded>
			<wfw:commentRss>http://morgajel.net/2010/07/13/879/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Philosophy of Monitoring</title>
		<link>http://morgajel.net/2010/06/30/755</link>
		<comments>http://morgajel.net/2010/06/30/755#comments</comments>
		<pubDate>Thu, 01 Jul 2010 03:01:45 +0000</pubDate>
		<dc:creator>morgajel</dc:creator>
				<category><![CDATA[Hobbies]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[administration]]></category>

		<guid isPermaLink="false">http://morgajel.net/?p=755</guid>
		<description><![CDATA[As a system administrator, monitoring is a key job responsibility, yet arguments seem to arise on how to implement it (usually with people who won't be paged at 3am). Before writing this, I looked around for an article on the goals and philosophy of system monitoring, but found very little that really applied to this topic. Hopefully this will help set some expectations for admins, managers and stakeholders on what you should monitor, and why it should be monitored.]]></description>
			<content:encoded><![CDATA[<p>As a system administrator, monitoring is a key job responsibility, yet arguments seem to arise on how to implement it (usually with people who won&#8217;t be paged at 3am). Before writing this, I looked around for an article on the goals and philosophy of system monitoring, but found very little that really applied to this topic. Hopefully this will help set some expectations for admins, managers and stakeholders on what you should monitor, and why it should be monitored.</p>
<h2>Why you Monitor</h2>
<p>Before you set up a single monitor, you have to ask yourself, &#8220;<em>what is the goal</em>?&#8221;  After all, why are you even setting something up? Here a few common reasons for configuring monitors:</p>
<ol>
<li><strong>Notification: </strong>Warning of an issue that requires intervention. What most people think of when you say &#8220;Monitoring&#8221;.</li>
<li><strong>Reactionary: </strong>Automatic actions are taken when certain criteria are met. If common countermeasures are automated, you&#8217;ll have less to handle manually.</li>
<li><strong>Informational: </strong>System status and historical trending allows you to show business customers that production &#8220;isn&#8217;t always down.&#8221; In reality,  you may have 99% uptime, and often downtime is due to requested deployments. Statistical information can also be used for capacity planning.</li>
</ol>
<p>Mentally dividing your monitors into groups will help you calculate which monitors require involvement. It&#8217;s not uncommon to have several thousand monitors at any given time, so it&#8217;s important not to assign critical importance to all of them. A wise man once said &#8220;When all alerts are critical, none of them are.&#8221;</p>
<h2>When you should NOT Notify</h2>
<p>Some monitors may have thresholds set which check for certain conditions; when those conditions are met, you may want to send some type of alert to an administrator. There are two types of notifications &#8211; Active and Passive:</p>
<ul>
<li><strong>Active Notification: </strong>Immediate Action is Required: &#8220;Site is Down!&#8221; A phone call, page, or IM may be used to contact someone. Direct action expected.</li>
<li><strong>Passive Notification: </strong>Informational Purposes only:  &#8220;JVM Memory usage is high.&#8221; Information is logged, and perhaps an email is sent. No direct action is expected.</li>
</ul>
<p>It&#8217;s easy to become addicted to passive notifications &#8211; but remember, data overload can mask important information. It becomes habit to ignore notifications if they are unimportant. The question then is not so much &#8220;when should you notify,&#8221; but &#8220;when shouldn&#8217;t you?&#8221; What it really boils down to is &#8220;Can/should I do anything about it right now?&#8221;</p>
<ul>
<li>Non-critical (disk space creeps above  90%  on /var on a dev server at 2am on a Saturday after several months of growth).</li>
<li>Nothing Systemic is wrong (admins can&#8217;t fix &#8220;low sales&#8221;).</li>
<li>3rd party system, such as a geocoding webservice, is down.</li>
<li>Will resolve shortly, such as a backup server pegging the CPU during midnight backups.</li>
</ul>
<p>Some of these alerts can be avoided by setting a correct monitoring window (ignore CPU during the backup window). Others simply can&#8217;t be addressed by administrators, although you may want to send informational emails to other members of the company (those managing 3rd party SLAs or responsible for tracking online sales).  The next step after getting an alert is figure out what to do about it.</p>
<h2>Reacting Properly</h2>
<p>When a notification is sent out, there should be a definitive action that you can take. Think about why you were notified. There are a few rules to keep in mind when something goes wrong.</p>
<ol>
<li style="margin-bottom: 10px;"><strong>Don&#8217;t Panic. </strong> When 100 alarms go off, your first instinct is to panic. Before you act, take a breath. Spend a moment to get your bearings, and calm yourself. The worst possible thing you can do is flail. Randomly  making changes without rhyme or reason and restarting services can do  more harm than good and may make the situation worse.</li>
<li style="margin-bottom: 10px;"><strong>Identify Obvious Patterns. </strong> What is the commonality? If a central system goes down, you may see many similar alerts. Dependencies can help immensely, masking redundant alerts. A single database failure could take down a dozen sites. Which is better: getting a single alert that the database is down, or 250 alerts that various sites are down and one database notification in the middle? While 250 alerts may impress the gravity of the situation upon you, it may instill panic and anxiety, which leads to flailing.</li>
<li style="margin-bottom: 10px;"><strong>Get things up and running as quickly as possible. </strong> Root-cause analysis can be tedious, time consuming, and occasionally inconclusive. If you have a major system outage, don&#8217;t worry about doing root-cause analysis on the spot.  Do what you need to in order to get things up and running &#8211; you can search the logs later. If the problem is recurring, you&#8217;ll get another chance to investigate later.</li>
<li style="margin-bottom: 10px;"><strong>Communicate with Stakeholders. </strong> The business units don&#8217;t need to know the details, but they do need to know that there is an outage and that it&#8217;s being addressed. If the situation is not quickly resolved, give them status reports. Be warned &#8211; any details you reveal will be warped and held against you. I&#8217;ve learned this one many times. People have a tendency to blame what they don&#8217;t understand. &#8220;Site is down? It must be a witch!&#8221; At my last job we had a &#8220;jump to conclusions&#8221; board which had our favorite scapegoats &#8211; load balancer, connection pool, Endeca, etc. Everyone is guilty of it &#8211; Business, devs, sysops, QA, etc. Even a one-time problem that has been resolved will be brought back up, even if it&#8217;s only tangentially related. Communicating too much information creates future scapegoats.</li>
<li style="margin-bottom: 10px;"><strong>Contact Domain Experts. </strong> If your java site is crashing and you&#8217;re not a java developer, get a java developer involved. If your DNS server falls down and the fix isn&#8217;t obvious, contact your DNS administrator. Expert eyes on the problem may resolve it quicker. Group chat is crucial for sharing information and talking out theories. Someone familiar with the code will know what the error messages mean.</li>
<li style="margin-bottom: 10px;"><strong>Fix the Problem. </strong> It should go without saying that if you find the problem, you should make every effort to resolve it. Workarounds are fine, just don&#8217;t let that band-aid become permanent. What often happens is a workaround is put in place; the alert clears and management no longer feels the pain, so they ignore the problem without putting forth the effort to fix the issue. When the next issue appears, a new fix is layered on the old. Band-aid is layered on band-aid.  Eventually you&#8217;ll need to pull those band-aids off; and the more there are, the more painful it will be.</li>
</ol>
<h2>How Much is Too Much?</h2>
<p>Most administrators prefer to be proactive rather than reactive, resolving issues before they become a problem. Proper monitoring can be a great asset, but if you&#8217;re not careful it can cause problems. For example, at a previous job we had a load balancer, apache instances and tomcat instances set up for each site. Each site had the following:</p>
<p><strong>In (Sitescope) legacy monitoring system:</strong></p>
<ul>
<li>Health check on load balancer URL</li>
</ul>
<p><strong>In Nagios:</strong></p>
<ul>
<li>Health check on Apache instances</li>
<li>Health check on Tomcat instances</li>
<li>Health check on Load balancer URL</li>
</ul>
<p><strong>In Apache:</strong></p>
<ul>
<li>Health check on tomcat instances</li>
</ul>
<p><strong>In Load balancer:</strong></p>
<ul>
<li>Health check on Apache instances</li>
<li>Health check on Tomcat instances</li>
</ul>
<p>Individually, these don&#8217;t seem that bad. If an apache instance goes down *of course* the load balancer needs to know so it won&#8217;t send traffic to that instance. The same with Apache watching Tomcat. The problem was the frequency of the checks; the load balancer was checking each monitor every five seconds. When a poorly load-tested site update was released, certain pages took 7 seconds to load. Things quickly went downhill as threads and processes backed up, crashing the site.</p>
<p>Balancing responsiveness with common sense is essential. Having a monitor check every minute won&#8217;t change the fact that it will take an admin 20 minutes to get to a computer, boot up, log into the VPN, and identify the issue. Don&#8217;t add to the problem by DOS&#8217;ing your applications.</p>
<h2>Making Contact</h2>
<p>One mistake I&#8217;ve seen is using email as a reliable and immediate method of contact, often expecting a quick response. My favorite is when someone sends you and email, then walks down to your desk immediately after and asks &#8220;did you see my email?&#8221; You check and see it was sent literally less than two minutes ago. People don&#8217;t reliably check their email. Admins especially don&#8217;t due to the sheer volume we receive.</p>
<p>Email has it&#8217;s uses, but active contact in an emergency situation is not one of them. Personally, I only check my email when I think about it, which may mean large delays between when the message is sent and received. Couple that with spam filters, firewalls, solar flares and the 500 other unread messages and email becomes a less-than-reliable medium for emergency notifications (even during business hours).</p>
<p>Paging (or SMS)  is preferable if you expect a quick response, although it is far from perfect. Just like email, SMS messages can be lost in the ether, however recipients usually have their phone alert them when a message comes in since it happens far less often than an email drops into the inbox. That said, every alert should not be sent as a page, or apathy will quickly sink in. The escalation path should look something like this (although all steps are not needed):</p>
<ul>
<li><strong>Front-end web interface alert:</strong> User would have to actively be browsing to see the status change. Usually the first clue something is wrong and shows the most recent status changes on a dashboard.</li>
<li><strong>Email Alert: </strong>User would have to be actively checking their email. Usually sent when something is first confirmed down.</li>
<li><strong>Instant Message:</strong> User would have to be at a computer and logged into IM to receive the alert. Rarely used, but an option during business hours.</li>
<li><strong>Page/SMS:</strong> Reserved for emergencies. This means there is trouble.</li>
<li><strong>Phonecall:</strong> Only used if Admin does not respond to the previous contact attempts. Usually performed by an irate manager.</li>
</ul>
<p>If you&#8217;re lucky enough to have a 24&#215;7 call center/ help desk, they can also be leveraged to resolve issues before a system administrator is needed. If recurring patterns start to emerge,  automation can be used to deal with the problem (or better yet you can fix the underlying issue). Sadly, many issues can&#8217;t be automated away or solved by a call-center staffer pressing a button. A real admin will eventually need to be contacted.</p>
<p>I don&#8217;t want to dig too deeply into on-call rotations, but an effort should be made to balance off-hours support with a personal life.  Being on-call means no theaters, fancy dinners, or quality time with the family. Without balance, burn out will ensue.</p>
<h2>Afflictions</h2>
<p>System monitoring often brings out odd behavior in even the most steadfast of administrators. Some behaviors are relatively benign, while others can cause severe problems down the road. Identifying these behaviors before they cause a problem is just as important as having good monitors.</p>
<ul>
<li style="margin-bottom: 10px;"><strong>Data Addiction: </strong> Knowledge is power, but do not mistake information with knowledge. It&#8217;s possible to have 700 alerts, and not one of them identify the underlying issue. One of my least favorite phrases is &#8220;Can we put a monitor on that?&#8221; It&#8217;s often uttered right after a one-off failure; the type of thing that fails once, and once fixed will never cause a problem again. An example of this is a new server, where apache was not configured to restart after a reboot. When the server is restarted, you quickly find apache is down, start it, configure it to auto-start, and move on. There is already a monitor on the websites hosted by that apache instance as well as a monitor on how many apache threads are currently running; What purpose would another monitor serve? How often would it run? This is a prime example of how a data addict can spin out of control &#8211; too many useless monitors will mask a more important issue.</li>
<li style="margin-bottom: 10px;"><strong>Over Automation: </strong> Automation is a wonderful thing, however, it&#8217;s possible to have too much of a good thing. In one instance, there was a coldfusion server which would crash often. Rather than trace out the root cause, restarts were automated, then forgotten about. A few years later, it was found that the coldfusion servers were restarting every twenty minutes, and no one knew about it &#8211; no one except the users. If it takes 20 seconds to restart, and that&#8217;s 26280 twenty-second interrupts over the course of a year &#8211; that can translate into a bad user experience and loss of sales. Make sure that automation is audited and verifiable, and doesn&#8217;t cause more trouble than it prevents.</li>
<li style="margin-bottom: 10px;"><strong>Over Communication: </strong> While it is important to communicate with stakeholders, it is possible to over communicate.  Stakeholders don&#8217;t need to know that there are 130 defunct apache processes caused by a combination of a bug in mod_jk and the threading configuration in JBoss &#8211; all they need is &#8220;Site availability is intermittent &#8211; we&#8217;ve located the root cause and are working on a solution. More information to follow.&#8221; Details aren&#8217;t needed. Likewise, not every single person should be notified when an alert goes off &#8211; does your backup administrator need to know when a web server goes down? No. Does the DBA need to know when an SSL cert is about to expire? No. Tailor the messages to the correct audience. Most monitoring systems allow you to configure  contact groups &#8211; use them.</li>
<li style="margin-bottom: 10px;"><strong>Complexification: </strong> There are dozens of relationships between services, hosts, hostgroups, contacts, servicegroups, notification windows, dependencies, parents, etc. Try as you might, it&#8217;s usually impossible to perfectly model every relationship. Don&#8217;t become distracted by perfecting the configuration &#8211; focus on maintainability, scalability and accuracy. If you can&#8217;t add new systems and monitors, your configuration is too complex.</li>
<li style="margin-bottom: 10px;"><strong>Reporting vs Monitoring: </strong> Reports are the more successful cousin of Alerts. They may superficially appear similar, but serve entirely different purposes. Monitors should only be used to track and trend data and to notify if there is a problem, whereas reports take the collected data and massage it into an aggregated format. Monitors shouldn&#8217;t send out scheduled alerts. They can collect data, but they shouldn&#8217;t be used to present it to users. You&#8217;d be surprised how often someone asks for a monitor to send a nightly report. That slippery slope will turn your monitoring system into crystal reports.</li>
<li style="margin-bottom: 10px;"><strong>False Positives: </strong> False positives are the scourge of the monitoring world. There are many causes, but the reaction is always the same &#8211; start to investigate, realize that it&#8217;s a false positive, and lose interest, knowing that nothing is broken. The problem is that a false positive leads to lazy behavior &#8211; if you&#8217;re pretty sure it&#8217;s a false positive, you don&#8217;t bother looking into it, figuring it will clear on it&#8217;s own. This trains people to have a &#8220;wait and see&#8221; mentality when alerts go off, causing unneeded delays when a major issue appears.</li>
<li style="margin-bottom: 10px;"><strong>Apathy: </strong> It&#8217;s 2am on a Saturday, and you get paged that the CPU on a utility server is pegged. Without looking, you know that it&#8217;s the backup process copying the home directories, so you ignore it. The following Monday at 10am the QA JBoss instance stops responding. You know that it will clear within minutes because the QA team always rebuilds the QA instance Monday morning.  When you get monitors constantly failing and recovering on their own, you start to ignore the pages that come in because you know they&#8217;re unimportant. It&#8217;s only a matter of time before you miss something important. If you have a situation that promotes apathy towards alerts, resolve it before something important is missed.</li>
</ul>
<h2>Don&#8217;t be [A]pathetic</h2>
<p>I mentioned apathy above, but there&#8217;s a bit more to it &#8211; it&#8217;s not just admins that become apathetic.  If an issue is identified, action must be taken to correct it. The coldfusion example mentioned above is a great example of  company apathy &#8211; failure of the business unit to prioritize it and failure of IT to push back hard enough.  A former manager once had someone laugh because his team had ignored my manager&#8217;s bug report for a full year.  That&#8217;s not funny; it&#8217;s pathetic.</p>
<p>When management fails to address an issue; be it a known system problem or something as simple as morale from a lost team member, it shows the team that they don&#8217;t care. It soon becomes a vicious cycle of uncaring when managers no longer care that the site is down, which in turn causes developer apathy.  Developers then don&#8217;t care about code quality, leading to buggy code. Sysops stop caring that alerts are going off, leading to downtime. By the time the cycle is broken, it&#8217;s far too late &#8211; you&#8217;ve established a bad reputation with your customers.</p>
<p>Often times this will start with unreasonable development expectations, causing devs to cut corners, QA to be rushed, and monitors to be forgotten. There is a balance that must be maintained between getting code out the door and making sure that the code can stand up to the abuse it will receive when it goes live.  It&#8217;s a team effort, and everyone must care (and keep caring) to keep the systems running.</p>
<p>Wow. Well, that&#8217;s a lot more than I intended on writing. I should state that I am guilty of 75% or more of the bad behaviors listed here. I hope that this will help start discussion on how to better improve monitoring systems.</p>
<p>If you have feedback, suggestions or enhancements, please leave them in the comments.</p>
<p>(Thanks to jdrost, jslauter, keith4, pakrat, romaink, and my wife Jackie for their peer review/editing.)</p>
]]></content:encoded>
			<wfw:commentRss>http://morgajel.net/2010/06/30/755/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Useful Utility: less</title>
		<link>http://morgajel.net/2010/06/25/64</link>
		<comments>http://morgajel.net/2010/06/25/64#comments</comments>
		<pubDate>Fri, 25 Jun 2010 15:00:29 +0000</pubDate>
		<dc:creator>morgajel</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Utility]]></category>

		<guid isPermaLink="false">http://morgajel.net/?p=64</guid>
		<description><![CDATA[Less is more. That&#8217;s the common joke about less- It provides the same functionality as the older utility, more; but oh, how much more than more! Less allows you to easily scan backwards as well as forwards- something more is not too good at (though it is possible). Less also allows you to navigate with [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Less is more.</p></blockquote>
<p>That&#8217;s the common joke about less- It provides the same functionality as the older utility, more; but oh, how much more than more!</p>
<p>Less allows you to easily scan backwards as well as forwards- something more is not too good at (though it is possible). Less also allows you to navigate with arrow keys, page up and page down, home and end.</p>
<p>Less provides a quick way to view files as well- Many editors (like vim) need to read an entire file first, and often create a temporary copy (for editing) of the file. This isn&#8217;t a problem until you try to browse a 56 gig log file of a rabid JBoss instance- if your root directory isn&#8217;t large enough, chaos ensues. Less circumvents this by only loading a page at a time. Yes- searches do take longer, but it beats crashing a system.</p>
<h3>Useful Commands:</h3>
<ul>
<li><strong>R</strong>: Repaints the screen, rereading the file from the disk. useful if the file is constantly changing (like a logfile)</li>
<li><strong>/ and ?</strong>: Just like in vim, used for searching forwards and backwards </li>
<li><strong>g and G</strong>: Jumps to the top or bottom of the file, just like vim</li>
<li><strong>:n and :p</strong>: Jump to the next/previous file (if you pass less more than one file)</li>
<li><strong>q</strong>: quits. slightly important</li>
<li><strong>! [cmd]</strong>: runs a given command outside of less- useful if you can&#8217;t remember the output of another command and need a quick reminder (ifconfig, tail, route, ls, etc)</li>
</ul>
<h3>Useful Flags:</h3>
<ul>
<li>-N: Shows line numbers</li>
<li>-s: squeeze adjacent blank lines into one</li>
<li>-R: shows raw control characters, a.k.a. &#8220;turns color on!&#8221;</li>
</ul>
<p>As usual, there are dozens of more options, flags, variables and behavior- you&#8217;d be surprised what less can do for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://morgajel.net/2010/06/25/64/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Updated to 3.0</title>
		<link>http://morgajel.net/2010/06/18/752</link>
		<comments>http://morgajel.net/2010/06/18/752#comments</comments>
		<pubDate>Fri, 18 Jun 2010 16:07:57 +0000</pubDate>
		<dc:creator>morgajel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://morgajel.net/?p=752</guid>
		<description><![CDATA[Now lets see what breaks&#8230;]]></description>
			<content:encoded><![CDATA[<p>Now lets see what breaks&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://morgajel.net/2010/06/18/752/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dear Cyberhomes.com</title>
		<link>http://morgajel.net/2010/06/02/729</link>
		<comments>http://morgajel.net/2010/06/02/729#comments</comments>
		<pubDate>Thu, 03 Jun 2010 01:57:50 +0000</pubDate>
		<dc:creator>morgajel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://morgajel.net/?p=729</guid>
		<description><![CDATA[Some day I hope you&#8217;ll join us in the future, where websites don&#8217;t fail miserably for having the wrong user-agent string. Here&#8217;s the problem- I go to check my home value at cyberhomes only to receive the following message on every single page: Your browser is not supported. We do not support your browser yet&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Some day I hope you&#8217;ll join us in the future, where websites don&#8217;t fail miserably for having the wrong user-agent string. Here&#8217;s the problem- I go to check my home value at cyberhomes only to receive the following message on every single page:</p>
<blockquote><p>Your browser is not supported.</p>
<p>We do not support your browser yet&#8230;</p>
<p>If you are on a Windows machine please use:<br />
    * Internet Explorer 6 and up<br />
    * Firefox 1.5 and up<br />
    * Safari Beta 3 and up</p>
<p>If you are on a Mac please use:<br />
    * Safari<br />
    * Firefox 1.5 and up</p>
<p>Your current browser is Mozilla 1.9.2.5
</p></blockquote>
<p>There are several problems with this:</p>
<ol>
<li> I am using firefox 1.5 and up, specifically, <code>"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.5pre) Gecko/20100501 Ubuntu/9.10 (karmic) Namoroka/3.6.5pre"</code> I can only presume that since it doesn&#8217;t say &#8220;firefox&#8221;, it fails.</li>
<li>You&#8217;re parsing my connection string wrong-1.9.2.5 is related to my profile version, not browser version. Don&#8217;t do that.</li>
<li>Even after I change my connection string to Firefox/1.5, it STILL fails. The error message says Windows or Mac; maybe it&#8217;s failing because it is looking for one or the other.</li>
<li>The site is completely useless if that page comes up- no contact info to report a problem, nothing. I can&#8217;t even tell you that you&#8217;re accidentally blocking me.</li>
</ol>
<p>I end up having to use the following connection string:<br />
    <code>"Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8"</code><br />
and the sad part was YOUR SITE LOOKED FINE. This kind of ungraceful degradation irritates the hell out of many people. If you don&#8217;t support my browser, I get it- you don&#8217;t want to give people a bad experience. You know what you do rather than make the site completely useless? You pop up a little window saying:</p>
<blockquote><p>
Sorry, we do not support your browser yet&#8230;</p>
<p>For better browsing experience, we suggest you try the following:<br />
If you are on a Windows machine please use:<br />
    * Internet Explorer 6 and up<br />
    * Firefox 1.5 and up<br />
    * Safari Beta 3 and up</p>
<p>If you are on a Mac please use:<br />
    * Safari<br />
    * Firefox 1.5 and up</p>
<p>Your current browser is Mozilla 1.9.2.5<br />
                                                      [x] continue anyways&#8230;
</p></blockquote>
<p>Note that the little [x] is a close button- VERY important on a warning like that. This allows the users to continue on viewing your website on the off chance that you accidentally mislabeled them.</p>
<p>This is 2010. This is the future. An issue like this was annoying back in 1998- there&#8217;s no reason a pretty site like yours should be doing this. Get with the program.</p>
<p>Sincerely,<br />
- Jesse</p>
]]></content:encoded>
			<wfw:commentRss>http://morgajel.net/2010/06/02/729/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Port Conventions</title>
		<link>http://morgajel.net/2010/05/14/717</link>
		<comments>http://morgajel.net/2010/05/14/717#comments</comments>
		<pubDate>Sat, 15 May 2010 01:23:03 +0000</pubDate>
		<dc:creator>morgajel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://morgajel.net/?p=717</guid>
		<description><![CDATA[Over the past few years I&#8217;ve been doing a lot of work with JBoss and tomcat. One issue we&#8217;ve always had is bringing some level of sanity to ports that are in use. My current situation is somewhat abnormal; we have 12 applications, each with two instances, each with 7 ports- that&#8217;s a total of [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few years I&#8217;ve been doing a lot of work with JBoss and tomcat. One issue we&#8217;ve always had is bringing some level of sanity to ports that are in use. My current situation is somewhat abnormal; we have 12 applications, each with two instances, each with 7 ports- that&#8217;s a total of 168 ports that we need to keep track of. Now, multiply that by tomcat, apache and nagios&#8217; configurations. Now multiply that by Dev, QA, ITL, PRJ, Preprod and Prod environments on segregated hardware. Even though a LOT of these ports can overlap, that&#8217;s a LOT to keep track of in a flat file or spreadsheet. We also require a certain level of flexibility:</p>
<ol>
<li>Port Expansion: I mentioned there were 7 ports we use; originally there were only 6, but I enabled SNMP to better trend JVM usage (24 JVMs use a <em>lot</em> of RAM). As we add more features, more ports could be needed.</li>
<li>Application Expansion: We originally started out with 9 instances, and after 5 months added another three. More will be possible in the future.</li>
</ol>
<p>The required flexibility makes numbering conventions difficult. The solution we came up with is to key the information and use it to build the port number. In order to do that, we had to make a few assumptions:</p>
<ol>
<li>Environments are sequestered to their own hardware, however they&#8217;re on the same networks- i.e. dev and qa instances will never be on the same physical server, but will share multicast ranges</li>
<li>There will not be more than 5 instances in a cluster- any more than that would put theoretical ports out the 65536 range; besides, replication shouldn&#8217;t be past 4 nodes, right?</li>
<li>Ports below 1024 are off limits</li>
<li>We are constrained by IP addresses; one IP per server.</li>
</ol>
<p>From here we could allow the following constraints:</p>
<ol>
<li>Environments can use the same ports, EXCEPT for multicast- we don&#8217;t want QA and prod replicating data!</li>
<li>All multicast should use 1 for their Instance ID</li>
</ol>
<p>With that in mind, port numbers will be laid out with the following structure: <b>XYYZZ</b></p>
<p>X = Instance ID (e.g. 1-4)<br />
YY = application ID (Helium,Hydrogen,Lithium, etc )<br />
ZZ = Port Type (jmx, ajp, snmp, etc)</p>
<p><code><br />
1 Instance1<br />
2 Instance2<br />
3 Instance3<br />
4 Instance4<br />
</code></p>
<p><code><br />
01 Hydrogen<br />
02 Helium<br />
03 Lithium<br />
04 Beryllium<br />
05 Boron<br />
06 Carbon<br />
07 Nitrogen<br />
08 Oxygen<br />
09 Fluorine<br />
10 Neon<br />
11 Sodium<br />
12 Magnesium<br />
</code></p>
<p><code><br />
01 Shutdown<br />
02 JMX<br />
03 HTTP<br />
04 AJP<br />
05 SNMP<br />
06 REPL<br />
07 MCASTDEV<br />
08 MCASTQA<br />
09 MCASTUAT<br />
10 MCASTPREPROD<br />
11 MCASTPROD<br />
</code></p>
<p>This allows us to define the following:</p>
<ul>
<li>Hydrogen AJP for instance 1 is 10104 (1+01+04)</li>
<li>Oxygen SNMP for instance 4 is 40805 (4+08+05)</li>
<li>Sodium Multicast for Prod 3 is 11111 (1+11+11) (remember, all multicast use 1 for their instance)</li>
</ul>
<p>Other than the Multicast port kludge, this way seems to work pretty well. Numbers are easy to parse visually and can be maintained with a centralized key on the wiki. Anyone have any suggestions or examples of how they&#8217;ve solved this problem? </p>
]]></content:encoded>
			<wfw:commentRss>http://morgajel.net/2010/05/14/717/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios LDAP Contact Creator Script</title>
		<link>http://morgajel.net/2010/05/12/701</link>
		<comments>http://morgajel.net/2010/05/12/701#comments</comments>
		<pubDate>Wed, 12 May 2010 20:04:40 +0000</pubDate>
		<dc:creator>morgajel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://morgajel.net/?p=701</guid>
		<description><![CDATA[The Following is an ugly little perl script I&#8217;ve whipped up for generating contact entries for Nagios; each file is read via a cfg_dir command in the nagios.cfg. This script is set to run nightly, capturing any new users and updating users and groups automagically. Let me know if you find it useful. &#160; #!/usr/bin/perl [...]]]></description>
			<content:encoded><![CDATA[<p>The Following is an ugly little perl script I&#8217;ve whipped up for generating contact entries for Nagios; each file is read via a cfg_dir command in the nagios.cfg. This script is set to run nightly, capturing any new users and updating users and groups automagically.</p>
<p>Let me know if you find it useful.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #666666; font-style: italic;"># read your ldap repo and generation nagios config files for contacts</span>
<span style="color: #666666; font-style: italic;"># and contact_groups</span>
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Net<span style="color: #339933;">::</span><span style="color: #006600;">LDAP</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Data<span style="color: #339933;">::</span><span style="color: #006600;">Dumper</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Set all your custom configs here:</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$ldaphostname</span><span style="color: #339933;">=</span><span style="color: #ff0000;">'ldap.example.int'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$groupdn</span><span style="color: #339933;">=</span><span style="color: #ff0000;">'ou=People,ou=Groups,dc=example,dc=int'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$peopledn</span><span style="color: #339933;">=</span><span style="color: #ff0000;">'ou=People,ou=active,ou=Users,dc=example,dc=int'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$contactdir</span><span style="color: #339933;">=</span><span style="color: #ff0000;">'/etc/nagios/contacts'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$ldap</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Net<span style="color: #339933;">::</span><span style="color: #006600;">LDAP</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ldaphostname</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ldap</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;failed to bind&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#search for groups</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$mesg</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ldap</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">search</span><span style="color: #009900;">&#40;</span>
        base <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$groupdn</span><span style="color: #339933;">,</span>
        filter <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;(objectclass=posixgroup)&quot;</span><span style="color: #339933;">,</span>
        attrs <span style="color: #339933;">=&gt;</span> <span style="color: #009900;">&#91;</span><span style="color: #ff0000;">'cn'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'memberuid'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#loop through each entry</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$group</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">$mesg</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">pop_entry</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">#set the name of the group</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cn</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$group</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">get_value</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'cn'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">#create a comma-separated list of group members</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$members</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$group</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">get_value</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'memberuid'</span><span style="color: #339933;">,</span> asref <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$members</span><span style="color: #339933;">=</span> <span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">','</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">@$members</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># create our configuration block</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$contactinfo</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;
        # We only have one contact in this simple configuration file,
        # so there is no need to create more than one contact group.
&nbsp;
        define contactgroup{
            contactgroup_name       $cn
            alias                   $cn
            members                 $members
            }<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># write this block to a file named after the group cn</span>
    <span style="color: #000066;">print</span> <span style="color: #ff0000;">`echo &quot;$contactinfo&quot; &gt; $contactdir/group_$cn.cfg`</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#search for users</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$mesg</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ldap</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">search</span><span style="color: #009900;">&#40;</span>
            base <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$peopledn</span><span style="color: #339933;">,</span>
            filter <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;(objectclass=person)&quot;</span><span style="color: #339933;">,</span>
            attrs <span style="color: #339933;">=&gt;</span> <span style="color: #009900;">&#91;</span><span style="color: #ff0000;">'uid'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'cn'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'mail'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'description'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
           <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#loop through each entry</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$user</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">$mesg</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">pop_entry</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$pager</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$addr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;"># grab the four fields we're interested in</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$uid</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">get_value</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'uid'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cn</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">get_value</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'cn'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$mail</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">get_value</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'mail'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$desc</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">get_value</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'description'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Note that I store the user's SMS address and Instant Messenger</span>
<span style="color: #666666; font-style: italic;"># addresses in the description field in the following format:</span>
<span style="color: #666666; font-style: italic;"># SMS:1234445555@some.url;</span>
<span style="color: #666666; font-style: italic;"># IM:morgajel@yahoo,morgajel@gtalk;</span>
<span style="color: #666666; font-style: italic;"># for those interested, you can send email to an sms address </span>
<span style="color: #666666; font-style: italic;"># with help from &lt;a href=&quot;http://sms411.net/how-to-send-email-to-a-phone&quot;&gt;http://sms411.net/how-to-send-email-to-a-phone&lt;/a&gt;</span>
    <span style="color: #666666; font-style: italic;">#strip pager info out of desc and format it</span>
    <span style="color: #666666; font-style: italic;">#(note it's in sms format):</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$desc</span> <span style="color: #339933;">=~/</span>SMS<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">^;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;?/</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #0000ff;">$pager</span><span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;        pager           $1<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #666666; font-style: italic;"># strip addresses out of desc and format them:</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$desc</span> <span style="color: #339933;">=~/</span>IM<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">^;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;?/</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@multiple_addr</span><span style="color: #339933;">=</span><span style="color: #000066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/,/</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$count</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;"># break each address out into an addressX line</span>
        <span style="color: #666666; font-style: italic;"># (for informational purposes);</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$addr</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@multiple_addr</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #0000ff;">$addr</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$addr</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;        address$count        $addr<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #0000ff;">$count</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$count</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">#generate the first half of the contact info</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$contactinfo</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;
    define contact{
        contact_name    $uid              ; Short name of user
        use             generic-contact
        alias           $cn               ; Full name of user
        email           $mail
$pager
$addr
    }&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># write this block to a file named after the user uid</span>
    <span style="color: #ff0000;">`echo &quot;$contactinfo&quot; &gt; $contactdir/$uid.cfg`</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://morgajel.net/2010/05/12/701/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dandelion Fluff</title>
		<link>http://morgajel.net/2010/04/21/697</link>
		<comments>http://morgajel.net/2010/04/21/697#comments</comments>
		<pubDate>Wed, 21 Apr 2010 17:06:17 +0000</pubDate>
		<dc:creator>morgajel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://morgajel.net/?p=697</guid>
		<description><![CDATA[This sorta puts it in perspective&#8230; One of my few remaining coworkers at EPI made the following comment: (11:33:42 AM) Jeff: so many gone (11:34:10 AM) Jeff: jesse matt carrie lisa stacey kurt roger jim naveen brandon lee bink tristan jason jen sean drew radha VJ jackie andy noelle whip reedy jeremy keith ryan pankaj [...]]]></description>
			<content:encoded><![CDATA[<p>This sorta puts it in perspective&#8230; One of my few remaining coworkers at EPI made the following comment:</p>
<p>(11:33:42 AM) Jeff: so many gone<br />
(11:34:10 AM) Jeff: jesse<br />
matt<br />
carrie<br />
lisa<br />
stacey<br />
kurt<br />
roger<br />
jim<br />
naveen<br />
brandon<br />
lee<br />
bink<br />
tristan<br />
jason<br />
jen<br />
sean<br />
drew<br />
radha<br />
VJ<br />
jackie<br />
andy<br />
noelle<br />
whip<br />
reedy<br />
jeremy<br />
keith<br />
ryan<br />
pankaj<br />
nirupa<br />
asad<br />
santhi<br />
rick<br />
limer<br />
meads<br />
mick<br />
(11:34:42 AM) Jesse: you should post that as a facebook status update. one comma separated list.<br />
(11:39:06 AM) Jeff: lol<br />
(11:39:12 AM) Jeff: those are just people i knew and worked with in IT<br />
(11:39:18 AM) Jeff: i&#8217;m not counting others I didn&#8217;t work with or know in IT</p>
]]></content:encoded>
			<wfw:commentRss>http://morgajel.net/2010/04/21/697/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I am Disappoint, son</title>
		<link>http://morgajel.net/2010/04/13/691</link>
		<comments>http://morgajel.net/2010/04/13/691#comments</comments>
		<pubDate>Tue, 13 Apr 2010 15:58:34 +0000</pubDate>
		<dc:creator>morgajel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://morgajel.net/?p=691</guid>
		<description><![CDATA[SUBJECT: [#24413540] Suspension Notice CPU Limits Reached (1st Warning) Hello, Due to the amount of CPU and/or memory resources used by your account, we were forced into suspending the account. Please understand that we only suspend an account as a last resort and want to help you track down the cause as quickly as possible. [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
SUBJECT: [#24413540] Suspension Notice CPU Limits Reached (1st Warning)<br />
Hello,</p>
<p>Due to the amount of CPU and/or memory resources used by your account, we were forced into suspending the account. Please understand that we only suspend an account as a last resort and want to help you track down the cause as quickly as possible.</p>
<p>Shared servers (MegaPhase, Prophase, and ANHosting accounts) are only allotted 10% of the server&#8217;s resources (CPU and Memory) at any given time. This<br />
restriction is put in place to keep balance on the server. The first step is to<br />
try to isolate what content on your website is causing the overage. If this<br />
seems unexpected, it could be a recent change to your site (such as installing<br />
a new wordpress plugin, mailing list application, etc). Any information you can<br />
provide about recent changes can help us to isolate the problem. However, we<br />
were able to retrieve the following files and/or scripts that likely caused the<br />
suspension:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p> literaryescapism.com 2.33 1.38 0.1<br />
Top Process %CPU 34.0 [php]<br />
Top Process %CPU 25.0 public_html/index.php<br />
Top Process %CPU 23.0 public_html/index.php</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;
</p></blockquote>
<p>This was the beginning of an email I received from our hosting company, telling me that Jackie&#8217;s site was suspended due to usage. I&#8217;m not disappointed so much that they suspended it (which was the proper course of action), but in how they responded to me. Here&#8217;s my response to the warning email:</p>
<blockquote><p>
I&#8217;m trying to figure out if this is new behavior from a wordpress exploit or if it&#8217;s honestly just grown to this point; do you have any trending data for my cpu usage?</p>
<p>Side note- the access-logs linked in my home directory appear to go nowhere:<br />
access-logs -> /usr/local/apache/domlogs/user<br />
that path doesn&#8217;t exist.</p>
<p>I would like to help in any way I can. As a side note, I&#8217;ve noticed quite a few &#8220;errors connecting to mysql&#8221; in the apache logs; could there be an underlying issue with mysql that&#8217;s causing processes to back up and chew cpu time?</p>
<p>I&#8217;m also seeing some defunct php processes from other users, leading me to wonder if this is more of a systemic problem than one with just my account.</p>
<p>(sorry, I&#8217;m an apache/linux admin myself- let me know if there&#8217;s anything I can do to assist. I can be reached on gtalk, aim or yahoo.)
</p></blockquote>
<p>And their response:</p>
<blockquote><p>
Hello,</p>
<p>Unfortunately we do not have any further data except for what was given in the e-mail:</p>
<p> literaryescapism.com 2.33 1.38 0.1<br />
Top Process %CPU 34.0 [php]<br />
Top Process %CPU 25.0 public_html/index.php<br />
Top Process %CPU 23.0 public_html/index.php</p>
<p>Your account has been unsuspended so you can troubleshoot this issue. Please let us know if you have any further questions.<br />
&#8211;<br />
Best regards,</p>
<p>xxxxxxxxxxxxxx<br />
Technical Support Representative<br />
Hosting Services, Inc.
</p></blockquote>
<p>It&#8217;s sort of dumbfounding to be completely shut down like that from a TSR. I would have hoped that he would have seen that I A) know what I&#8217;m talking about and B) would have booted me up to someone who could better assist me. Instead he unlocks the account (which, btw, was never locked or suspended as far as I could tell from the time I got the email and checked until he sent the notice that it was unsuspended) and says &#8220;sorry, we have no data to help you figure out what happened.&#8221; Note that he didn&#8217;t address my questions regarding the broken symlink, mysql availability, or defunct processes.</p>
<p>Flustered, I responded with this:</p>
<blockquote><p>
Is it still using such high CPU load? I noticed several processes on the server that were having issues when I looked; many of which were not mine- The load on the server was 114 when I checked it last night. Regardless of server, that&#8217;s high, and I wasn&#8217;t one of the high processes listed.</p>
<p>I suspect this was a systemic issue- perhaps mysql went down causing multiple sites to freak out. If that&#8217;s the case (and there was a problem with the system itself), troubleshooting from my end is near impossible, especially since you have no trending data on usage. To determine if this was a one-time issue or a building issue.</p>
<p>I&#8217;d like to help you guys, but ya gotta work with me here. This is what I do for a living- I&#8217;m the Apache/Linux administrator. My wife&#8217;s site has been running for 6 months with no major changes (other than simple wordpress upgrades, none of which<br />
were in the last week) and no notable increase in traffic or bandwidth usage over the past week.</p>
<p>If you&#8217;re incapable of providing details as to whether or not there was a system issue (or even if other clients had similar issues at the same time) my only course of action would be to take our sites to another provider. I don&#8217;t want to do that; I&#8217;ve been happy with you guys so far.</p>
<p>Please, check and see if there were multiple clients on this server who received warnings as well; I suspect I wasn&#8217;t the only one. From where I&#8217;m standing the server does not look very healthy- I&#8217;m seeing multiple defunct processes:</p>
<p>nobody    6857  0.0  0.0      0     0 ?        Z    08:46   0:00 [httpd] <defunct><br />
1027     10565 15.0  0.0      0     0 ?        Z    08:48   0:00 [php] </defunct><defunct><br />
32003    10573  0.0  0.0      0     0 ?        Zs   08:48   0:00 [cpsrvd-ssl] </defunct><defunct></p>
<p>Please let me know if there is a sysadmin I can work with to resolve this issue. Like I said, I don&#8217;t think this is a problem with my site necessarily.<br />
</defunct></p></blockquote>
<p>We&#8217;ll see how they respond. Hopefully they&#8217;ll be useful- I just switched to them in October, so I really don&#8217;t want to have to find another host.</p>
]]></content:encoded>
			<wfw:commentRss>http://morgajel.net/2010/04/13/691/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
