GrapeVine SMS and SCOM

GrapeVine has several methods for message delivery to be sent as a SMS.

1. Email to grapevine mailbox from there SMS messages is sent

2. Post

3. XML

The below powershell script is one example of consuming the HTTP Post method.

The powershell script is configured in SCOM as a Command Line notification with the SCOM alert description and CellPhoneNumbers passed to the script as parameters.

The script takes the comma-seperated list of CellPhonenumbers and one for one send the information to GrapeVine web url.

You will need the following information from GrapeVine for your clients’ account

1. Originator ID

2. AffiliateCode

3. AuthenticationCode.

These 3 items are required and only obtainable from Grapevine, you need to get in touch with the GrapeVine SP to get this information.

The script also consumes the return code information from the post attempt and saves these returned information into a text file for future reference.

The script also when the # lines are removed to create actual event log entries into the Application event log. You can use these event logging capabilities and monitor for these events either by using SCOM or some Monitor of Monitors.

Param($Message=$Args[1], $cellnumbers=$Args[2])

$aaa = $cellnumbers.split(“,”)

write-host $cellnumbers

foreach ($cellnumber in $aaa)

{

write-host $Message

write-host $cellnumber

$http_request = New-Object -ComObject Msxml2.XMLHTTP

$http_request.open(“POST”,”http://grapevineurlreceivedfromGrapeVine/httpInputhandler/ApplinkUpload”,$false)

$http_request.setRequestHeader(“Content-type”,”text/xml”)

$http_request.send(“origidaffcodeauthocode2015-03-11T12:40:00text$Message$cellnumber”)

write-host $http_request.responseText

$ResultOutPut = $http_request.responseText

$DateNow = Get-Date

add-content d:\grapevinesms\gvsmslog.txt “$DateNow :: $Message – $cellnumber returned the following response – $ResultOutPut”

add-content d:\grapevinesms\gvsmslog.txt “

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s