United States-English |
|
|
HP-UX Reference > Eevmtemplate(4)HP-UX 11i Version 3: February 2007 |
|
NAMEevmtemplate — Event Manager template file SYNOPSISevent { name event_name format format_specifier priority priority i18n_catalog i18n_cat i18n_set_id i18n_set i18n_msg_id i18n_msg reference reference_string var { name variable_name type variable_type value variable_value i18n_msg_id variable_value } } DESCRIPTIONA template event is a description of an event that is held centrally by EVM. The template is used for the following purposes:
File FormatOn startup, and each time the evmreload -d command is run, the EVM daemon reads all valid event template files stored in the template directory tree rooted at /usr/share/evm/templates, or in any directory tree linked to that directory, including the local template tree rooted at /var/evm/adm/templates. There is no limit to the number of template files that can be installed in the tree, or to the number of templates that can be included in each file. Template file names must end with the suffix .evt, and the files must be owned by root or bin, and must have permissions of 0400, 0600, 0440, or 0640 to be recognized. If template files are added, deleted or modified while the daemon is running, the evmreload -d command should be used to instruct the daemon to reconfigure itself. Refer to the evmreload(1M) manpage for more information. Every template event must contain a name data item with at least two components. A template typically also contains constant items such as the event priority and the message format string. When a client posts an event, it must include in the posted event a name with at least three components. The posted event also typically contains any applicable variable data along with environmental items such as a timestamp and the name of the posting system. When the EVM daemon receives a posted event, it searches its template database for the template event whose name best matches the name in the posted event. If it cannot find a matching template, the daemon rejects the posting attempt. Otherwise, the daemon merges the data items held in the two versions of the event, yielding a merged event which it distributes to subscribers. A template event name does not have to be identical to the name of a posted event to be considered a match. If it has fewer name components than the posted event, a template event is still considered a match if all components in the template name exactly match their equivalent components in the posted name. If the template name is longer than the name of the posted event however, it cannot be a match. In determining the template that best matches the name of the posted event, the daemon selects the matching template with the most components. The following table shows some examples of event name matching. In the final example, the template does not match the posted event because the template has too many components.
The syntax of an event template file is identical to the syntax of a file given as input to the evmpost command. The following keywords may be specified in a template file:
Any items specified outside an event group are global items, which will be included in each following template that does not include them explicitly. NotesIf you are concerned with allowing your file to be used on other systems that support EVM in the future, you should use the built-in macro @SYS_VP@ in place of the first two components (sys.unix) of the name of any system event. This will make it unnecessary to change the file if the other system uses a different event name prefix. EXAMPLESThe following file is an example of an event template file. # My example event file priority 200 event { name myco.myapp.env.humid format "myapp: Humidity is $humidity" var { name humidity type INT16 value 0 } } event { name myco.myapp.env.temp.normal format "myapp: Temperature is normal ($temp)" var { name temp type FLOAT value 0.0 } } event { name myco.myapp.env.temp.high priority 500 format "myapp: Temperature exceeds 80F ($temp)" var { name temp type FLOAT value 0.0 } } event { name myco.myapp.env.app_terminated priority 300 format "myapp: Production monitoring terminated - code $exit_code" var { name exit_code type INT16 value 0 } } FILES
|
Printable version | ||
|