Get alert history
get
/serviceapi/eventServices/alerts/{alertId}/history
Retrieves list of messages associated with the alert along with corresponding timestamps.
Request
Supported Media Types
- application/json
Path Parameters
-
alertId: string
The id of the alert
Query Parameters
-
limit(optional): integer(int32)
the number of entries in the result to be returend in one REST callDefault Value:
50
-
offset(optional): integer(int32)
the offset into the result list when doing a query with limitDefault Value:
0
Response
Supported Media Types
- application/json
200 Response
query was successful
Root Schema : ItemListHistoryElements
Type:
object
It is describing the list of history elements returned in response to an alert history request.
-
count:
integer(int32)
The number of items in the list
-
hasMore:
boolean
Default Value:
false
Indicates if there are more items -
items:
array items
The items
-
nextLink(optional):
string
The link to get the next chunk of items (if paging)
-
previousLink(optional):
string
The link to the previous chunk of items (if paging)
Nested Schema : items
Type:
array
The items
Show Source
-
Array of:
object HistoryElement
It provides a message associated with the alert and its time.
Nested Schema : HistoryElement
Type:
object
It provides a message associated with the alert and its time.
-
message:
string
The messageExample:
Sent email to demo_user@xyz_company.com
-
time:
string
The message time in UTCExample:
2020-09-02T19:41:53.281Z
400 Response
The alert id is invalid
Root Schema : InvalidRequest
Type:
object
When invalid alert API request is received, alert system returns this response.
-
errorCode:
string
The alert system's internal error code
-
errorMessage:
string
The alert system's internal error message
-
httpMessage:
string
The http error message
-
httpStatusCode:
string
Default Value:
400
The http status code
500 Response
encountered unhandled exception
Root Schema : UnhandledException
Type:
object
When alert system runs into unhandled exception, it returns this response.
-
errorCode:
string
Default Value:
general_error
The alert system's error code for unhandled exception -
errorMessage:
string
Default Value:
Internal Server Error
The alert system's error message for unhandled exception -
httpMessage:
string
Default Value:
Internal Server Error
The http error message -
httpStatusCode:
string
Default Value:
500
The http status code
Examples
Get alert history
curl -u ${OMC_USERNAME}:${PASSWORD} -X GET "https://serverurl/serviceapi/eventServices/alerts/62965132339213727047162539738389170623/history"
The response might look like the following:
{ "items": [ { "time": "2020-07-20T19:01:59.248Z", "message": "Alert was automatically cleared: There was no update for the past seven days. Notifications will be skipped. Associated tickets, if any, will be updated." }, { "time": "2020-07-13T19:00:22.532Z", "message": "Sent email to demo_user@xyz_company.com" }, { "time": "2020-07-13T19:00:11.133Z", "message": "Critical Alert: CPU Utilization for demo_host.some_domain.com is 95.75 %; it is greater than expected value of 95 % for 10 minutes" } ], "hasMore": false, "count": 3 }Back to Top