Build your own SMS Alerts–Logentries and Clickatell Combined!
This is a guest blog post by Jason Ruane, the technical director at Moposa, a place for brides and grooms to plan and manage their wedding. In this post Jason, describes how he used Logentries webhook alerts and Clickatell to receive Logentries alerts via SMS. Jason and his team are long time users of logentries, analyzing all their logs from multiple servers in one centralized, cloud location.
How I receive my Logentries alerts via SMS
Sometimes you want things to escalate quickly and a storm of errors on your production system is definitely one of them.
With the rise of APIs everywhere it is becoming reminiscent of the Unix pipes of old, to nowadays connect disparate services with a simple flow. For example, having seen the new alert feature on Logentries I set a sample one up to pop me an email if the number of fatal alarms on our webapp exceeded 100 per day, indicating something has gone awry. However, for a more serious occasion, when 100 error events per hour trigger a Logentries alarm, I felt an SMS might be more appropriate as I would definitely want to escalate this and sort it out immediately. Connecting these dots was easy; I just set the alarm action to make a HTTP call to my SMS provider with an appropriate subject line. It’s a quick 2 step process.
Setup an account with an SMS provider. In this instance I am using Clickatell as they have an API which can accept a HTTP call with URL parameters to initiate an SMS. They offer some initial free text messages when you sign up if you would like to try before you buy. After creating an account, log in to “Developers Central”. In the tab “Manage my Products” add a connection (type http), click submit and then you have your API ID.
Now, by navigating to a particular URL, you can send an SMS. The format is shown below but you will want to substitute your particular info in the appropriate locations:
For example, my particular URL looks like:
So here it is in the Clickatell site:
Create an alarm in Logentries and for the action, set it to “POST me a notification” to the URL from step 1.
So now, when an alarm fires in Logentries.com, it pops up in my text messages.
Taking it to the max
But why stop there, the Unix progenitors had bigger dreams, as Brian Kernighan described with the beauty of piping information through these building blocks (@6 mins). The Internet of Things is all about connecting everything, so I purchased a couple of internet connected lightbulbs for home and now the alarms from Logentries can bathe the room in red to grab my attention. Overkill you say? Not at all; That is the next stage, where the alarm will trigger the coffee machine with a proportional ratio of espresso shots to alarm messages, because when things go astray, it’s gonna take some fixin’. J
Who are we
Here at Moposa, we are building a place for brides and groom to plan and manage their wedding. We have been using Logentries from the moment we heard of them. Cloud based logging was the perfect solution, for both our scale-up and then scale-out setups. We are building on .NET with C# and every time I jump into Logentries it is a joy to see the happy humming of multiple servers stream into the one unified location.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)