SMS alert
The online services become more and more complex and the server software must
work 24 hours per day and 7 days per week. The server solutions are however not absolutely
reliable, the software contains bugs which may cause the crash of the service, which
causes complaints from service users. This makes an instant reaction on server failures
very important.
If there are no operator on duty, how can you provide the quickest possible alert?
If the operator has a mobile phone, the best solution is the SMS alert notification.
The short GSM message is delivered instantly and the recipient reads it even if he is not
in the office.
Headwind GSM Modem Driver provides the API for sending SMS through a GSM device, which can
be used to send alerts on various server failures. The API can be used in VBScript to send
short messages. Read this instruction to setup Headwind GSM
Modem Driver on your server.
A sample script
This script checks the presence of a process in the computer memory and raises an SMS
alert if the process has been crashed.
Set objArgs = WScript.Arguments
' Place the name of a remote server here
ServerName = "."
ProcessName = objArgs(0)
' This is a phone number to receive SMS
AdminPhone = "79212345678"
count=0
Set objWMIService = GetObject("winmgmts:\\" & ServerName & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process",,48)
For Each objItem in colItems
' Wscript.Echo "Name: " & objItem.Name
if LCase(objItem.Name) = LCase(ProcessName) then
count=count+1
end if
Next
if count < 1 then
' Raise SMS alert!
Set objSMSDriver = CreateObject("HeadwindGSM.SMSDriver")
Set objMsg = CreateObject("HeadwindGSM.SMSMessage")
objMsg.To = AdminPhone
objMsg.Body = "ALERT! No process '" + ProcessName + "'"
objSMSDriver.Connect()
objMsg.Send()
end if
This script is written in the VBScript language. Copy the script from the web page, paste
it in the text editor and save it as "monitor_process.vbs". The script must be called from the
command line in the following way:
cscript monitor_process.vbs "file.exe"
Here "monitor_process.vbs" is the name of the script, and "file.exe" is the name of
the process in memory.
To setup the monitoring in Windows XP, you need to do the following steps:
Warning! The script will send SMS every time it runs and does not see the monitored process!
You need to react instantly to prevent sending of multiple SMS!
|