db2UpdateAlertCfg API - Update the alert configuration settings for health indicators

Updates the alert configuration settings for health indicators.

Important: This command or API has been deprecated and might be removed in a future release because the health monitor has been deprecated in Version 9.7. It is not supported in Db2® pureScale® environments. For more information, see Health monitor has been deprecated.

Authorization

One of the following authorities:
  • SYSADM
  • SYSCTRL
  • SYSMAINT

Required connection

Instance. If there is no instance attachment, a default instance attachment is created.

API include file

db2ApiDf.h

API and data structure syntax

SQL_API_RC SQL_API_FN
  db2UpdateAlertCfg (
   db2Uint32 versionNumber,
   void * pParmStruct,
   struct sqlca * pSqlca);

typedef SQL_STRUCTURE db2UpdateAlertCfgData
{
   db2Uint32 iObjType;
   char *piObjName;
   char *piDbName;
   db2Uint32 iIndicatorID;
   db2Uint32 iNumIndAttribUpdates;
   struct db2AlertAttrib *piIndAttribUpdates;
   db2Uint32 iNumActionUpdates;
   struct db2AlertActionUpdate *piActionUpdates;
   db2Uint32 iNumActionDeletes;
   struct db2AlertActionDelete *piActionDeletes;
   db2Uint32 iNumNewActions;
   struct db2AlertActionNew *piNewActions;
} db2UpdateAlertCfgData;

typedef SQL_STRUCTURE db2AlertAttrib
{
   db2Uint32 iAttribID;
   char *piAttribValue;
} db2AlertAttrib;

typedef SQL_STRUCTURE db2AlertActionUpdate
{
   db2Uint32 iActionType;
   char *piActionName;
   db2Uint32 iCondition;
   db2Uint32 iNumParmUpdates;
   struct db2AlertAttrib *piParmUpdates;
} db2AlertActionUpdate;

typedef SQL_STRUCTURE db2AlertActionDelete
{
   db2Uint32 iActionType;
   char *piName;
   db2Uint32 iCondition;
} db2AlertActionDelete;

typedef SQL_STRUCTURE db2AlertActionNew
{
   db2Uint32 iActionType;
   struct db2AlertScriptAction *piScriptAttribs;
   struct db2AlertTaskAction *piTaskAttribs;
} db2AlertActionNew;

typedef SQL_STRUCTURE db2AlertScriptAction
{
   db2Uint32 scriptType;
   db2Uint32 condition;
   char *pPathName;
   char *pWorkingDir;
   char *pCmdLineParms;
   char stmtTermChar;
   char *pUserID;
   char *pPassword;
   char *pHostName;
} db2AlertScriptAction;

typedef SQL_STRUCTURE db2AlertTaskAction
{
   char *pTaskName;
   db2Uint32 condition;
   char *pUserID;
   char *pPassword;
   char *pHostName;
} db2AlertTaskAction;

db2UpdateAlertCfg API parameters

versionNumber
Input. Specifies the version and release level of the structure passed as the second parameter pParmStruct.
pParmStruct
Input. A pointer to the db2UpdateAlertCfgData structure.
pSqlca
Output. A pointer to the sqlca structure.

db2UpdateAlertCfgData data structure parameters

iObjType
Input. Specifies the type of object for which configuration is requested. Valid values are:
  • DB2ALERTCFG_OBJTYPE_DBM
  • DB2ALERTCFG_OBJTYPE_DATABASES
  • DB2ALERTCFG_OBJTYPE_TABLESPACES
  • DB2ALERTCFG_OBJTYPE_TS_CONTAINERS
  • DB2ALERTCFG_OBJTYPE_DATABASE
  • DB2ALERTCFG_OBJTYPE_TABLESPACE
  • DB2ALERTCFG_OBJTYPE_TS_CONTAINER
piObjName
Input. The name of the table space or table space container when object type, iObjType, is set to DB2ALERTCFG_OBJTYPE_TABLESPACE or DB2ALERTCFG_OBJTYPE_TS_CONTAINER, otherwise set to NULL.
piDbName
Input. The alias name for the database for which configuration is requested when object type, iObjType, is DB2ALERTCFG_OBJTYPE_TS_CONTAINER, DB2ALERTCFG_OBJTYPE_TABLESPACE, and DB2ALERTCFG_OBJTYPE_DATABASE, otherwise set to NULL.
iIndicatorID
Input. The health indicator for which the configuration updates are to apply.
iNumIndAttribUpdates
Input. The number of alert attributes to be updated for the iIndicatorID health indicator.
piIndAttribUpdates
Input. A pointer to the db2AlertAttrib structure array.
iNumActionUpdates
Input. The number of alert actions to be updated for the iIndicatorID health indicator.
piActionUpdates
Input. A pointer to the db2AlertActionUpdate structure array.
iNumActionDeletes
Input. The number of alert actions to be deleted from the iIndicatorID health indicator.
piActionDeletes
Input. A pointer to the db2AlertActionDelete structure array.
iNumNewActions
Input. The number of new alert actions to be added to the iIndicatorID health indicator.
piNewActions
Input. A pointer to the db2AlertActionNew structure array.

db2AlertAttrib data structure parameters

iAttribID
Input. Specifies the alert attribute that will be updated. Valid values include:
  • DB2ALERTCFG_ALARM
  • DB2ALERTCFG_WARNING
  • DB2ALERTCFG_SENSITIVITY
  • DB2ALERTCFG_ACTIONS_ENABLED
  • DB2ALERTCFG_THRESHOLD_CHECK
piAttribValue
Input. The new value of the alert attribute. Valid values are:
  • DB2ALERTCFG_ALARM
  • DB2ALERTCFG_WARNING
  • DB2ALERTCFG_SENSITIVITY
  • DB2ALERTCFG_ACTIONS_ENABLED
  • DB2ALERTCFG_THRESHOLD_CHECK

db2AlertActionUpdate data structure parameters

iActionType
Input. Specifies the alert action. Valid values are:
  • DB2ALERTCFG_ACTIONTYPE_SCRIPT
  • DB2ALERTCFG_ACTIONTYPE_TASK
piActionName
Input. The alert action name. The name of a script action is the absolute pathname of the script. The name of a task action is a string in the form: task-numberical-ID.task-numberical-suffix.
iCondition
The condition on which to run the action. Valid values for threshold based health indicators are:
  • DB2ALERTCFG_CONDITION_ALL
  • DB2ALERTCFG_CONDITION_WARNING
  • DB2ALERTCFG_CONDITION_ALARM
For state based health indicators, use the numeric value defined in sqlmon.
iNumParmUpdates
Input. The number of action attributes to be updated in the piParmUpdates array.
piParmUpdates
Input. A pointer to the db2AlertAttrib structure.

db2AlertActionDelete data structure parameters

iActionType
Input. Specifies the alert action. Valid values are:
  • DB2ALERTCFG_ACTIONTYPE_SCRIPT
  • DB2ALERTCFG_ACTIONTYPE_TASK
piName
Input. The name of the alert action or the script action. The name of the script action is the absolute pathname of the script, whereas the name of the task action is a string in the form: task-numerical-ID.task-numerical-suffix.
iCondition
The condition on which to run the action. Valid values for threshold based health indicators are:
  • DB2ALERTCFG_CONDITION_ALL
  • DB2ALERTCFG_CONDITION_WARNING
  • DB2ALERTCFG_CONDITION_ALARM
For state based health indicators, use the numeric value defined in sqlmon.

db2AlertActionNew data structure parameters

iActionType
Input. Specifies the alert action. Valid values are:
  • DB2ALERTCFG_ACTIONTYPE_SCRIPT
  • DB2ALERTCFG_ACTIONTYPE_TASK
piScriptAttribs
Input. A pointer to the db2AlertScriptAction structure.
piTaskAttribs
Input. A pointer to the db2AlertTaskAction structure.

db2AlertScriptAction data structure parameters

scriptType

Specifies the type of script. Valid values are:

  • DB2ALERTCFG_SCRIPTTYPE_DB2CMD
  • DB2ALERTCFG_SCRIPTTYPE_OS
condition
The condition on which to run the action. Valid values for threshold based health indicators are:
  • DB2ALERTCFG_CONDITION_ALL
  • DB2ALERTCFG_CONDITION_WARNING
  • DB2ALERTCFG_CONDITION_ALARM
For state based health indicators, use the numeric value defined in sqlmon.
pPathname
The absolute pathname of the script.
pWorkingDir
The absolute pathname of the directory in which the script is to be executed.
pCmdLineParms
The command line parameters to be passed to the script when it is invoked. Optional for DB2ALERTCFG_SCRIPTTYPE_OS only.
stmtTermChar
The character that is used in the script to terminate statements. Optional for DB2ALERTCFG_SCRIPTTYPE_DB2CMD only.
pUserID
The user account under which the script will be executed.
pPassword
The password for the user account pUserId.
pHostName
The host name on which to run the script. This applies for both task and script.
Script
The hostname for where the script resides and will be run.
Task
The hostname for where the scheduler resides.

db2AlertTaskAction data structure parameters

pTaskname
The name of the task.
condition
The condition for which to run the action.
pUserID
The user account under which the script will be executed.
pPassword
The password for the user account pUserId.
pHostName
The host name on which to run the script. This applies for both task and script.
Script
The hostname for where the script resides and will be run.
Task
The hostname for where the scheduler resides.