SPD_SendUserAlarm

Purpose

Format and send an alert event to the Event Server. The event can specify names and values for one or more user-defined attributes.

Syntax

#include "spd.h"
SPD_errorTP SPD_SendUserAlarm(
   char *objectClass,
   char *objectName,
   char *alarmIdentifier,
   char *alarmQualifier,
   char *alarmText,
   char *helpText,
   char *externalActionList,
   SPD_alarmSeverityTP severity,
   char *application,
   char *applicationQualifier,
   time_t timeValue
   int attrCount,
   char*attrNames[]
   char*attrValues[]
);

Description

objectClass

identifies the object that is the source of the alert (for example, a system or application).

objectName

identifies the instance of the object class that is the source of the alert (for example, a system name or application name).

alarmIdentifier

identifies the type of alert being raised. This value can also be the name of the optional help text file for the alert, if the value you specify for parameter helpText is NULL. This value can also be the identifier of the external action list that is associated with raising this alert, if the value you specify for parameter externalActionList is NULL.

alarmQualifier

further qualifies the type of alert when alerts with the same alarmIdentifier are raised and must be kept distinct from one another. This parameter is optional. Specify NULL if the alert is not further qualified.

alarmText

is a description of the alert condition.

helpText

is used to provide help text for this alert. Help text is identified for this alert using the following set of rules:

externalActionList

is the identifier of the external action list that is associated with raising this alert. External action lists are defined in alert policies. If no external action list is associated with raising this alert, or if the identifier of the external action list is the same as the value specified for parameter alarmIdentifier, specify NULL.

severity

indicates the severity of the alert. See 8.1 for a list of values for the severity of an alert. Do not specify either SPD_clearCN or SPD_acknowledgeCN. Instead, use the function SPD_ClearAlarm to clear an alert, or the function SPD_AckAlarm to acknowledge an alert.

application

identifies the application that is raising the alert. Specify NULL if the application is the same as the application that you specified on the call to SPD_InitClient.

applicationQualifier

further qualifies the application in the case where more than one instance of the application may be present. Specify NULL if the application qualifier is the same as the application qualifier that you specified on the call to SPD_InitClient.

timeValue

is the local time to be associated with the alert. Specify the result of the C time function, or 0 if you want no local time to be associated with raising the alert.

attrCount

is the number of user-defined attributes specified by the parameters attrNames and attrValues.

attrNames

is an array of names of any user-defined attributes you want to specify for the alert. There must be attrCount entries in this array. It is the responsibility of the calling program to allocate the memory for this array. There is a one-to-one correspondence between the entries in the arrays attrNames and attrValues. Names in this array cannot be NULL or null strings.

attrValues

is an array of values of any user-defined attributes you want to specify for the alert. There must be attrCount entries in this array. It is the responsibility of the calling program to allocate the memory for this array. There is a one-to-one correspondence between the entries in the arrays attrNames and attrValues. Values in this array can be NULL or null strings, in which case a null string is reported as the attribute value to the receiver of the event report.

Return Value

The return value indicates whether an error occurred, as follows:

Return

Indicates

SPD_normalCN

No error

SPD_notInitializedCN

SPD_InitClient not called previously

SPD_badClassCN

Bad objectClass parameter

SPD_badNameCN

Bad objectName parameter

SPD_badAlarmIdCN

Bad alarmIdentifier parameter

SPD_badAlarmQualifierCN

Bad alarmQualifier parameter

SPD_badAttributeCN

NULL user-defined attribute name

SPD_badTextCN

Bad alarmText parameter

SPD_badSeverityCN

Bad severity parameter

SPD_commFailureCN

Communications problem

See Also

See also the following client functions: