Outgoing REST notifications in vRealize Operations bugs/issues

It is well known that administrators can configure outbound alert instances within vRealize Operations (see Fig 1).

The Rest notification plugin is especially interesting, when there is another ticket system, which should receive vRealize Operations alerts.
In that case, you have to write your own web service for receiving alerts from vRealize Operations. The documentation already provides sample files for XML and JSON

{
„startDate“:1369757346267,
„criticality“:“ALERT_CRITICALITY_LEVEL_WARNING“,
„resourceId“:“sample-object-uuid“,
„alertId“:“sample-alert-uuid“,
„status“:“ACTIVE“,
„subType“:“ALERT_SUBTYPE_AVAILABILITY_PROBLEM“,
„cancelDate“:1369757346267,
„resourceKind“:“sample-object-type“,
„adapterKind“:“sample-adapter-type“,
„type“:“ALERT_TYPE_APPLICATION_PROBLEM“,
„resourceName“:“sample-object-name“,
„updateDate“:1369757346267,
„info“:“sample-info“
}

If you select application/xml, the body of the POST or PUT calls that are sent have the following format:

<alert>
<startDate>1369757346267</startDate>
<criticality>ALERT_CRITICALITY_LEVEL_WARNING</criticality>
<resourceId>sample-object-uuid</resourceId>
<alertId>sample-alert-uuid</alertId>
<status>ACTIVE</status>
<subType>ALERT_SUBTYPE_AVAILABILITY_PROBLEM</subType>
<cancelDate>1369757346267</cancelDate>
<resourceKind>sample-object-type</resourceKind>
<adapterKind>sample-adapter-type</adapterKind>
<type>ALERT_TYPE_APPLICATION_PROBLEM</type>
<resourceName>sample-object-name</resourceName>
<updateDate>1369757346267</updateDate>
<info>sample-info</info>
</alert>

Within a project I had to implement such a web service. However, it turned out that the documentation is wrong, there are other elements that are transmitted as well:

• Risk
• Health
• Efficiency

Furthermore, there is also a bug in vRealize Operations. With the XML payload. While the content-header is correctly set to application/xml, the actual body is sent in JSON format nevertheless.

To clarify things, here is the data going over the wire, when clicking on the Test button:

POST XML Body{„cancelDate“:1425631300408,“updateDate“:1425631300408,“resourceId“:“test“,“adapterKind“:“test“,“Health“:0,“criticality“:“ALERT_CRITICALITY_LEVEL_INFO“,“Risk“:0,“resourceName“:“test“,“type“:“ALERT_TYPE_TIER“,“resourceKind“:“test“,“Efficiency“:0,“subType“:“ALERT_SUBTYPE_SMART_KPI_BREACH“,“alertId“:“test“,“startDate“:1425631300408,“info“:“test“,“status“:“ACTIVE“}
——-
Header{content-length=[363], host=[10.10.1.71:443], connection=[Keep-Alive], user-agent=[Apache-HttpClient/4.1.3 (java 1.
5)], Content-Type=[application/xml;charset=UTF-8]}
PUT XML Body{„cancelDate“:1425631300408,“updateDate“:1425631300408,“resourceId“:“test“,“adapterKind“:“test“,“Health“:0,“criticality“:“ALERT_CRITICALITY_LEVEL_INFO“,“Risk“:0,“resourceName“:“test“,“type“:“ALERT_TYPE_TIER“,“resourceKind“:“test“,“Efficiency“:0,“subType“:“ALERT_SUBTYPE_SMART_KPI_BREACH“,“alertId“:“test“,“startDate“:1425631300408,“info“:“test“,“status“:“ACTIVE“}
——
Header{content-length=[363], host=[10.10.1.71:443], connection=[Keep-Alive], user-agent=[Apache-HttpClient/4.1.3 (java 1.5
)], Content-Type=[application/xml;charset=UTF-8]}
POST JSON Body{„cancelDate“:1425631319242,“updateDate“:1425631319242,“resourceId“:“test“,“adapterKind“:“test“,“Health“:0,“criticality“:“ALERT_CRITICALITY_LEVEL_INFO“,“Risk“:0,“resourceName“:“test“,“type“:“ALERT_TYPE_TIER“,“resourceKind“:“test“,“Efficiency“:0,“
subType“:“ALERT_SUBTYPE_SMART_KPI_BREACH“,“alertId“:“test“,“startDate“:1425631319242,“info“:“test“,“status“:“ACTIVE“}
——
JSON Header{content-length=[363], host=[10.10.1.71:443], connection=[Keep-Alive], user-agent=[Apache-HttpClient/4.1.3 (java 1
.5)], Content-Type=[application/json;charset=UTF-8]}
PUT JSON Body{„cancelDate“:1425631319242,“updateDate“:1425631319242,“resourceId“:“test“,“adapterKind“:“test“,“Health“:0,“criticali
ty“:“ALERT_CRITICALITY_LEVEL_INFO“,“Risk“:0,“resourceName“:“test“,“type“:“ALERT_TYPE_TIER“,“resourceKind“:“test“,“Efficiency“:0,“subType“:“ALERT_SUBTYPE_SMART_KPI_BREACH“,“alertId“:“test“,“startDate“:1425631319242,“info“:“test“,“status“:“ACTIVE“}
——
JSON Header{content-length=[363], host=[10.10.1.71:443], connection=[Keep-Alive], user-agent=[Apache-HttpClient/4.1.3 (java 1.
5)], Content-Type=[application/json;charset=UTF-8]}

 

Fig 1: Configuring an outbound alert instance

Fig 1: Configuring an outbound alert instance

 

 

 

 

Kommentar absenden

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert