IBM Software Group | Tivoli software 2 Purpose The purpose of this document is to describe how to send SMS when a situation fires in ITM 6 or OMEGAMON This solution is based on : Reflex Situation Action to generate a command This command is a Jscript to send a SMS to someone A local mobile phone or a GSM Modem (for example TC35 Siemens and SIM card) to send SMS This solution gives you a complete operational example.
IBM Software Group | Tivoli software 3 Hardware Architecture Local GSM Phone or SMS Modem COM Port Communication wire or Bluetooth … Remote GSM Phone SMS Provider
IBM Software Group | Tivoli software 4 Hardware details We recommend to use a specific SMS modem, SMS terminal or GSM telephone with a wired connection to the HUB TEMS system. If you choose a GSM mobile phone : be sure that it includes a modem and supports Hayes AT commands for sending SMS. For Siemens Cellular Engine TC35 Terminal, see : The HUB TEMS system must have a serial COM port : This could be a physical serial port : RS232C wire or a virtual COM port : in that case, the connection could be wireless, USB or Infrared …depending of the way to connect to the SMS modem. Whatever modem you choose, you will need to have a SIM card and a provider.
IBM Software Group | Tivoli software 5 Architecture flow COM 6 TEMS Server Situation Reflex Action Command Line cscript sms.js /p:6 /t: /m:”My First Message” AT+CMGS=" " OK My First MESSAGE +CMGS: 25 OK Provider
IBM Software Group | Tivoli software 6 What’s in the software package ? The package is composed of : SMS.JS : this is a JScript that sends a SMS to a mobile phone by using a local GSM modem or a local mobile phone. This presentation. You’ll need to download and install : Visual Basic Express 2005 : We need to install Visual Basic to get the DLL to support the Serial Com Ports.
IBM Software Group | Tivoli software 7 Installation steps Check prerequisites : Windows 2000 SP4 or XP SP1 or Windows 2003 server SP1 a GSM modem or a local mobile phone (with an internal modem) using a serial port (RS232C) or emulating a serial port (Bluetooth,USB …) a SIM card and a provider Supporting SMS Hayes AT commands Steps 1.Unzip the files into the TEMS directory (like c:\IBM\ITM\cms ) on the TEMS platform 2.Download and Install Visual Basic Express 2005 on the TEMS platform 3.Connect a local modem and get a serial com port number COMx
IBM Software Group | Tivoli software 8 Installing Visual Basic 2005 Express Edition Visual Basic 2005 Express Edition is a free solution that brings some DLLs to support Com Port. To download : During the installation, you don’t need to install any database but you’ll install the Microsoft.NET Framework version 2.
IBM Software Group | Tivoli software 9 Obtaining a COM port number If you have connected your modem thru a real COM port, you should easily know what is the COM port (it should normally be COM1 or COM2). If you have used a USB wire, you should have installed some additional drivers and you should have been asked for a COM port. For Infrared or Bluetooth, you should have installed some additional drivers and you should have been asked for a COM port. In all cases, at this step, you must have a COM port number before to continue …
IBM Software Group | Tivoli software 10 Using SMS.JS To use a JScript program like a Windows command, you must use a command processor like CSCRIPT so that your program will be interpreted by the Jscript processor or VB. The format is : cscript sms.js /p:port /t:phone /m:”message” Where : –port is the number of your com port –phone is the remote mobile telephone number you want to call –message is the test you want to send Example : cscript sms.js /p:1 /t: /m:“My First Message“ If you don’t want the version logo of cscript, just add //Nologo
IBM Software Group | Tivoli software 11 Check that SMS.JS is working Open a DOS windows and type the following command : C:\IBM\ITM\cms> cscript sms.js /p:1 /t: /m:“My First Message“ You should receive this : Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation All rights reserved. 1/3/ :53:17: sms.js 1/3/ :53:17:484 Program - sms.js - 12/12/ version 1.0 1/3/ :53:17:500 Parameters - Port=1 Telephone= Message=My First Message 1/3/ :53:18:31 Comm Port started on COM1 1/3/ :53:20:62 --->ATE 1/3/ :53:20:78 OK 1/3/ :53:24:93 --->AT+CMEE=2 1/3/ :53:24:109 OK 1/3/ :53:28: >AT+CMGF=1 1/3/ :53:28:125 OK 1/3/ :53:35: >AT+CMGS=" " 1/3/ :53:35:203 > 1/3/ :53:40: >My First Message → 1/3/ :53:40:250 +CMGS: 18 1/3/ :53:40:265 OK 1/3/ :53:40:328 Comm Port Closed 1/3/ :53:40:328 Exit 0 You should have received a SMS on your remote mobile phone
IBM Software Group | Tivoli software 12 ATE : sets the echo to ON (ie you can then see the response from the modem. Expected answer is OK. AT+CMEE=2 : sets the verbose option for all SMS commands for the modem. Expected answer is OK. AT+CMGF=1 : activates the text mode (there is also the PDU mode – but not used in our case). Expected answer is OK. AT+CMGS=telephonenumber : this is the first part of the command. It must end with the return key (crlf). It indicates the mobile remote telephone number. The expected answer is > that indicates you can enter your message text. >This is my message text ctrz : this is the message text followed by the Control-Z key. The expected answer is OK. Some modems are normally de facto in the echo mode (ATE) and verbose state (AT+CMEE=2). So, using these commands are not necessary (then you can avoid the time spent for these commands by deleting the corresponding paragraphs). Notes about Hayes SMS commands
IBM Software Group | Tivoli software 13 Troubleshooting Hayes SMS commands If you want to troubleshoot communication problem between the SMS.JS and the COM port and the modem, we suggest to start the HyperTerminal and type the previous Hayes command in the terminal. Use HyperTerminal which comes with Windows (Start->Accessories- >Communications->HyperTerminal). Connect directly to the COM port which you have connected to the GSM modem. Select the baud rate to be 9600 bps (actually, the module will accept all the baud rate setting, any selection will work). The other parameters are : Data Bits (8), Parity (None), Stop bits (1), Flow Control (None). It could necessary to reboot the modem or phone before configuring.
IBM Software Group | Tivoli software 14 Reading received SMS in the Modem The user that received the SMS can reply and send back a SMS to acknowledge the alert. To do so, SMS.JS includes a feature that can read messages in the local modem. To activate this feature, you must edit the SMS.JS using notepad. Then, at the beginning of the program, there is line saying : WAIT=0 Modify to : WAIT=60 If you specify 60, SMS.JS will wait 60 seconds and it will read the received SMS in the modem indicating that the alert is acknowledged.
IBM Software Group | Tivoli software 15 Logging Hayes Commands Automatic Logging is active. A file called SMS.log is located in the same directory as SMS.JS
IBM Software Group | Tivoli software 16 Define a situation with a take action In the TEP or OMEGAMON Console, defined a new situation Use low thresholds to check the success of the SMS In the Take Action, use the following parameters cscript sms.js /p:port /t:phone /m:”message” You can follow the execution of the SMS.JS in the SMS.log If nothing happens in the SMS.log, this is because SMS.JS is not located in the right directory (i.e. the CMS directory). Or the CMS directory is not C:\IBM\ITM\cms phonenumber should be one string representing the remote phone number (i.e or )