URL
GET https://{api-url}/api/v2/tenants/{tenantId}/alerts/search
Sample URLs
https://{api-url}/api/v2/tenants/client_627314/alerts/search?pageNo=1&pageSize=2&isDescendingOrder=true&sortName=ts&queryString=clientIds:client_1,client_2+startDate:2015-06-10T05:39:51 0000+endDate:2015-08-10T05:39:51 0000+priority:P0,P1+states:CRITICAL,OK+uniqueId:10+deviceStatus:manage+resourceType:REDSHIFT+resourceIds:DEV0000015753,148e892d-84ce-496c-a123-f91e1a8a3f7d+actions:closed,ticketed+alertTypes:agent,obsolete+metrics:zenoss,xenapp+duration:7+alertTimeBase:updated+ticketId:INC0000000001
Parameters
All parameters are optional:
Field | Default Value |
---|---|
pageNo={pageNo} | 1 |
pageSize={pageSize} | 100 |
isDescendingOrder={true/false} | true |
sortName={field} | ts |
queryString={queryString} | NA |
viewId={viewId} | NA (Applicable only for saved view) |
statusHistory | NA |
NA indicates that the value is not applicable.
Query variables
Query Variable | Value | Description |
---|---|---|
states | Ok, Warning, Critical, Info | Current status of the alert. |
startDate | yyyy-MM-ddTHH:mm:ssZ | Filter the alert with alert base. startDate denotes the from date. Example: 2016-02-24T09:19:47 0000 (GMT) |
endDate | yyyy-MM-ddTHH:mm:ssZ | endDate denotes to date. Example: 2016-02-26T10:20:47 0000 (GMT) |
priority | P0, P1, P2, P3, P4, P5 | Priority of the alert. Example: P0, P1. Separate the values with a comma. |
uniqueId | NA | ID of the alert. |
deviceStatus | manage, unmanage, all | Status of the device. |
resourceType | LOAD_BALANCER, SQS, EBS, DEVICE, SNS, REDSHIFT, SERVICE | Type of resource. |
resourceIds | NA | ID of a resource. Example: DEV0000015754,148e892d-84ce-496c-a123-f91e1a8a3f7d. |
actions | ACKNOWLEDGED, TICKETED, CLOSED, IGNORE, SUPPRESSED, OPEN, PURGED, CORRELATED | Actions performed on the alert. Example: ACKNOWLEDGED, TICKETED. |
alertTypes | Monitoring, Maintenance, Appliance, Agent, Scheduled Maintenance, Obsolete, Integration Failure, all | Types of Alerts. Example: Maintenance, Appliance, Agent. |
metrics | NA | Metric type of the alert. Example: PING, SNMP Response. |
duration | 1, 7, 30 | Duration of alert. Duration is represented in Number of Days. Example: 1, 7. |
alertTimeBase | updated, created | Search for the alert based on the updated or created time of an alert. Example: updated. |
clientIds | NA | ID of clients. Example: client_1, client_2. Separate the IDs with a comma. |
ticketId | NA | ID of the ticket to which the alert is attached. Example: INC0000000001. |
apps | NA | Apps from which the alert is generated. Example: Email, Nagios |
Variables for statusHistory
The statusHistory parameter uses the following variables:
Variable | Description | Example |
---|---|---|
createdBy | Filter alerts based on createdUser. | system |
acknowledgedBy | Filter alerts based on acknowledgedUser. | superadmin |
suppressedBy | Filter alerts based on suppressedUser. | superadmin |
ticketedBy | Filter alerts based on ticketedUser. | opsramp_system_user |
closedBy | Filter alerts based on closedUser. | superadmin |
startAcknowledgedTime | 2015-08-10T05:39:51 0000 | |
endAcknowledgedTime | 2015-08-10T05:39:51 0000 | |
startSuppressedTime | 2015-08-10T05:39:51 0000 | |
endSuppressedTime | 2015-08-10T05:39:51 0000 | |
startTicketedTime | 2015-08-10T05:39:51 0000 | |
endTicketedTime | 2015-08-10T05:39:51 0000 | |
startClosedTime | 2015-08-10T05:39:51 0000 | |
endClosedTime | 2015-08-10T05:39:51 0000 |
Note
- Special characters to use in the query string are:
- (+) indicates next field and must be URL-encoded.
- (:) indicates Equals. An example is
key: value
. - (,) indicates multiple values for a key. An example is
priority: P0,P1
- Space characters must be URL-encoded.
Status code
200 OK
Sample response
{
"results" :
[
{
"uniqueId" : "389547",
"subject" : "Testing Alert-2-info state",
"currentState" : "Info",
"serviceName" : "Windows Event Log",
"acknowledged" : false,
"suppressed" : false,
"permanentlySuppressed" : false,
"closed" : false,
"ticketed" : false,
"clientUniqueId" : "client_593972",
"alertType" : "Monitoring",
"alertTime" : "2016-02-24T01:10:00+0000",
"device": {
"id": "018e9cc1-e7ec-4833-a2b7-e17bd41e1b68",
"name": "172.31.17.109",
"hostName": "",
"ipAddress": "172.31.17.109",
"type": "DEVICE",
"aliasName": "",
"resourceName": "172.31.17.109",
"resourceType": "Linux"
},
"resource": {
"id": "018e9cc1-e7ec-4833-a2b7-e17bd41e1b68",
"hostName": "",
"ipAddress": "172.31.17.109",
"type": "Linux",
"aliasName": "",
"name": "172.31.17.109",
"resourceName": "172.31.17.109",
"consoles": [],
"resourceType": "Linux",
"frequency": 0,
"paused": false,
"deleted": false,
"validateSSL": false,
"port": 0,
"encrypted": false,
"timeout": 0,
"days": 0,
"ts": 0,
"clientId": 0,
"locationOffset": 0,
"totalLocations": 0,
"receiverHostPort": 0
},
"repeatCount" : "1",
"tenantId" : 593972,
"status" : "New",
"priority" : "N/A",
"elapsedTimeString" : "4d 22h 21m ",
"createdDate" : "2016-02-24T01:15:00+0000",
"updatedTime" : "2016-02-24T09:19:47+0000",
"rba" : false,
"tenantName" : "Client_Test",
"managedByOpsRamp" : false,
"actedTs" : 0,
"eventType": "ALERT",
"metric" : "Windows Event Log",
"inferenceId": 0,
"statusHistory": {
"createdBy": "system",
"createdTime": "2016-02-24T01:15:00+0000",
}
},
{
"uniqueId" : "389548",
"subject" : "Testing Alert-1-info state",
"currentState" : "Info",
"serviceName" : "Windows Event Log",
"acknowledged" : false,
"suppressed" : false,
"permanentlySuppressed" : false,
"closed" : false,
"ticketed" : false,
"clientUniqueId" : "client_593972",
"alertType" : "Monitoring",
"alertTime" : "2016-02-24T01:00:00+0000",
"device": {
"id": "e3ef168f-dbb7-43f6-ad6a-c052a85be34f",
"name": "abc",
"hostName": "",
"ipAddress": "",
"type": "DEVICE",
"aliasName": "",
"resourceName": "abc",
"resourceType": "Desktop"
},
"resource": {
"id": "e3ef168f-dbb7-43f6-ad6a-c052a85be34f",
"hostName": "",
"ipAddress": "",
"type": "Desktop",
"aliasName": "",
"name": "abc",
"resourceName": "abc",
"consoles": [],
"resourceType": "Desktop",
"frequency": 0,
"paused": false,
"deleted": false,
"validateSSL": false,
"port": 0,
"encrypted": false,
"timeout": 0,
"days": 0,
"ts": 0,
"clientId": 0,
"locationOffset": 0,
"totalLocations": 0,
"receiverHostPort": 0
},
"repeatCount" : "1",
"tenantId" : 593972,
"status" : "New",
"priority" : "N/A",
"elapsedTimeString" : "4d 22h 21m ",
"createdDate" : "2016-02-24T01:15:00+0000",
"updatedTime" : "2016-02-24T09:19:47+0000",
"rba" : false,
"tenantName" : "Client_Test",
"managedByOpsRamp" : false,
"actedTs" : 0,
"eventType": "ALERT",
"metric" : "Windows Event Log",
"inferenceId": 0,
"statusHistory": {
"createdBy": "system",
"createdTime": "2016-02-24T01:15:00+0000",
}
},
{
"uniqueId" : "389546",
"subject" : "Testing Alert-3-info state",
"currentState" : "Info",
"serviceName" : "Windows Event Log",
"acknowledged" : false,
"suppressed" : false,
"permanentlySuppressed" : false,
"closed" : false,
"ticketed" : false,
"clientUniqueId" : "client_593972",
"alertType" : "Monitoring",
"alertTime" : "2016-02-24T02:20:00+0000",
"device": {
"id": "34b9b0f8-66df-4681-809e-dfd06fff3fa6",
"name": "0800270B9A7A",
"hostName": "0800270B9A7A",
"ipAddress": "172.24.132.131",
"type": "DEVICE",
"aliasName": "",
"resourceName": "",
"resourceType": "OpsRamp Gateway"
},
"resource": {
"id": "34b9b0f8-66df-4681-809e-dfd06fff3fa6",
"hostName": "0800270B9A7A",
"ipAddress": "172.24.132.131",
"type": "OpsRamp Gateway",
"aliasName": "",
"name": "0800270B9A7A",
"resourceName": "",
"consoles": [],
"resourceType": "OpsRamp Gateway",
"frequency": 0,
"paused": false,
"deleted": false,
"validateSSL": false,
"port": 0,
"encrypted": false,
"timeout": 0,
"days": 0,
"ts": 0,
"clientId": 0,
"locationOffset": 0,
"totalLocations": 0,
"receiverHostPort": 0
},
"repeatCount" : "1",
"tenantId" : 593972,
"status" : "New",
"priority" : "N/A",
"elapsedTimeString" : "4d 22h 21m ",
"createdDate" : "2016-02-24T02:50:00+0000",
"updatedTime" : "2016-02-24T09:19:47+0000",
"rba" : false,
"tenantName" : "Client_Test",
"managedByOpsRamp" : false,
"actedTs" : 0,
"eventType": "ALERT",
"metric" : "Windows Event Log",
"inferenceId": 0,
"statusHistory": {
"createdBy": "system",
"createdTime": "2016-02-24T01:15:00+0000",
}
}
],
"totalResults" : 3,
"orderBy" : "ts",
"pageNo" : 1,
"pageSize" : 4,
"totalPages" : 1,
"nextPage" : false,
"previousPageNo": 0,
"descendingOrder": true
}