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

35
respond to ping(1M). Note that the configuration filename is specified with the “config_file”
attribute for the “myconf” element:
<?xml version="1.0" ?>
<!DOCTYPE template SYSTEM "/opt/hpcmgr/etc/templates/cmgr.dtd">
<template>
<head>
<var name="system_name"
validate="Cmgr::My_check_vars::check_system('You must enter a
value!')" >
<prompt>Client system name:</prompt>
<help>
The DNS Node Name for the remote client.
The client must be reachable with ping.
</help>
</var>
<var name="tagid" value="" >
<prompt>Tag identifier:</prompt>
<help>
An identifier that identifies one or more entries to the configuration
file.
On a delete or replace operation, all existing entries with the same
identifier tag will be deleted or replaced.
</help>
</var>
</head>
<prologue>
<!-- prompt for a system name and tag id-->
<data if_op="add|replace">$system_name $tagid</data>
<data if_op="delete|list" if="!$verbose">$tagid</data>
</prologue>
<body>
<myconf config_file=”/tmp/myconf”>
<data if_op="add|replace">
client=$system_name # $tagid
</data>
<data if_op="delete|list">
# $tagid
</data>
</myconf>
</body>
</template>
Create a new module, Cmgr::Print_data, located at /opt/hpcmgr/lib/Cmgr/Myconf.pm:
#!/usr/bin/perl
########
# this module is the handler for <myconf>
########
package Cmgr::Myconf;
use strict;
use warnings;
my $TAG='#';