Add Alert Properties as Arguments to Run a Program Example | Teradata Viewpoint - Example: Adding Alert Properties as Arguments to Run a Program - Teradata Viewpoint - Teradata Workload Management

Teradata® Viewpoint User Guide

Product
Teradata Viewpoint
Teradata Workload Management
Release Number
16.50
16.20
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
yqb1520516846011.ditamap
dita:ditavalPath
yqb1520516846011.ditaval
dita:id
B035-2206
lifecycle
previous
Product Category
Analytical Ecosystem
Suppose you want to use the script echoUsage.sh as a medium severity alert action for the Teradata system PROD1, weekends only, and track alerts in the Alert Viewer portlet. echoUsage.sh opens the program that monitors the performance of your system. The script reads in any arguments that appear on the command-line and runs the program using these arguments as run-time parameters. The program output includes information about the space usage on PROD1 if the current perm space that is used in any database on the PROD1 system exceeds 80%.
  1. Verify the Teradata Notification Service is running on the Linux server:
    1. Use the following Linux command to validate that the service is running correctly:
      /etc/init.d/tdnotification status
    2. If the result is not "running," use: /etc/init.d/tdnotification start
  2. Copy the script echoUsage.sh to the Linux server at : /opt/teradata/client/cam/tdnotification/usrcmd/echoUsage.sh.
    1. Make sure the script echoUsage.sh is executable by the tdnotification service user account.
  3. In the Alert Setup portlet, create an Action Set.
    1. From the Setup Options list, select Alert Presets.
    2. From the Preset Options list, select Core Hours.
    3. Verify the Weekend Hours displayed correspond to the weekend hours that you want for this alert action.
    4. From the Preset Options list, select Action Sets.
    5. Select "" next to Action Sets.
    6. In Action Set Name, type echoUsageSpaceUsedPct.
    7. From the Times check boxes, select Weekend, and clear the Core and Evening check boxes.
    8. Under Actions, make sure the Include in Alert Viewer check box is selected.
      This option is selected by default so you can view alerts for this action set in the Alert Viewer portlet.
    9. From the Actions list, select Run a program.
    10. From the Location list, select your Linux server.
    11. From the Program list, select echoUsage.sh.
      If the script does not appear in the list, verify that it exists at /opt/teradata/client/cam/tdnotification/usrcmd/echoUsage.sh.
    12. In the Arguments box, type -db ${databaseName} -sp ${spaceUsedPct}.
    13. Click Apply.
  4. In the Monitored Systems portlet for Teradata Viewpoint monitoring, configure PROD1.
    1. Next to Systems, select "", then select Add Teradata System.
    2. In System Nickname, type PROD1
    3. Select the Enable system check box to activate the PROD1 system for monitoring.
    4. In the TDPID box, type the TDPID of the PROD1 system.
    5. Enter a login name and password.
    6. Click Apply.
  5. In the Monitored Systems portlet, configure the data collectors.
    1. From the Systems list, select PROD1.
    2. From the Setup list, select Data Collectors.
    3. From the Data Collectors list, select Database Space.
    4. Select the Enable Database Space Collector check box and keep the default settings.
    5. Click Apply.
  6. In the Monitored Systems portlet, define alert rules.
    1. From the Systems list, select PROD1.
    2. From the Setup list, select Alerts.
    3. From the Alert Types list, select Database Space.
    4. Select "" next to Alerts.
    5. In Alert Name, type echoPermSpaceLow.
    6. Select the Enable alert check box.
    7. From the Severity list, select Medium.
    8. From the Alert Rules list, select Current Perm.
    9. In the box to the right of the greater-than symbol (>), type 80.
    10. Select "" then select the All databases except the selected databases below option and include all databases.
    11. From the Action list, select echoUsageSpaceUsedPct.
    12. Leave the value unchanged in the Do not run twice in minutes box.
    13. Click Apply.
  7. In the Alert Viewer portlet, review triggered actions.
    1. [Optional] Click Medium to filter the alerts in the portlet by normal severity.
    2. [Optional] In the SYSTEM NAME filter box, type PROD1 to view alerts for the PROD1 system.
    The alert or alert detail information that the Alert Viewer portlet displays does not include the output of the program or batch file.