Good Morning Everyone,
My team has been asked to start using HipChat in conjunction with Jira for incident management, communications. I am trying to get SolarWinds alerts to echo in the HipChat window and have been running into some snags. I saw this thread: Re: Alerting using #Slack#SlackRe: Alerting using #Slack and saw the piece for HipChat, but haven't had great success in getting it to work in my environment. I have the Alert Trigger Action Execute an External VB script with the following value:Here is my script:
C:\SolarWinds\Hipchat\hipchat.vbs ${N=SwisEntity;M=ApplicationAlert.ApplicationName} ${N=SwisEntity;M=Node.IP_Address} ${N=Alerting;M=AlertName}
Here is the VB Script:
sUrl = "https://example.hipchat.com/v2/room/<room number>/notification?auth_token=<Auth Token>"
sArgName0=WScript.Arguments.Item(0) ' CAPTION
sArgName1=WScript.Arguments.Item(1) ' IP ADDRESS
sArgName2=Replace(WScript.Arguments.Item(2), " ", "*") 'Alert Name with spaces changed to hypen
sReqColor="""color"":""red"""
sReqMessage="""message"":""" + "[" + sArgName2 + "]" + " - " + "Device:" + sArgName0 + " IP Address:" + sArgName1 + """"
sReqNotify="""notify"":true"
sReqMessage_format="""message_format"":""text"""
sRequest="{" + sReqColor + "," + sReqMessage + "," + sReqNotify + "," + sReqMessage_format + "}"
HTTPPost sUrl, sRequest
Function HTTPPost(sUrl, sRequest)
set oHTTP = CreateObject("Microsoft.XMLHTTP")
oHTTP.open "POST", sUrl, false
oHTTP.setRequestHeader "Content-Type", "application/json"
oHTTP.setRequestHeader "Content-Length", Len(sRequest)
oHTTP.send sRequest
HTTPPost = oHTTP.responseText
End Function
The message posts, but the detail I expect to see isn't being posted along with it. Unfortunately, this is what I'm seeing in the HipChat window:
SolarWinds·Oct-20 9:44 PM
[Server] - Device:Microsoft IP Address:Windows
I've done some playing around with the arguments, but unfortunately I'm not getting any additional details in the HipChat message. I am clearly not an expert with VB scripting as this was totally taken from the other thread. I am also wondering if my issue is because the example cschomburg posted was for a different type of alert than an Application going down so the variables are all wrong?
Thanks in advance for your help!
niterave