Agent functions

Online

Runs the executable that you specify in the value of the StartProgram attribute. Runs the executable with the specified parameters in the context of the specified user.

To bring the resource online, the agent function performs the command:

su [-] user -c executable_to_online_resource

Offline

Runs the executable that you specify in the value of the StopProgram attribute. Runs the executable with the specified parameters in the context of the specified user.

To take the resource offline, the agent function performs the command:

su [-] user -c executable_to_offline_resource

Monitor

If you specify the MonitorProgram attribute, the agent executes the user defined MonitorProgram in the user-specified context. If you specify the PidFiles attribute, the routine verifies that the process ID that is found in each listed file is running. If you specify the MonitorProcesses attribute, the routine verifies that each listed process is running in the context of the user you specify.

Use any combination among these attributes (MonitorProgram, PidFiles, or MonitorProcesses) to monitor the application.

If any of the processes that are specified in either PidFiles or MonitorProcesses is determined not to be running, the monitor returns OFFLINE. If the process terminates ungracefully, the monitor returns OFFLINE and failover occurs.

To monitor the resource, the agent function performs the command:

su [-] user -c executable_to_monitor_resource

imf_init

Initializes the agent to interface with the asynchronous monitoring framework (AMF) kernel driver. 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 AMF kernel driver. The agent continuously waits for notification and takes action on the resource upon notification.

imf_register

Registers the resource entities, which the agent must monitor, with the AMF kernel driver. 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). The Application agent uses IMF for the processes configured with PidFiles and the MonitorProcesses attribute.

Clean

Terminates processes specified in PidFiles or MonitorProcesses. Ensures that only those processes (that are specified in the MonitorProcesses attribute) running with the user ID specified in the User attribute are killed. If the CleanProgram is defined, the agent executes the CleanProgram.

To forcefully stop the resource, the agent function performs the command:

su [-] user -c executable_to_clean_resource

Note that the agent uses the su - option only when the attribute UseSUDash is enabled (1). The UseSUDash attribute is disabled (0) by default.

Action

The various functions of the action entry point are as follows:

  • program.vfd

    Checks the availability of the specified program and the execution permissions for the specified program.

  • user.vfd

    Checks the existence of the specified user on the host.

  • cksum.vfd

    Checks the existence of the same binary on all nodes.

  • propcv

    [For internal use only] Invokes the AMF call with arguments to decide whether to allow or prevent processes from starting for an application resource, outside the VCS control, in the cluster. The StartProgram and the processes configured under MonitorProcesses, registered with AMF for offline monitoring, are prevented from starting on the offline node. This helps prevent concurrency violation at an early stage.

  • getcksum

    Returns the checksum of the specified program