Search alerts

This endpoint is used to search alerts.

Leave Feedback

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:

FieldDefault 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)
statusHistoryNA

NA indicates that the value is not applicable.

Query variables

Query VariableValueDescription
statesOk, Warning, Critical, InfoCurrent status of the alert.
startDateyyyy-MM-ddTHH:mm:ssZFilter the alert with alert base. startDate denotes the from date.

Example: 2016-02-24T09:19:47 0000 (GMT)
endDateyyyy-MM-ddTHH:mm:ssZendDate denotes to date.

Example: 2016-02-26T10:20:47 0000 (GMT)
priorityP0, P1, P2, P3, P4, P5Priority of the alert.

Example: P0, P1. Separate the values with a comma.
uniqueIdNAID of the alert.
deviceStatusmanage, unmanage, allStatus of the device.
resourceTypeLOAD_BALANCER, SQS, EBS, DEVICE,

SNS, REDSHIFT, SERVICE
Type of resource.
resourceIdsNAID of a resource.

Example: DEV0000015754,148e892d-84ce-496c-a123-f91e1a8a3f7d.
actionsACKNOWLEDGED, TICKETED, CLOSED, IGNORE,

SUPPRESSED, OPEN, PURGED, CORRELATED
Actions performed on the alert.

Example: ACKNOWLEDGED, TICKETED.
alertTypesMonitoring, Maintenance, Appliance, Agent, Scheduled Maintenance, Obsolete, Integration Failure, allTypes of Alerts.

Example: Maintenance, Appliance, Agent.
metricsNAMetric type of the alert.

Example: PING, SNMP Response.
duration1, 7, 30Duration of alert. Duration is represented in Number of Days.

Example: 1, 7.
alertTimeBaseupdated, createdSearch for the alert based on the updated or created time of an alert.

Example: updated.
clientIdsNAID of clients.

Example: client_1, client_2. Separate the IDs with a comma.
ticketIdNAID of the ticket to which the alert is attached.

Example: INC0000000001.
appsNAApps from which the alert is generated. Example: Email, Nagios

Variables for statusHistory

The statusHistory parameter uses the following variables:

VariableDescriptionExample
createdByFilter alerts based on createdUser.system
acknowledgedByFilter alerts based on acknowledgedUser.superadmin
suppressedByFilter alerts based on suppressedUser.superadmin
ticketedByFilter alerts based on ticketedUser.opsramp_system_user
closedByFilter alerts based on closedUser.superadmin
startAcknowledgedTime2015-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

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
  }