About agent functions

Agents carry out specific functions on resources. The functions an agent performs are called entry points.

For details on agent functions, see the Cluster Server Agent Developer's Guide.

Table: Agent functions describes the agent functions.

Table: Agent functions

Agent functions

Role

Online

Brings a specific resource ONLINE from an OFFLINE state.

Offline

Takes a resource from an ONLINE state to an OFFLINE state.

Monitor

Tests the status of a resource to determine if the resource is online or offline.

The function runs at the following times:

  • During initial node startup, to probe and determine the status of all resources on the system.

  • After every online and offline operation.

  • Periodically, to verify that the resource remains in its correct state. Under normal circumstances, the monitor entry point is run every 60 seconds when a resource is online. The entry point is run every 300 seconds when a resource is expected to be offline.

  • When you probe a resource using the following command:

    # hares -probe res_name -sys system_name.

imf_init

Initializes the agent to interface with the IMF notification module. This function runs when the agent starts up.

imf_getnotification

Gets notification about resource state changes. This function runs after the agent initializes with the IMF notification module. This function continuously waits for notification and takes action on the resource upon notification.

imf_register

Registers or unregisters resource entities with the IMF notification module. For example, the function registers the PID for online monitoring of a process. This function runs for each resource after the resource goes into steady state (online or offline).

Clean

Cleans up after a resource fails to come online, fails to go offline, or fails to detect as ONLINE when resource is in an ONLINE state. The clean entry point is designed to clean up after an application fails. The function ensures that the host system is returned to a valid state. For example, the clean function may remove shared memory segments or IPC resources that are left behind by a database.

Action

Performs actions that can be completed in a short time and which are outside the scope of traditional activities such as online and offline. Some agents have predefined action scripts that you can run by invoking the action function.

Info

Retrieves specific information for an online resource.

The retrieved information is stored in the resource attribute ResourceInfo. This function is invoked periodically by the agent framework when the resource type attribute InfoInterval is set to a non-zero value. The InfoInterval attribute indicates the period after which the info function must be invoked. For example, the Mount agent may use this function to indicate the space available on the file system.

To see the updated information, you can invoke the info agent function explicitly from the command line interface by running the following command:

hares -refreshinfo res [-sys system] -clus cluster | -localclus