HP-UX CMGR A.02.00 Administrator's and Developer's Guide

<var name=variable
validate=Cmgr::Modulename::functionname(You must enter a
value!) />
4.3 Example Plug-in
The example contained in this section is for a template that updates a configuration
file which specifies a list of client computer system names. The template is used with
the cmgr command to add, delete, replace, and list entries from the configuration file.
The add operation requires the user to specify a system name (represented with the
system_name variable) and a tag identifier (represented with the tagid variable).
tagid may be an arbitrary character string. The system_name variable is checked to
ensure it responds to a ping(1M) after which the configuration file is updated. An entry
in the configuration file is in the format:
client=system_name # tagid
For a delete operation, the user is prompted to enter the tagid value. All entries in
the file with a tag field that exactly matches the tagid variable specified via cmgr are
deleted.
The replace operation functions like a delete operation, followed by an add
operation.
The list operation will list the entire contents of the configuration file if cmgrs verbose
option is specified. Otherwise list will only list lines from the configuration file with
a matching tag value.
To create and use a template that updates a configuration file that specifies a list of
client computer system names, follow these steps:
1. Modify the CMGR DTD (/etc/opt/cmgr/templates/cmgr.dtd) for the
myconf element:
<!ELEMENT template (head, prologue?, body)>
<!ELEMENT head (title|description|cst_version|template_version|
xi:include|help|group|var|commands|compartment|provision|ipaddress|ipfilter|prm|ipsec|data|myconf)*>
<!ELEMENT prologue
(xi:include|help|group|var|commands|compartment|provision|ipaddress|ipfilter|prm|ipsec|data|myconf)*>
<!ELEMENT body
(xi:include|help|group|var|commands|compartment|provision|ipaddress|ipfilter|prm|ipsec|data|myconf)*>
lines deleted for readability
<!ELEMENT myconf (data|help|success|failure)*>
lines deleted for readability
<!ATTLIST myconf
config_file CDATA #IMPLIED
id CDATA #IMPLIED
if_op CDATA #IMPLIED
if CDATA #IMPLIED
>
lines deleted for readability
4.3 Example Plug-in 41