dssalertconfig - DSS 6 | Data Source Solutions Documentation
Documentation: dssalertconfig - DSS 6 | Data Source Solutions Documentation
dssalertconfig
Usage
<b>dssalertconfig</b> [<b>-R</b><em>url</em>] <em>hub</em>List all the alerts configured on the hub.<b>dssalertconfig</b> [<b>-R</b><em>url</em>] <em>hub alert</em>List the properties of the alert configured on the hub.<b>dssalertconfig</b> [<b>-R</b><em>url</em>] [<b>-o</b><em>jsonfile</em>] <em>hub alert</em> [<em>property</em>]...Print the specified alert properties (property...) configured on the hub, or all if none are specified.<b>dssalertconfig</b> [<b>-R</b><em>url</em>] [<b>-i</b><em>jsonfile</em>] <em>hub alert</em> [<em>property</em>=[<em>value</em>]]...Set or unset the specific alert properties supplied in the jsonfile and/or directly on the command line.<b>dssalertconfig</b> [<b>-R</b><em>url</em>] <b>-a</b> [<b>-i</b><em>jsonfile</em>] <em>hub alert</em> [<em>property</em>=<em>value</em>]...Replace all the existing properties of the alert configured on the hub with a new set of properties supplied in the jsonfile and/or directly set on the command line (property=value...).<b>dssalertconfig</b> [<b>-R</b><em>url</em>] <b>-c</b> <em>hub alert</em> <em>property</em>=<em>value</em>...Create an alert on the hub with specified properties and set values for the properties (property=value...).<b>dssalertconfig</b> [<b>-R</b><em>url</em>] <b>-d</b> <em>hub alert</em>Delete the alert configured on the hub.<b>dssalertconfig</b> [<b>-R</b><em>url</em>] <b>-D</b> <em>hub alert</em>Disable the alert configured on the hub.<b>dssalertconfig</b> [<b>-R</b><em>url</em>] <b>-C</b> <em>hub alert</em>Clear the alert configured on the hub.<b>dssalertconfig</b> [<b>-R</b><em>url</em>] <b>-t</b><em> hub alert</em>Test the alert configured on the hub.<b>dssalertconfig</b> [<b>-R</b><em>url</em>] <b>-e</b><em> hub alert</em>Execute the alert configured on the hub.
Description
The dssalertconfig command allows you to create an alert and manage the existing alerts. DSS alerts scan the hub server log files and, according to their configuration properties, send notifications about any issues encountered (errors, warnings, latency threshold exceeded).
Argument <em>hub</em> specifies the name of a hub on which an alert(s) are configured. Argument <em>alert</em> specifies the name of an alert.
When you create an alert (using option <b>-c</b>), an alert configuration file (alert_name.conf) is created in the DSS_CONFIG/hubs/hub/alerts directory. The file contains the alert configuration properties specified when the alert was created, i.e. every alert has a certain set of alert properties. For an alert, you always must specify the type of notification: Email, SNS, Slack, or SNMP. If you want to receive alert notifications of different types, e.g. via email and Slack, separate alerts need to be configured.
The dssalertmanager command is responsible for executing all the alerts configured on the hub server.
For the alert properties that can be configured using this command, see section Alert Properties.
Command dssalertconfig corresponds to the Alerts dialog in the User Interface.
Options
This section describes the options available for the dssalertconfig command.
| Parameter | Description |
|---|---|
-a |
Replace the existing alert properties with a new set of alert properties. The new set of alert properties may be supplied directly in the command line or from a JSON file using option The following syntaxes are applicable:
|
-c |
Create an alert. This option requires alert property Notification_Type to be specified, and other properties depending on the notification type you specify. For specific examples, see Create Email alert, Create SNS alert, Create SNMP alert. In the User Interface, this option corresponds to the New Alert dialog. |
-C |
Clear and enable an alert. This option enables an alert (if disabled) and disregards any pending errors, so that only new errors will be reported the next time the alert is run. If an alert is already enabled, it just disregards pending errors. There can be multiple alerts configured on a hub (for example for different notification types: Email, Slack. etc), but some of them could be disabled. When dssalertmanager runs, it will not execute the disabled alerts. For example, the following command enables alert myalert. dssalertconfig -C myhub myalert
|
-d |
Delete an alert. For example, the following command deletes alert myalert: dssalertconfig -d myhub myalert
|
-D |
Disable an alert. It will not be executed until it is enabled again. For example, the following command disables alert myalert: dssalertconfig -D myhub myalert
|
-e |
Execute an alert. For example, the following command executes alert myalert:dssalertconfig -e myhub myalert
|
-Ex |
Override automatic encoding/decoding of string properties when reading a property from file using When this option is not used, the Valid values of
|
-ijsonfile |
Read property values from a JSON file dssalertconfig -i alert_props.json -c myhub myalert
|
-ojsonfile |
Write the specified properties to a JSON file For example, the following command writes the listed properties into the alert_props.json file (this should be a single line without wrapping). dssalertconfig -o alert_props.json myhub myalert Notification_Type=EMAIL Email_SMTP_Server=smtp.mycorp.com Email_SMTP_Starttls=true
dssalertconfig -o myalert_props.json myhub myalert
|
-Rurl |
Remote hub server. Access the hub server running on a remote machine, via the REST interface. This option is required for remote CLI access. When using this option, command dsslogin should be run first, for authentication. For example, the following command deletes alert myalert on a remote hub server:dssalertconfig -R http://node:port -d myhub myalert
|
-t |
Test an alert to verify if notification settings (Slack, email, etc) are properly configured. For example, the following command sends a test notification defined in alert myalert: dssalertconfig -t myhub myalert
|
-Vaccessmeth |
Handle classified data.
|
Examples
This section provides examples of using the dssalertconfig command.
Example 1. Get alert properties
The following command prints the value of property Repeat_Interval of alert myalert.
dssalertconfig myhub myalert Repeat_Interval
Example 2. Set alert properties
-
The following command sets property Repeat_Interval to value 500 for alert myalert.
dssalertconfig myhub myalert Repeat_Interval=500 -
The following command sets the properties specified in the alert_props.json file for alert myalert.
dssalertconfig -i alert_props.json myhub myalert -
The following command sets properties specified in the alert_props.json file and property Repeat_Interval for alert myalert.
dssalertconfig -i alert_props.json myhub myalert Repeat_Interval=500If the agent_props.json file contains properties that are already set for alert, option
<b>-i</b>will override these properties.For example, the following properties are currently set: **Notification_Type**, **SNS_Destination**, **SNS_Access_Key_Id**, **SNS_Secret_Access_Key**, and **Repeat_Interval**. The **agent_props.json** file contains property **Repeat_Interval**. Option `<b>-i</b>` will override the current value of property **Repeat_Interval** only.Example 3. Unset alert properties
The following command unsets property Repeat_Interval of alert myalert.
dssalertconfig myhub myalert Repeat_Interval=Example 4. Replace alert properties
-
The following command replaces the properties of alert myalert with the properties supplied in the alert_props.json file.
dssalertconfig -a -i alert_props.json myhub myalert -
The following command replaces the current email recipient with a new recipient joe@mycorp.com (this should be a single line without wrapping).
dssalertconfig -a myhub myalert Notification_Type=EMAIL Email_SMTP_Server=smtp.mycorp.com Email_Recipients[0]=joe@mycorp.com -
The following command replaces the properties of alert myalert with the properties supplied in the alert_props.json file and property Repeat_Interval.
dssalertconfig -a -i alert_props.json myhub myalert Repeat_Interval=500The properties supplied directly on the command line will override the relevant properties in the alert_props.json file.
Example 5. Create Email alert
The following command creates an Email alert myalert with multiple properties that sends email notifications to joe@mycorp.com and jane@mycorp.com (this should be a single line without wrapping).
dssalertconfig -c myhub myalert Notification_Type=EMAIL Email_Recipients[++]=joe@mycorp.com Email_Recipients[++]=jane@mycorp.com Email_SMTP_Server=smtp.mycorp.com Email_SMTP_Starttls=true Ignore_Patterns=F_JT* Message_Error_Limit=10 Add_DSS_Event=true Repeat_Interval=10 Specific_Locations[++]=myloc Specific_Channels[++]=mychannelExample 6. Create SNS alert
The following command creates an SNS alert (this should be a single line without wrapping).
dssalertconfig -c myhub sns_alert Notification_Type=SNS SNS_Destination=arn:aws:sns:eu-west-1:6675700182:test SNS_Access_Key_Id=KNDTMY7FTX0KSDRRNTPV SNS_Secret_Access_Key=K9D7G6mm6ZOi9DReodELDmLNC/1FcExample 7. Create SNMP alert
The following command creates an SNMP alert (this should be a single line without wrapping).
dssalertconfig -c myhub snmp_alert Notification_Type=SNMP SNMP_Hostname=localhost SNMP_Port=189 SNMP_Community=public SNMP_Heartbeat=true SNMP_Version=V2C
-