Actions

Actions are associated with conditions. Actions are executed when the appropriate conditions are true with respect to a specific entity.

The HAM API includes several functions for different kinds of actions:

Action Description
ham_action_restart() This action restarts the entity
ham_action_execute() Executes an arbitrary command (e.g., to start a process)
ham_action_notify_pulse() Notifies some process that this condition has occurred. This notification is sent using a specific pulse with a value specified by the process that wished to receive this notify message.
ham_action_notify_signal() Notifies some process that this condition has occurred. This notification is sent using a specific realtime signal with a value specified by the process that wished to receive this notify message.
ham_action_notify_pulse_node() This is the same as ham_action_notify_pulse() above, except that the node name specified for the recipient of the pulse can be the fully qualified node name.
ham_action_notify_signal_node() This is the same as ham_action_notify_signal() above, except that the node name specified for the recipient of the signal can be the fully qualified node name.
ham_action_waitfor() Lets you insert delays between consecutive actions in a sequence. You can also wait for certain names to appear in the namespace.
ham_action_heartbeat_healthy() Resets the heartbeat mechanism for an entity that had previously missed sending heartbeats and had triggered a missed heartbeat condition, but has now recovered.
ham_action_log() Reports this condition to a logging mechanism.

Actions are also associated with symbolic names, which are unique within a specific condition.

What happens if an action itself fails? You can specify an alternate list of actions to be performed to recover from that failure. These alternate actions are associated with the primary actions through several ham_action_fail* functions: