Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

alert.c File Reference

#include "model.h"
#include "execphandler.h"

Defines

#define AWNOTIFY   "awnotify.sh"
#define JULIANS_PER_MIN   (0.04166667 / 60.0)

Functions

int32_t aw_model_alert_user_slist (aw_model_t *model, const aw_model_userhandle_t *handle, u_int32_t user_id, u_int32_t limit, aw_model_alert_slisting_t *alert_listing)
 Init itertator to fill listing with data from alert table for alerts NOT acknowledged. Call user_slisting->iter.next() until <= 0 .

int32_t aw_model_escalate_alert (aw_model_t *model, const aw_model_userhandle_t *handle)
 If an alert has not been acknowlege with specfied time period then alert next user in group.

int32_t aw_model_interface_alert (aw_model_t *model, const aw_model_userhandle_t *handle, u_int32_t interface_id, u_int32_t up, aw_timestamp_t tstamp)
 Generate an alert for an ia event.

int32_t aw_model_message_alert (aw_model_t *model, const aw_model_userhandle_t *handle, const byte_t *nodename, const byte_t *msg, aw_timestamp_t tstamp)
 Generate an alert for an nm event.

int32_t aw_model_service_alert (aw_model_t *model, const aw_model_userhandle_t *handle, u_int32_t service_id, u_int32_t up, aw_timestamp_t tstamp)
 Generate an alert for an sa event.


Define Documentation

#define AWNOTIFY   "awnotify.sh"
 

Alerts are generated for specific users based on the association between nodes and user groups held in aw_node2group. For each insert in an event table, a check is done to see if the node associated with the event has any user groups related to it via aw_node2group, if so, the user with the lowest priorityorder is chosen and a row is inserted into the aw_alert table. If that user has a notifymode, then a message is sent via that mode. Should the alert NOT be acknowledged in a specific period of time, then the user with the next highest priorityorder in the associated group is chosen and another row is inserted into the aw_alert table. These are tied together by the aid, which is the id for the inital row inserted.

#define JULIANS_PER_MIN   (0.04166667 / 60.0)
 


Function Documentation

int32_t aw_model_alert_user_slist (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
u_int32_t  user_id,
u_int32_t  limit,
aw_model_alert_slisting_t *  alert_slisting
) 
 

Init itertator to fill listing with data from alert table for alerts NOT acknowledged. Call user_slisting->iter.next() until <= 0 .

aw_model_alert_user_slist

Parameters:
model Model object
handle Handle object for current user
user_id For which user
limit Max number of rows
alert_slisting Short listing object to be filled
Returns:
0 on data and -1 on error

int32_t aw_model_escalate_alert (  aw_model_t *  model,
const aw_model_userhandle_t *  handle
) 
 

If an alert has not been acknowlege with specfied time period then alert next user in group.

aw_model_escalate_alert

Parameters:
model Model
handle Handle object for current user
Returns:
<=0 on error

int32_t aw_model_interface_alert (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
u_int32_t  interface_id,
u_int32_t  up,
aw_timestamp_t  tstamp
) 
 

Generate an alert for an ia event.

aw_model_interface_alert

Parameters:
model Model
handle Handle object for current user
interface_id Id in interface table
up 1 if up 0 if down
tstamp Timestamp of event
Returns:
<=0 on error

int32_t aw_model_message_alert (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
const byte_t *  nodename,
const byte_t *  msg,
aw_timestamp_t  tstamp
) 
 

Generate an alert for an nm event.

aw_model_message_alert

Parameters:
model Model
handle Handle object for current user
nodename Name of node to associate this alert
msg The event message
tstamp Timestamp of event
Returns:
<=0 on error

int32_t aw_model_service_alert (  aw_model_t *  model,
const aw_model_userhandle_t *  handle,
u_int32_t  service_id,
u_int32_t  up,
aw_timestamp_t  tstamp
) 
 

Generate an alert for an sa event.

aw_model_service_alert

Parameters:
model Model
handle Handle object for current user
service_id Id in service table
up 1 if up 0 if down
tstamp Timestamp of event
Returns:
<=0 on error

Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)