HP-UX CMGR A.02.01 Administrator's and Developer's Guide
34
3.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 cmgr’s 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:
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|admin|commands|compartment|ipaddress|ipfilter|i
psec|login|prm|provision|data|myconf)*>
<!ELEMENT prologue
(xi:include|help|group|var|admin|commands|compartment|ipaddress|ipfilter|
ipsec|login|prm|provision|data|myconf)*>
<!ELEMENT body
(xi:include|help|group|var|admin|commands|compartment|ipaddress|ipfilter|
ipsec|login|prm|provision|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 …
Create a new CMGR template, custom.cst, that uses the myconf element to update a
configuration file and the check_system validation function to verify whether a remote host will