Alert Source

Purpose of Alert Source Client

This example shows how a client can raise and clear an alert without requesting notification of alert events. No event loop is required since asynchronous event notification is not needed to accomplish this.

Code

main(
   int argc,
   char **argv
)
{
   /* Initialize the API.
      Application name = "alarm source"
      No application qualifier.
   */
   SPD_InitClient("alarm source", NULL);
 
   /* client processing... */
 
   /* Send an alarm:
      System is UNIX system named host02 (in the configuration).
      Alarm identifier is "alarm01".
      No alarm qualifier.
      Alarm text is "Emergency...".
      No alarm help text (default help file is "alarm01").
      External action is "plan9".
      Severity is critical.
      Application name and qualifier are the defaults.
      No time stamp.
   */
   SPD_SendAlarm("host", "host02", "alarm01", NULL,
      "Emergency in computer center", NULL, "plan9",
      SPD_criticalCN, NULL, NULL, 0);
 
 
   /* more client processing... */
 
   /* Clear the previously raised alarm:
      System is UNIX system named host02 (in the configuration).
      Alarm identifier is "alarm01".
      No alarm qualifier.
      No clear text
      No external action list
      Application name and qualifier are the defaults.
      No time stamp.
   */
   SPD_ClearAlarm("host", "host02", "alarm01", NULL, NULL, NULL,
        NULL, NULL, 0);
 
   /*  still more client processing... */
 
   /*  no event loop required if events are only sent,
       but not received.
   */
}

Data Flow Diagram

This illustration shows the flow of information for the alert source client.