cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 10

How to an OrionNPM Alert can create a new ticket in Remedy Help Desk

I have my OrionNPM integrated with Remedy via RPC successfully!

Logic:

  1. A node with a specific custom property goes down
  2. Send a special structured syslog message to kiwi
  3. Kiwi sends the orion message to a VBS script that do a syntactic analysis, format date time, trim and replace text.
  4. Kiwi send parsed message to a MS-DOS Batch file that assembles command esp-createentry with the relation between remedy Field_ID and our variables
  5. esp-createentry.exe send to Remedy server via RPC the form information and create the new ticket, it returns the new Ticket ID

Structure (check image attached):

  1. Install Kiwi syslog server on port UDP 6500
  2. Create a Custom Property (TK) to select and classify nodes of which we want to create a ticket on remedy
  3. Create an advanced alert. Trigger alert when node is down and TK contains client. After a delay of 11 min. send a syslog message to our localhost_name:6500   [T#,"${TK}","${State}","${Site} !${Customer_ID}","@${AlertTriggerTime}@","${Caption} ${Status}","-+- ${Customer_ID} ${Caption} ${Status}"]
  4. On Kiwi syslog create a new rule: [Filter include "T#"], [Actions: 1.Run Script VBScript (Common Fields Read and Write), 2.Run External Program (my_bat.bat %MsgText), 3.Play some sound ]
  5. Create batch file. In this file we going to build the relation between Remedy field_ID and our variables and send the structure to esp_createentry.exe <Server> <Remedy User> <Password> <Schema> <Field ID>
      <Value> [ <Field ID> <Value> ... ]

ESP_CreateEntry: ESP_CreateEntry program is one of the way to make integrations with Remedy ARS server. Following the closure of the company Elegant Software, responsible for this program and no longer make the amendments necessary for adapting to new versions of Remedy ARS. It is not always possible to modify the integration schemes used, and therefore it is necessary to know something more about the operation of this program to carry out proper maintenance of our Remedy ARS server and supporting integrations.


5 Replies
Level 10

Scripts:


VBScript

---------------------------------------------------------------------------------------
Function formatTo2Digit(in_Num)
Dim temp
If IsNull(in_Num) Or in_Num = "" Or Len(CStr(in_Num)) > 2 Then
temp = ""
Else
temp = CInt(in_Num)
If temp < 10 Then
temp = "0" & CStr(temp)
Else
temp = CStr(temp)
End If
End If
formatTo2Digit = temp
End Function

Function reestructura(in_Date)
' "MM/DD/YYYY HH24:MI:SS" 01/01/01 13:12:11
Dim strDay, strMonth, strYear, strHour, strMinute, strSecond
strSecond = formatTo2Digit(Second(in_Date))
strMinute = formatTo2Digit(Minute(in_Date))
strHour = formatTo2Digit(Hour(in_Date))
strDay = formatTo2Digit(Day(in_Date))
strMonth = formatTo2Digit(Month(in_Date))
strYear = right(Year(in_Date),2)
reestructura = strMonth & "/" & strDay & "/" & strYear & " " & strHour & ":" & strMinute & ":" & strSecond
End Function

0 Kudos


Function Main()

' Reemplaza expresion regular "(.)*OrionAlertEngine: T#," con nada
' Reemplaza dae time @10/11/2009 09:51:15 p.m.@ con formato mm/dd/aa hh:mm:ss
'Original message:
'Nov 10 2009 12:45:29 npm %OrionAlertEngine: T#,"client2","NY","NY AirPort !A001R","@11/10/09 12:45:29@","-+- Airport Newark NY R Down"
'Processed Message:
'"client2","NY","NY AirPort !A001R","10/11/2009 11:37:25","Airport Newark NY R Down","10/Nov/2009 11:37:25 p.m. A001R Airport Newark NY R Down"

Dim aryMonth(12)
aryMonth(0) = "/Nothing/"
aryMonth(1) = "/Jan/"
aryMonth(2) = "/Feb/"
aryMonth(3) = "/Mar/"
aryMonth(4) = "/Apr/"
aryMonth(5) = "/May/"
aryMonth(6) = "/Jun/"
aryMonth(7) = "/Jul/"
aryMonth(8) = "/Aug/"
aryMonth(9) = "/Sep/"
aryMonth(10) = "/Oct/"
aryMonth(11) = "/Nov/"
aryMonth(12) = "/Dec/"

Set RegularExpressionObject = New RegExp
With RegularExpressionObject
.Pattern = "(.)*OrionAlertEngine: T#,"
.IgnoreCase = True
.Global = True
End With

Fields.VarCleanMessageText = RegularExpressionObject.Replace(Fields.VarCleanMessageText, "")

Set RegularExpressionObject = nothing
' ----------------------------------------------------------------------------------------------------------
Set RegularExpressionObject = New RegExp
With RegularExpressionObject
.Pattern = "@(.)*@" 'Header orion
.IgnoreCase = True
.Global = True
End With

0 Kudos


Set matches = RegularExpressionObject.Execute(Fields.VarCleanMessageText)
Set fechaaa = matches(0)
fechaaa=Replace(fechaaa, "@", "")
fechaaa=Replace(fechaaa, ".", "")

fechaaa=Replace(fechaaa, "/01/", aryMonth(1))
fechaaa=Replace(fechaaa, "/02/", aryMonth(2))
fechaaa=Replace(fechaaa, "/03/", aryMonth(3))
fechaaa=Replace(fechaaa, "/04/", aryMonth(4))
fechaaa=Replace(fechaaa, "/05/", aryMonth(5))
fechaaa=Replace(fechaaa, "/06/", aryMonth(6))
fechaaa=Replace(fechaaa, "/07/", aryMonth(7))
fechaaa=Replace(fechaaa, "/08/", aryMonth(8))
fechaaa=Replace(fechaaa, "/09/", aryMonth(9))
fechaaa=Replace(fechaaa, "/10/", aryMonth(10))
fechaaa=Replace(fechaaa, "/11/", aryMonth(11))
fechaaa=Replace(fechaaa, "/12/", aryMonth(12))
menosmasmenos=fechaaa
fechaaa=cdate(fechaaa)
'fechaaa=DateAdd("H",1,fechaaa) ' ajuste horario de verano remedy (Summer time correction)
fechaaa=reestructura(fechaaa)
Fields.VarCleanMessageText = RegularExpressionObject.Replace(Fields.VarCleanMessageText, fechaaa)
Fields.VarCleanMessageText= Replace(Fields.VarCleanMessageText, "-+-", menosmasmenos)
Set RegularExpressionObject = Nothing

' Set the return value to indicate that the script ran correctly
Main = "OK"

End Function

---------------------------------------------------------------------------------------


0 Kudos

MS-DOS BATCH

---------------------------------------------------------------------------------------
@echo off
set ARTCPPORT=2010
set Descripcion=We loss communication with remote site%3
set Descripcion=%Descripcion:"=. %
set Afectado=%2 - %3
set Afectado=%Afectado:"=%

echo New Ticket on Remedy in 90 seconds (Ctrl+C Y to cancel):
echo.
echo Client: %1
echo State: %2
echo Site: %3
echo Sites: "%Afectado%" 
echo Down: %4
echo Cli: %5
echo Worklog: %6
echo Summary: "%Descripcion%"
echo.
echo [ ]
C:\ARSystem\CreateEntry\sleep 22
echo [+25+ ]
C:\ARSystem\CreateEntry\sleep 22
echo [+++50+++ ]
C:\ARSystem\CreateEntry\sleep 23
echo [+++++75+++++ ]
C:\ARSystem\CreateEntry\sleep 23
echo [+++++++100++++++]

C:\ARSystem\CreateEntry\esp_createentry 10.10.10.200 myuser myus3r HPD:HelpDesk 600000000 %1 200000012 "Node Down" 200000007 "Sites" 536870914 "%Afectado%" 8 "%Descripcion%" 240000007 "We loss communication with remote site" 200000003 "Provider" 200000004 "OSI Layer 1" 200000005 "LINK" 260000126 "3" 240000008 %6 536870984 %4 536870917 %5 536870913 "0" 240000005 "myuser" 240000001 "orionNPM" 7 "0" 260000128 "5" 260000130 "0" 536870915 "0" 

klog -h 127.0.0.1 -m "NEW ticket on Remedy" -L Emerg -u 6500

set Descripcion=
set Afectado=

echo Time=%time%
pause
  ---------------------------------------------------------------------------------------

0 Kudos

Hi Charly,

Is it bidirectional flow ?

From Solarwinds to Remedy and Remedy to Solarwinds?