Previous  |  Next  >  
Product: Cluster Server Guides   
Manual: Cluster Server 4.1 Agent Developer's Guide   

info

The info entry point enables agents to obtain information about an online resource. For example, the Mount agent's info entry point could be used to report on space available in the file system.

All information collected by the info entry point is stored in the temp attribute ResourceInfo. The ResourceInfo attribute is a string association that stores name-value pairs. By default, there are three such name-value pairs: State, Msg, and TS. State indicates the status of the information contained in the ResourceInfo attribute; Msg indicates the output of the info entry point, in any; TS indicates the timestamp of when the ResourceInfo attribute was last modified.

The entry point can optionally modify a resource's ResourceInfo attribute by adding or updating other name-value pairs using the following commands:


hares -modify res ResourceInfo -add attribute value

or


hares -modify res ResourceInfo -update attribute value

For a description of the ResourceInfo attribute, see ResourceInfo. Refer also to the manual page for the hares command.

For input, the info entry point receives as arguments the resource name, the value of resinfo_op, and the ArgList attribute values. In the case of C++ implementation, the output of the entry point is returned in info_output. Any optional name-value pairs are returned in either opt_add_args or opt_update_args two-dimensional character arrays. See the C++ example, Example, Info Entry Point Implementation in C++. For the script example, see info.

Return Values

  • If the info entry point exits with 0 (success), the output captured on stdout for the script entry point, or the contents of the info_output argument for C++ entry point, is dumped to the Msg key of the ResourceInfo attribute. The Msg key is updated only when the info entry point is successful. The State key is set to the value: Valid.
  • If the entry point exits with a non-zero value, ResourceInfo is updated to indicate the error; output of the script's stdout or the C++ entry point's info_output is ignored. The State key is set to the value: Invalid. The error message is written to the agent's log file.
  • If the info entry point times out, output from the entry point is ignored. The State key is set to the value: Invalid. The error message is written to the agent's log file.
  • If the info entry point is killed by a user (for example, kill -15 pid), the State key is set to the value: Invalid. The error message is written to the agent's log file.
  • If the resource for which the entry point is invoked goes offline or faults, the State key is set to the value: Stale.
  • If the info entry point is not implemented, the State key is set to the value: Stale. The error message is written to the agent's log file.

The info entry point can be invoked from the command line for a given online resource using the hares -refreshinfo command. See the hares manual page.

online

The online entry point typically contains the code to bring a resource online. For example, the online entry point for an IP agent configures an IP address. When the online procedure completes, the monitor entry point is automatically called by the framework to verify that the resource is online.

The online entry point receives a resource name and ArgList attribute values as input. It returns an integer indicating the number of seconds to wait for the online to take effect. The typical return value is 0. If the return value is not zero, the agent framework schedules the monitor to begin only after this time has elapsed.

offline

The offline entry point is called to take a resource offline. For example, the offline entry point for an IP agent removes an IP address from the system. When the offline procedure completes, the monitor entry point is automatically called by the framework to verify that the resource is offline.

The offline entry point receives a resource name and ArgList attribute values as input. It returns an integer indicating the number of seconds to wait for the offline to take effect. The typical return value is 0. If the return value is not zero, the agent framework schedules the monitor to begin only after this time has elapsed.

 ^ Return to Top Previous  |  Next  >  
Product: Cluster Server Guides  
Manual: Cluster Server 4.1 Agent Developer's Guide  
VERITAS Software Corporation
www.veritas.com