PowerShell + iPhone + Prowl = SysAdmin notification nirvana

If I had to make a list of my favorite things on earth, two items near the top of the list would be Windows PowerShell and the iPhone. Being able to put those things together now is one of those game-changing experiences for me.

First, let me explain the problem at hand. I manage a lot of IT systems, and am generally on call 24×7 in the event that one of those systems goes down. For ages, I’ve constantly tried to come up with the best (and cheapest) way to be notified in the event of a critical failure, especially during night hours. Email notification won’t meet this need obviously, because you’re not going to have an email notification wake you up in the middle of the night. SMS text messages get a little closer, but still don’t meet the needs of all scenarios, especially around varying priority levels. I had just about given up… until I discovered Prowl.

Prowl is an application for the iPhone, originally designed to supplement Growl, but now becoming an awesome application by itself. The basic purpose of Prowl is to receive push notifications of your desired events via Apple’s iPhone Push Notification Service. Prowl then sounds an alert, and these sounds can vary based on the priority for which you’ve set the alert, from low to emergency.

I had first started using Prowl as a Growl forwarder, and then signed up for Google Voice alert forwarding. Both of those setups were nice, but things really began to get exciting when I found out that I could send my own Prowl alerts using PowerShell (which allows for linking up pretty much anything on earth), and even allow others to send me alerts as well.

I’ve now setup my iPhone with a very loud and obnoxious alert that will trigger in the event that it receives an emergency alert from Prowl. This could be that a mission critical system is down, or that someone important is trying to reach me immediately. Prowl even allows you to set quiet hours for receiving notifications on your iPhone, and also allows you to set an emergency override.

So, what do you need to configure Prowl to send alerts to your iPhone with PowerShell? Well, obviously, you’d need:

An iPhone

Prowl

Windows PowerShell

A Prowl.net DLL (this one isn’t required, but makes things much easier).

A PowerShell function to send your alerts (provided below).

Once you’ve configured Prowl on your iPhone and downloaded the Prowl.dll, simply import the PowerShell function and then start sending:

function Send-Prowl
{ param($Description="Default Description", $priority="Normal")
[Reflection.Assembly]::LoadFile("C:\Prowl\Prowl.dll")
$prowlclientconfig = New-Object prowl.ProwlClientConfiguration
$prowlclientconfig.ApiKeychain ="set this to your Prowl API Keychain from the Prowl website"
$prowlclientconfig.ApplicationName = "PowerProwl"
$prowlclient = New-Object prowl.ProwlClient($prowlclientconfig)
$prowlnotification = New-Object Prowl.ProwlNotification
$prowlnotification.Event = "PowerShellAlert"
$prowlnotification.Priority = $priority
$prowlnotification.Description = $description
$prowlclient.PostNotification($prowlnotification)
}

In the example provided, the only thing you have to change
is your Prowl API keychain value (unique to your iPhone, and found on the Prowl website), and the file location for your Prowl DLL . Everything else can be modified as desired,
but doesn’t have to be. Once you have
the function setup, you can start incorporating Send-Prowl into various monitoring
tasks, from scheduled tasks, OpsManager triggers, etc. – you could even have it tied to a home automation system to send you alerts when your front door opened.

It’s also a way to have your closest contacts reach you in
the event of an emergency. Assuming they
have PowerShell and the Prowl.dll, they can just contact you by using something
like:

Send-Prowl -priority Emergency –description “Please call me ASAP! Water line just broke!!!”

By the way, before anyone critiques the sloppiness of the PowerShell script, this script is meant only as a quick-start example to show people how to use the DLL, as I didn’t find any example Prowl PowerShell code on the internet (the examples were in C#). You’ll want to customize it to your needs.

Happy Prowling!

Janssen

GoogleVoice + SIP phone + Linksys PAP2 = free unlimited long distance home phone service

For years, I’ve been seeking out the cheapest way to get unlimited local and long distance calling for home phone service. I was a very early subscriber to Vonage, and later switched to Skype and bought various  Skype USB-to-RJ11 devices to allow internet phone calls to ring in on regular phones around the house. After a couple years, we finally gave up and went to primarily just using an AT&T cellular family plan with a lot of minutes.

Last year, my employer (Indiana University) invested substantial infrastructure in Microsoft Office Communications Server (OCS), which provides VOIP services integrated directly with our Microsoft Exchange environment. Missed call notifications and voicemail go directly into our mailbox, etc., and it’s a very nice system. In fact, I have a Polycom CX700 sitting on my desk at home, allowing me to work from home and have my work number ring in directly to my home office.

So that’s all well and good, but what if you want to have that same kind of experience for non-business calls – and for really cheap? Well, in the past, Vonage or Skype were probably the best/cheapest solutions, but with Google Voice coming onto the scene, one can setup a pretty nice system for virtually no cost (after initial setup). The basic idea is this: there are a lot of VOIP providers out there which allow free inbound calls, and charge pennies per minute for outbound calls. However, with Google Voice, one can make *every* call an inbound call, and save those last pennies. With Google Voice, any time you want to make an outbound call, you just give that number to your Google Voice service, either through a webpage, iPhone app, etc., and they call you first. Then, once you pick up the phone, they dial the party on the other side. Voila – instant unlimited free long distance.

It’s possible that at some point, VOIP companies are going to get upset at Google Voice and their customers for using their services like this, but in the meantime, it’s a nice setup.  So what do you need to get started?  Well, basically the components are:

1)      High Speed Internet Access (this is a given, since we’re making VOIP calls)

2)      Google Voice (this is invite-only, but if you ask for an invite, they usually turn it around within a couple weeks)

3)      A VOIP provider with free inbound SIP calls (I’m using sipgate).

4)      A box to convert incoming SIP calls over to standard telephones (I’m using a Linksys PAP2, which you can pick up on Amazon for about $50).

5)      Traditional telephone (I’m using a 3-handset cordless model, to have a phone on each floor).

Once you have the parts, you basically just plug your Linksys PAP2 into your home router, then login to its web interface to do some basic configuration, which is well documented on sipgate’s website, and which takes under 5 minutes. After that, plug in your regular telephone into the phone port on the back of the Linksys PAP2 and test a phone call. Now you have VOIP phone service, but not free unlimited outbound calling. To get the outbound calling, simply setup your Google Voice account, and add your VOIP number to your Google Voice registered phone number list.