|
The syseventadm command is an administrative front-end to add, remove and list sysevent event handlers. syseventadm can only be run by root.
The syseventadm add command adds a handler for a sysevent event specified by at least one of vendor, publisher or class. If class is specified, it may be qualified with a sub-class. Only
the values specified for vendor, publisher, class and sub-class when adding the handler are matched against sysevent events to determine if the specification matches the event
and the handler should be run. path is the full pathname of the command to be run in response to matching events, with optional arguments (args). If username is specified, the command is invoked as user username, otherwise
as root.
The syseventadm remove command removes handlers for matching sysevent event specifications. Event specifications may be matched by specifying at least one of vendor, publisher, class, username or path. If class is specified, it may be qualified with a sub-class. Any of vendor, publisher, class, sub-class, username, path or args not specified match the corresponding fields of all events. Handlers for all matching specifications are removed.
The syseventadm list command lists the handlers for matching sysevent event specifications using the same match criteria as the remove command but without the requirement that at least one of vendor, publisher, class, username or path be specified. With no match criteria, all specifications are listed. The list command output format is: [vendor=vendor] [publisher=publisher] [class=class] [subclass=subclass] [username=username] path [args] where each of class, sub-class, vendor, publisher and username is listed only if part of the match criteria for the listed specification.
The syseventadm restart command informs the syseventd daemon to reread the sysevent registry after a change has been made by adding or removing one or more sysevent handler specifications.
Argument Macro Substitution
|
The sysevent handling facility provides extensive macro capability for constructing the command line arguments to be executed in response to an event. Macro expansion applies only to the command line args specified for an event handler, with macros expanded
with data from the event itself. Pre-defined macros are provided for the event class, subclass, publisher and vendor information. Macros not matching one of the pre-defined macro names cause the
attribute list attached to the event to be searched for an attribute of that name, with the value of the matching attribute substituted on the command line.
Macros are introduced by the $ character, with the macro name being the following token separated by a SPACE or TAB character. If the macro name is embedded in text, it may be delineated by ${ and }. A \ before the $ causes macro expansion not to occur.
- $class
- The class string defining the event
- $publisher
- The publisher string defining the event
- $sequence
- The sequence number of the event.
- $subclass
- The subclass string defining the event
- $timestamp
- The timestamp of the event.
- $vendor
- The vendor string defining the event
Macro names other than those pre-defined are compared against the attribute list provided with the event. An attribute with name matching the macro name causes the value of the attribute to be substituted as ASCII text on the generated command line.
Use of a macro for which no attribute with that name is defined, or for which multiple attributes with that name are provided, cause an error and the command is not invoked.
Attributes with signed data types (DATA_TYPE_INT16, DATA_TYPE_INT32 and DATA_TYPE_INT64) are expanded as decimal digits.
Attributes with unsigned data types (DATA_TYPE_BYTE, DATA_TYPE_UINT16, DATA_TYPE_UINT32, DATA_TYPE_UINT64 and DATA_TYPE_HTTIME) are expanded as hexadecimal digits with a 0x prefix.
Attributes with string data type (DATA_TYPE_STRING) are expanded with the string data. The data is not quoted. If if it desired that the quoted strings be generated on the command line, put quotes around the macro call in the arguments.
Array types are expanded with each element expanded as defined for that scalar type, with a space separating each element substitution.
|
|