telnetMESMS–SMS Wrapper for Exchange Monitoring–Part 1…
Some of you will be aware that I have recently been working on a series which takes a look at Monitoring Exchange Server using Nagios Core. Whilst doing so, I started to think about administrative notifications and the different types of channel that can be used to get key information across to you in a timely manner.
Broadly speaking, when something happens within a monitored Exchange environment – notifications can be sent to the relevant administrator via:
- Net Send
- Visual Notification (Red, Yellow and Green)
More commonly (from what have experienced) people tend to use either e-mail or SMS.
So with those (probably incorrect) assumptions in mind I decided that I was going to have a look at sending SMS notifications when a given event occurs. The idea behind this was that in the Nagios series I would like to cover how to send both e-mail notifications and SMS from Nagios when a state change occurs. Now e-mail is pretty straightforward, however SMS is a little more involved.
I had a look around on the web and there are a plethora of ways to get SMS notifications to people, ranging from dedicated SMS gateways through to Web Based API’s. Ideally I wanted a free SMS solution, but alas whilst there are a number of “free SMS providers” on the web – none quite matched what I want to do.
In essence I wanted to code a C# console application that could accept a number of command line parameters and via a web API send them to a destination mobile – this was going to cost some money – so my search then changed to the most cost effective solution provider (that I could find). In the end I did find a provided that met all of my criteria (more on this a little later)
So therefore in this article I would like to present to you the telnetMESMS tool and in the next part show you how you can use the tool with PowerShell to send some SMS notifications based upon administrative events. I will then hand further coverage of the tool over to he Nagios Core articles that I have been doing and show you how you can integrate it show that you receive SMS messages.
The telnetMESMS application can be downloaded from the following location:
In order to use the software you will need to ensure that both your client system conforms to the following pre-requisites:
- .Net 3.5
- The client system must have access to the internet ~ and not via a proxy server (this version of the tool does not support proxy connections) – I will adding this in very soon
- A registered account with http://www.intellisoftware.co.uk and some SMS credits (you get 5 free – more can be purchased)
Before you begin
The “telnetMESMS.exe” is in essence an encapsulation of the Intelli Software SMS web API.
To be open from the start, if you would like to make use of this tool in a production scenario you will need to have signed up an Intelli Software Account which you can do from here: http://www.intellisoftware.co.uk/
Upon sign up you can get 5 complimentary SMS messages (which admittedly is not a huge amount for a trial) – but you can purchase more at a fairly reasonable rate – example below – taken from the Intelli Software website:
This would work out to be about £33.00 for 500 texts based upon their Economy plan.
Now you might be thinking – OK ~ so how much are Intelli Software paying me?, and I wouldn’t blame you for thinking that – but I can say in all honesty – nothing, not a jot, nada.
The reason(s) as to why I have chosen to advocate of their services are because:
- I have an inherent (at the moment) mistrust of “Free” SMS services – I feel more comfortable using a commercial provider (if people have any other suggestions which offer a secure service with a good web API I would be more than happy to take a look at modifying the tool)
- I needed a UK based SMS provided (to work both in my testing of the application, and for my own work purposes) – its important to note that Intelli Software will send to non-uk mobiles
- Intelli Software provide a dedicated .NET Class (located here: http://www.intellisoftware.co.uk/sms-gateway/dotnet-component/) which allows for easy development of applications such as mine
NOTE: It is important to point out that this project uses the IntelliSMSDotNet.dll which is distributed with the telnetMESMS.exe file – this dll does not belong to me, it is offered as a free runtime with your IntelliSoftware account.
Installation of the Tool
Download the setup installer from the link above to a location on your Exchange Server – double click on the “setup.msi” file which will present you with the Welcome Screen – see below:
Select the target installation path (I recommend that you leave it at the default setting) – when done click on the “Next” button – see below
You will then be presented with he “Ready to Install” screen – if you are using Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2 you may be asked to elevate your privileges via UAC – click on the “Install” button – see below:
The setup software will then install the application binaries to your computer – see below:
When setup has completed – click on the “Finish” button – see below
Basic use of the SMS Tool
The default installation location of the tool is “C:\telnetmeSMS” – therefore you will need to open a Command Prompt and change to that directory. If you changed the default location during the installation you should navigate there.
All command line options for the tool can be viewed via typing the following at the command prompt:
– see below
Before you can use the telnetMESMS tool you will need to configure you Intelli Software account information. This process will create an XML file called smsConfig.xml which contains your online account username and password.
I have written the application so that it stores the password for your account within the XML file encrypted using MD5 so it is relatively secure.
In order to setup the telnetMESMS client for the first time you need to execute the software using the “config” parameter (this will either need to be performed on each client which you use the tool on – or you can setup on one server and then copy the smsConfig.xml).
Therefore from the command line navigate to the folder in which your downloaded the telnetMESMS.exe program file and type the following command:
This will prompt you for two items of information:
- Intelli Software User Account
- Intelli Software Password
Provide them as per your sign up process – see below:
In order to send a text message to mobile phone via the Intelli Software gateway the program requires 3 parameters:
telnetMESMS.exe <mobile number> "<Text Message>” “<Sender ID>”
– see below:
When you have sent the text message the program will give you the following output:
If everything has worked correctly you should receive a text message on your mobile phone, similar to the example below:
In the next part – How can this be used with Exchange?
In the next part I will cover:
- How you can use the tool to send text alerts to users who have in an alert state