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
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.
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
.
ResourceInfo
is updated to indicate the error; 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.
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.
info
entry point (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.
State
key is set to the value: Stale
.
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.
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.
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.