Home
  • RapidOSS
  • Support
  • About Us
Home » Blogs » berkay's blog

Simple consistent interfaces to external systems

Posted April 2nd, 2009 by berkay
in
  • API
  • EMC Smarts
  • Integration
  • Netcool
  • OpenNMS
  • RapidInsight
  • RapidOSS
  • Smarts
  • SNMP

In my conversations with potential customers and in documentation, I often state that RapidOSS makes it easy to work with external systems. Since "easy" is a relative concept, without some concrete examples this may not mean much to folks who don't have first hand experience working with RapidOSS.

Integration with external systems very often require in-depth understanding of the APIs provided by the external systems. Even when the external system provides standard APIs (SOAP, database etc.) it is not easy to master the variations from the standards, and figure out the structure of the data, how to use it.

In RapidOSS, we use a simple data structure consistently for all external systems. If the data is a single object (record, line, etc.) it is represented as name value pairs, referred to as “Map”. For example, if we want to represent employee information, we could use the following structure:


def employee = [name:”John Doe”, department:”Accounting”, age:34]

// We  can also use the following alternative format with the dot notation to the same end:
def employee = [:] // initializes a Map
employee.name = “John Doe”
employee.department = “Accounting”
employee.age = 34

To represent multiple objects, we use “List of Maps”. For example to represent employees:


def employees = [
[name:”John Doe”, department:”Accounting”, age:34],
[name:”Jane Smith”, department:”Finance”, age:25]
]

These are easy data structures to work with and groovy provides number of powerful yet simple methods to work with these List and Map data structures.


println employees[0].name // prints “John Doe”
println employees.name // prints [“John Doe”, “Jane Smith”]
employees.each { employee -> //iterates through the list
println employee.name
}

So when we create integration layers with external systems, we map the data structures provided by the external systems into these simple and flexible data structures available in Groovy.

To demonstrate how this works in practice, let's say we'd like to create an event in various systems. Let's start with RapidOSS itself. How to create an event in RapidOSS? The mechanism is simple, put the event properties into a map and call an operation (method of a class) to create the event in RapidOSS repository.

def eventProps = [:] //intialize a Map
eventProps.name = “MyTestEvent”
eventProps.severity = 3
eventProps.elementName = “LabDevice1”
eventProps.source = “test script”
eventProps.description = “creating an event for testing”
RsRiEvent.add(eventProps)

// or similarly in a single line by defining the structure directly inside the operation.

RsRiEvent.add(name:“MyTestEvent”, severity:3, elementName:”LabDevice1”, source:”test script”)

How would you create an event in Netcool? The mechanism is the same, the only difference is that the names of the event properties (fields as they are referred to in Netcool) and the class operation

def eventProps = [:]
eventProps.identifier = “MyTestEvent”
eventProps.severity = 3
eventProps.node = “LabDevice1”
eventProps.summary = “creating an event for testing”

// we need to specify which external system we want to work with
def netcool = NetcoolDatasource.get(name:“Omnibus”)
netcool.addEvent(eventProps)

How about EMC/Smarts?

def eventProps = [:]
eventProps.eventName = “MyTestEvent”
eventProps.severity = 3
eventProps.instanceName = “LabDevice1”
eventProps.className = “Test”
eventProps.sourceDomainName = “RapidOSS”
eventProps.eventText = “creating an event for testing”

def smarts = SmartsNotificationDatasource.get(name:“SAM”)
smarts.addNotification(eventProps)

And OpenNMS?

def eventProps = [:] 
eventProps.uei =  “MyTestEvent”
eventProps.node =  “LabDevice1”
eventProps.source =  “RapidOSS”
eventProps.description = “creating an event for testing” 

def openNms = OpenNmsEventDatasource.get(name:"OpenNMS")
openNms.sendEvent(eventProps)

How about opening a ticket in the ticketing system?

def serviceDesk = RsTicket.get(name:"MyServiceDesk")
def props = [:]
props.object = "LabDevice1"
props.eventName = "Down"
props.description = “creating an event for testing”
serviceDesk.createTicket(props)

What if I just want to send an snmp trap to another management system?

def trap = SNMPTrap.get(name:"MoM")
def eventProps= [:]
eventProps.enterprise = ".1.3.6.1.4.1.88888.12"
eventProps.generic = 6
eventProps.specific = 1
eventProps.varbinds = []
trap.send(eventProps)

Note that RapidOSS is using a different interface/protocol behind the scenes for each of these systems. For Netcool JDBC (or SNMP Trap), for EMC/Smarts Java API, for OpenNMS TCP socket, etc. RapidOSS handles the complexities and idiosyncrasies of the interfaces provided by the external systems and providing the script developer a simple, consistent structure to work with, and all this without inventing a new, proprietary and crippled language (thanks to Groovy!)

  • Login or register to post comments

 Social Bookmark

  • Mashup comes to IT management: RapidInsight Google Maps integration
  • Managing Planned and Unplanned Maintenance with RapidOSS
  • RapidInsight: what is it good for? - Integration in the presentation layer
  • RapidInsight: what is it good for? - The broken client
  • RapidInsight SIMILE Timeline Integration

  • Create new account
  • Request new password