About the info entry point

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 the info entry point collects is stored in the "temp" attribute ResourceInfo.

See the User's Guide for information about "temp" attributes.

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, valid or invalid, of the information contained in the ResourceInfo attribute; Msg indicates the output of the info entry point, if any; TS indicates the timestamp of when the ResourceInfo attribute was last updated.

The (script) 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 key value

or

hares -modify res ResourceInfo -update key value

Refer to the hares manual page for more information on modifying values of string-association attributes.

See ResourceInfo resource attribute used by info entry point.

See Syntax for C++ entry points.

Return values for info entry point
Invoking the info entry point

You can invoke the info entry point from the command line for a given online resource using the hares -refreshinfo command.

By setting the InfoInterval attribute to some value other than 0, you can configure the agent to invoke the info entry point periodically for an online resource.

See InfoInterval.

ResourceInfo resource attribute used by info entry point

The ResourceInfo (string-association) is a temporary attribute, the scope of which is set by the engine to be global for failover groups or local for parallel groups. Because ResourceInfo is a temporary attribute, its values are never dumped to the configuration file.

The values of the ResourceInfo attribute are expressed in three mandatory keys: State, Msg, and TS.For State, the possible values are "Valid," (the default), "Invalid," and "Stale"). Msg (default is "", a null string) contains the output from the entry point. TS contains the time at which the attribute was last updated. These mandatory keys are updated only by the agent framework, not the entry point. The entry point can define and add other keys (name-value pairs) and update them.

The value of the ResourceInfo attribute can be displayed using the hares command. The output of hares -display shows the first 20 characters of the current value; the output of hares -value resource ResourceInfo shows all name-value pairs in the keylist.

The resource for which the info entry point is invoked must be online. When a resource goes offline or faults, the State key is marked "Stale" because the information is not current. If the info entry point exits abnormally, the State key is marked "Invalid" because not all of the information is known to be valid. Other key data, including Msg and TS keys, are not touched. You can manually clear values of the ResourceInfo attribute by using the hares -flushinfo command. This command deletes any optional keys for the ResourceInfo attribute and sets the three mandatory keys to their default values.

See the hares manual page.