Create an Alert Rule with Email Notification from the Director Console API
The AlertRules API allows you to create an alert rule and select the medium to notify you of the generated incidents on behalf a Fabric-enabled LogPoint. You can receive notifications via email, SSH, SNMP, HTTP, or Syslog.
The following diagram displays the APIs used while creating an alert rule with email notification from the Director Console API.
Follow the steps mentioned below to create an alert rule with email notification from the Director Console API.
Create a Repo
Execute the Repos - Create API in the Director Console API.
Note
Skip this step if you have the required log storage repositories.
Create an Incident User Group
Create an Incident User Group from the LogPoint user interface.
Note
Skip this step if you have the required incident user group(s).
Create a User
Create a User from the LogPoint user interface.
Note
Skip this step if you have the required user(s).
Create an Alert Rule
Execute the Repos - FetchRemoteRepo API to obtain the value of the address parameter. Use this value in the repos parameter of the AlertRules - Create API.
Execute the Users - FetchUsers API to obtain the value of the id parameter.
Use the id of the user owning the alert rule in the owner parameter of the AlertRules - Create API.
Use the id of the user monitoring the generated incidents in the assigned_to parameter of the AlertRules - Create API. This user has the rights to view, re-assign, comment on, and resolve the incidents.
Execute the IncidentUserGroups - FetchIncidentUsers API to obtain the value of the id parameter. Use the id of the user who monitors the generated incidents in the managed_by parameter of the AlertRules - Create API. This user has the rights to view, re-assign, and comment on the incidents.
Execute the AlertRules - Create API with the remaining parameters.
Configure Email Notification in the Alert Rule
Execute the AlertRules - FetchMyRules API to obtain the value of the id parameter. Use this value in the id parameter of the AlertRules - EmailNotification API.
Execute the AlertRules- EmailNotification API with the remaining parameters.
Sample API Requests and Responses for Creating an Alert Rule with Email Notification
Create a Repo
Execute the Repos - Create API.
This step successfully creates a repo.
Create an Alert Rule
Execute the Repos - FetchRemoteRepo API to obtain the value of the address parameter.
Execute the IncidentUserGroups - FetchIncidentUserGroup API to obtain the value of the id parameter.
Note
Configure the required incident user group from the user interface of the Fabric-enabled LogPoint.
Execute the Users - FetchUsers API to obtain the value of the id parameter.
Execute the AlertRules - Create API. Use the values of the address parameter obtained from step 1 in the repos parameter, the id parameter obtained from step 2 in the managed_by parameter and the values of id parameter obtained from step 3 in the owner (owns the alert rule) and assigned_to (manages the generated incidents) parameter of the API.
This step successfully creates an alert rule for a Fabric-enabled LogPoint.
Configure Email Notification in the Alert Rule
Execute the SystemSettingsSMTP - Save API with the required parameters to enable SMTP settings.
Execute the AlertRules - FetchMyRules API to obtain the value of the id parameter.
Execute the AlertRules - EmailNotification API with the required parameters in the request body of the API. Use the value of the id parameter obtained from step 2 in the id parameter of the AlertRules - EmailNotification API URL.
This step successfully configures an email notification in the alert rule.
Last updated
Was this helpful?