GET alerts
Returns a list of MC alerts, their current status, and database properties.
Resource URL
https://<MC_NODE>:5450/webui/api/alerts
Authentication
Requires an MC-User-Apikey in the request header.
Filter parameters
types |
The type of alert to retrieve. Valid values are:
|
category |
For information, see Thresholds category filter. |
db_name |
For information, see Database name category filter. |
limit |
The maximum number of alerts to retrieve. If the limit is lower than the number of existing alerts, Vertica retrieves the most recent alerts. Used with the type parameter, Vertica retrieves up to the limit for each type. For example, for a limit of five and types of critical and emergency, you could receive up to ten total alerts. |
time_from |
The timestamp start point from which to retrieve alerts. You can use this parameter in combination with the If you provide only the |
time_to |
The timestamp end point from which to retrieve alerts. You can use this parameter in combination with the If you provide only the |
Example request
GET |
https://<MC_NODE>:5450/webui/api/alerts?types=critical |
Request alerts using cURL
This example shows how you can request alerts using cURL. In this example, the limit
parameter is set to '2' and the types
parameters is set to info
and notice
:
curl -H "MC-User-ApiKey: ValidUserKey" https://<MC_NODE>:5450/webui/api/alerts?limit=2&types=info,notice
Response:
[
{
"alerts":[
{
"id":5502,
"markedRead":false,
"eventTypeCode":0,
"create_time":"2016-02-02 05:12:10.0",
"updated_time":"2016-02-02 15:50:20.511",
"severity":"warning",
"status":1,
"nodeName":"v_vmart_node0001",
"databaseName":"VMart",
"databaseId":1,
"clusterName":"1449695416208_cluster",
"description":"Warning: Low disk space detected (73% in use)",
"summary":"Low Disk Space",
"internal":false,
"count":3830
},
{
"id":5501,
"markedRead":false,
"eventTypeCode":2,
"create_time":"2016-02-02 05:12:02.31",
"updated_time":"2016-02-02 05:12:02.31",
"severity":"notice",
"status":1,
"databaseName":"VMart",
"databaseId":1,
"clusterName":"1449695416208_cluster",
"description":"Analyze Workload operation started on Database",
"summary":"Analyze Workload operation started on Database",
"internal":false,
"count":1
}
],
"total_alerts":190,
"request_query":"limit=2",
"request_time":"2016-02-02 15:50:26 -0500"
}
]
Request alerts within a time range
These examples show various ways in which you can request the same alert as in the preceding example, but within specified time ranges.
Request the alert within a specific time range, using the time_from
and time_to
parameters:
curl -H "MC-User-ApiKey: ValidUserKey" https://<MC_NODE>:5450/webui/api/alerts?types=info,notice&time_from=2016-01-01T12:12&time_to=2016-02-01T12:12
Request the alert from a specific start time to the present using the time_from
parameter:
curl -H "MC-User-ApiKey: ValidUserKey" https://<MC_NODE>:5450/webui/api/alerts?types=info,notice&time_from=2016-01-01T12:12
Request the alert to a specific end point using the time_to
parameter. When you use the time_to
parameter without the time_from
parameter, the time_from
parameter defaults to the oldest alerts your MC contains:
curl -H "MC-User-ApiKey: ValidUserKey" https://<MC_NODE>:5450/webui/api/alerts?types=info,notice&time_to=2016-01-01T12:12