The Root Cause Hot Potato

Servers crash, it is part of being in IT – and with server crashes, there is always the management sticking us Grumpy (and sometimes old) IT Admins in to the stirrups and asking deep probing questions about our sexuality infrastructure and asking for ROOT Cause.

You can spend hours, searching for log files, and looking up error codes on Google and Technet and still be none the fracking wiser!

Being a Grump Admin, my normal initial response to the question of root cause is normally a wise crack. Something funny, while this might seem strange, i find it normally reduces the tension of a stressed out manager who’s SLA and possible bonus just went down faster than a DMCA notice on the lastest Hollywood block buster posted on TPB!!

Being a lazy Grumpy Admin, my own pool of IT humour was quickly depleted due to the reliability of our servers. So a quick google and I found this site :-

http://pages.cs.wisc.edu/~ballard/bofh/

Excellent over 500 different BOFH type error messages – great, but it not really good to launch a website from your bookmarks when your manager wants a root cause for a failure….

That got me thinking about – What if I type in to Powershell – why-crash and it returned on of these funny quotes.

Me being me, in 2 mins flat I had working prototype code, but the problem was the method I was using just returned all the html from the above bofh site, and being me,  I am far to busy lazy to write code to traverse the DOM model of returned HTML output from their page just to extract a funny error message!!!

So I did what all good IT people do and borrowed their data source, which I believe is GPL open source…. please don’t sue me!!!

I wrote 4 lines of PHP and hosted it on my own server, just to return the funny quote and nothing else

<?php

$input = array(
“clock speed”,
“solar flares”,
“electromagnetic radiation from satellite debris”,
etc…… )

$rand_string = array_rand($input, 4);
echo $input[$rand_string[0]];

?>

Put this up on some web space I have – linky here www.hazzy.co.uk/bofh/index.php

and then I wrote a very badly written Powershell function to request the random (and should be funny) server crash from my web space – not fair them paying for bandwidth that I am using now is it? Grumpy Admin is a caring admin, a quote stealing and code stealing admin, but a caring admin!

Now for the powershell code

It uses the invoke-restmethod function call, which is useful, and does a lot more than just what I am using it for here – basically a school yard prank!

Function why-crash {
$data = Invoke-RestMethod -Uri “www.hazzy.co.uk/bofh/index.php”
write-host $data
}

Now to active this function you just call the function why-crash

Think of the scene, you boss asks you why the server crashes, you load up Powershell and
type why-crash and it returns with

network packets travelling uphill (use a carrier pigeon)

See you next to me at the job centre???

Hazzy

Leave a Reply

Your email address will not be published. Required fields are marked *