Optionally, you can configure an alert threshold database connection, enable alerts and modify default alert notification settings, enable alert persistence to save the alerts to the database, store alert history to a history database, and define a history table name prefix to help differentiate alert history data between multiple data servers.
Perform the following steps to create an Alert Threshold Database connection:
The Edit Connection window displays.
Note: You can click on the Copy to clipboard and Paste links below the "edit box" prior to creating the connection to automatically include the default text into the window.
URL: The complete URL for the database connection.
Driver: The full name for the driver.
Classpath: The complete classpath for the jar location.
Username: The username is used when creating the connection. This field is optional.
Password: This password is used when creating the connection. This field is optional. By default, the password entered is hidden. Click the icon to view the password text.
Run Queries Concurrently: When selected, database queries are run concurrently.
The following settings determine whether or not alerts are enabled and when alert notifications are sent.
To modify the default alert notification settings:
Enable Alert Notifications: Selecting this toggle enables alert notifications to be sent. Select the Notification Platform, with the options being either Windows or Unix.
Notify on New Alerts: When selected, your action will be executed every time a new alert is created. Note: You must copy common/bin/my_alert_actions.bat/.sh to your project directory in order for this setting to work.
Notify on First Severity Change: When selected, your action will be executed the first time the severity changes for each alert. Note: You must copy common/bin/my_alert_actions.bat/.sh to your project directory in order for this setting to work.
Notify on Cleared Alerts: When selected, your action will be executed every time an alert is cleared. Note: You must copy common/bin/my_alert_actions.bat/.sh to your project directory and rename it to my_alert_actions.cleared. bat/.sh in order for this setting to work.
Periodically Renotify on Unacknowledged Alerts: When selected, your action will be executed on the Renotification Interval (in seconds) for each unacknowledged alert. Note: You must copy common/bin/my_alert_actions.bat/.sh to your project directory and rename it to my_alert_actions.renotify. bat/.sh in order for this setting to work.
Note:The syntax and commands used to format and send emails will depend on which mail service is available in your environment. Contact your mail administrator before starting this process.
Example mail commands
Example: Mailgun
curl -v -s --user api:key-fbbb5b150de9caa04655c6097cd50324 https://api.mailgun.net/v3/yourCompany.com/messages -F from=alerts@yourSendingemail.com -F to=yourRecieversEmail@yourComp.com -F subject="RTV ALERT-$ALERTNAME $ALERTINDEX" -F text="Alert Name=$ALERTNAME" -F text="Component Affected=$ALERTINDEX" -F text="Alert Identifier=$ALERTID"-F text="Alert Description=$ALERTTEXT" -F text="AlertSeverity=$ALERTSEVERITY"
Example: Mail-s
echo "DOMAINNAME=$DOMAINNAME, ALERTNAME=$ALERTNAME, ALERTINDEX=$ALERTINDEX, ALERTTEXT=$ALERTTEXT, ALERTID=$ALERTID, ALERTSEVERITY=$ALERTSEVERITY Thanks-IFS TIBCO ADMIN" | mail -s "RTV ALERT-$ALERTNAME" distributionlist@domain.com -c mail.receiver@domain.com -- -f from@domain.com
printf "DOMAINNAME=$DOMAINNAME\n ALERTNAME=$ALERTNAME\n ALERTINDEX=$ALERTINDEX\n ALERTTEXT=$ALERTTEXT\n ALERTID=$ALERTID\n ALERTSEVERITY=$ALERTSEVERITY TIBCO ADMIN" | mail -s "RTV ALERT-$ALERTNAME" support@domain.com -- -f forward@domain.com
The Persist Alerts option saves the alerts to the database for high availability purposes.
To enable the Persist Alerts option:
Enabling the Store Alert History option stores the alerts in the History database. This value is used in the Alerts Table (which makes it easier to find the alerts). See Configuring the Historian Database for more information.
To enable the Store Alert History option:
Before your changes can take effect, you must save your changes and restart your data server. To do so:
The button displays in the upper right-hand corner of the window.
If emails are not being sent, try the following troubleshooting steps:
#echo "----- Alert command script executed: DOMAINNAME=$DOMAINNAME, ALERTNAME=$ALERTNAME, ALERTINDEX=$ALERTINDEX, ALERTTEXT=$ALERTTEXT, ALERTID=$ALERTID, ALERTSEVERITY=$ALERTSEVERITY #####"
If you see entries in the log file such as:
“CmdOut for ./my_alert_actions.cleared.sh SL-SOLMON-1 +SolMsgRouterInboundByteRateHigh+ "+sgdemo+" +1269+ +1+ +High Warning Limit exceeded, current value: 45662.48734522234 limit: 1.0 - ----- Alert command script executed: DOMAINNAME=SL-SOLMON-1, ALERTNAME=SolMsgRouterInboundByteRateHigh, ALERTINDEX=sgdemo, ALERTTEXT=High Warning Limit exceeded, current value: 45662.48734522234 limit: 1.0, ALERTID=1269, ALERTSEVERITY=1 #####”
...then my_alert_actions.sh script is being executed.
If there are no entries in the log file, test that the script contains a valid command and a valid email destination.
Execute the command you created on the command line and make sure that the appropriate email notification was received. If not, then email alerts are not being received. Re-check your syntax and credentials and contact your email administrator.
If you see entries similar to the following in the dataserver.log:
CmdOut for ./my_alert_actions.sh SL-SOLMON-1 +SolMsgRouterInboundByteRateHigh+ "+solshare3+" +1386+ +1+ +High Warning Limit exceeded, current value: 50.28685457720129 limit: 1.0 - {
"id": "<20190227022659.1.E925C2FAE5F2C672@slsandbox.com>",
"message": "Queued. Thank you."
...then email alerts are being sent and you should contact your email administrator to understand why they are not being received.