RPC API: Get Alerts
Note that LogicMonitor has a REST API equivalent for this API available.
The LogicMonitor API allows users to manage alerts programmatically with the getAlerts call. With the getAlerts call you can retrieve information about alerts in your LogicMonitor account. Add filter parameters to narrow down the number of alerts returned. If no input parameters are specified, alert data for all alerts will be returned. LogicMonitor limits the number of alerts returned by getAlerts in cases where a large number of alerts are being requested. Therefore, if you are retrieving alert data for a large number of alerts, you’ll need to use multiple getAlerts requests to get the data (using start and results parameters).
Notes:
- As with all of our API calls, authentication is required.
- The getAlerts RPC will only return alerts that a user has permission to view
getAlerts
Request Parameters: You can include the following as query parameters in a getAlerts request:
All outputs will be in the format: { [status], [data], [errmsg] }, where status is the status of the response, errmsg is the error message associated with the response, and the data object includes the following:
Example
More getAlerts examples
The following example returns the 1st to 100th alerts (0-based) in apiAccount by specifying start and results:
The following example returns alerts 100-200 in apiAccount by specifying start and results:
The following example returns all alerts for the host group “webservers”:
The following example returns all non-acknowledged alerts for the host group “webservers”:
The following example returns all alerts for the datasource “WinLogicDisk” of the host “Server1”, where returned alerts are sorted by the alert starting time in descending order: