 |
Index for Section 8 |
|
 |
Alphabetical listing for S |
|
 |
Bottom of page |
|
sysman_cli(8)
NAME
sysman -cli - Command line interface to SysMan system management data.
SYNOPSIS
/usr/sbin/sysman -cli
/usr/sbin/sysman -cli -help
/usr/sbin/sysman -cli -noverbose
/usr/sbin/sysman -cli -focus {member_hostname}
/usr/sbin/sysman -cli -list {list_options}
/usr/sbin/sysman -cli -set {set_options}
/usr/sbin/sysman -cli -add {add_options}
/usr/sbin/sysman -cli -delete {delete_options}
/usr/sbin/sysman -cli -cdf { save | validate | apply }
OPTIONS
The following options are processed by sysman -cli:
-noverbose
The default mode of output is verbose. If the -noverbose argument is
passed, only essential or explicitly requested output is displayed. The
-noverbose option may be used with all other options.
-focus
In a cluster, this option enables you to specify which member of the
cluster should be the target of an operation. Specify the host name of
the cluster member as an argument to this option.
-list components
This option will list all known components of the SysMan data
hierarchy. If the MCLDIR environment variable is defined, it looks for
component MCLs there, otherwise it finds MCLs in /usr/share/sysman/mcl.
-list groups -comp comp
This option will list the groups that are defined for the given
component. You must supply a valid component name (see -list
components).
-list attributes -comp comp [-group grp]
This option will list the attribute names for each group in the given
component. If a group is specified, it will list the attribute names
for the specified group only.
-list mib -comp comp
This option will produce an SNMP MIB (Management Information Base)
definition for the given component. The MIB is written to standard
output.
-list defaults -comp comp -group grp
This option will show the default attribute values for the given
component and group. Default values are used when adding new rows to
table type groups. If an attribute does not have a default value, an
empty string is printed.
-list classes -comp comp [-group grp]
List the class names for each group in the given component. If the
group is specified, list the class name for the specified group only.
-list keys -comp comp [ -group grp]
This will list the attribute names which define the key(s) for each
group in the given component. If the group is specified, it will list
the key attribute names for the specified group only. If a group has no
keys (for example, if it is not a table), then NONE is printed for the
key attribute names. At most, two keys will be defined for a group.
-list types -comp ...
Options:
-list types -comp comp [-group grp \
-attr attr1[,attr2...attrN]]]
List the attribute types for each group in the given component. If the
group is specified, list the attribute types for the specified group
only. If individual attributes are specified, list the attribute type
for the given attributes.
-list access -comp ...
Options:
-list access -comp comp [-group grp \
[-attr attr1 [,attr2,...attrN ]]]
List the attribute access type for each group in the given component.
If the group is specified, list the attribute access type for the given
group only. If individual attributes are specified, list the access
type for the given attributes. Access types indicate whether the
attribute is READ-ONLY or READ-WRITE (with appropriate permissions).
-list description -comp ...
Options:
-list description -comp comp [-group grp \
[-attr attr1[,attr2,...attrN]]]
List the description of the given component. If the group is specified
(with no attributes), then the description of the group is printed. If
individual attributes are specified, then the description of the
attributes are printed. If the MCL definition does not contain the
requested description, the following string is displayed: Message
catalog for path_name. This message indicates that no description is
available.
-list values -comp ...
Options:
-list values -comp comp -group grp \
[-attr attr1 [,attr2,...attrN ]] \
[-key1 k1 ] [-key2 k2]]
List the attribute values for the given component and group. If
attribute names are also supplied, then the value for only those
attributes is displayed. If the group is a table (for example, if it
has key attributes), you may supply the necessary keys to identify the
correct row. If you do not supply the keys while listing attribute
values, and the target is a table, all the rows in the table are listed
in the output.
set values -comp ...
Options:
-set values -comp comp -group grp -attr \
attr1=newvalue[,attr2[=newvalue],... \
attrN[=newvalue]] [-key1k1 [-key2 ,k2]]
Modify the attribute values for the given component, group and
attributes. If the group is a table (for example, it has one or two
keys), you may supply the necessary keys to identify the correct row.
If you do not supply the necessary keys, the sysman -cli command will
prompt you for them (by name) at the command line. When prompted for a
key attribute value, you must enter a value.
For each attribute specified, you may also supply the new value for the
attribute on the command line. Supply the new value by adding the =
character followed by the new value. If the new value contains spaces,
you must quote it, For example: -attr comment="This is a new comment".
If you do not specify a new value for a specified attribute, the sysman
-cli command will prompt you at the command line for each attribute
that you did not specify a new value. When prompted, it will show you
the current value of the attribute and allow you to change the
attribute or keep the current value.
If you do not supply any attribute names on the command line, the
sysman -cli will prompt you for each attribute. For each attribute, it
will show you the current value of the attribute and allow you to
change the attribute or keep the current value.
-delete row -comp ...
Options:
-delete row -comp comp -group grp \
[-key1 k1 [-key2 k2]]
Delete a row of data for the given component group and keys. If the
group is NOT a table (for example, if it has no keys), data in the
group cannot be deleted.
You may supply the necessary keys on the command line to identify the
correct row. If you do not supply the keys, the sysman -cli command
will prompt you for them (by name) at the command line.
-add row -comp ...
Options:
-add row -comp comp -group grp [-data\
"{attr1val} {attr2val} ... {attrNval}]"
Add a row of data for the given component group and keys. If the group
is NOT a table (for example, if it has no keys), data in the group
cannot be added. You must use the -set values option.
You may supply the necessary data for the new row via the -data option.
If you do so, you must supply the value for all attributes in the
correct order (see -list attributes).
If you do not supply the necessary data via the -data option, the
sysman -cli command will prompt you for each attribute (by name) at the
command line.
-cdf save -comp...
Options:
-cdf save -comp comp -file filename \
[-cdfgroups {ALL | groups}]"
Create a configuration definition file for the specified component and
store it in the named file. You can specify individual groups or save
ALL groups in a given component. See the EXAMPLES section.
-cdf validate -file filename
Validates (checks) the named cdf file for consistency.
cdf apply -file filename
Applies the named configuration definition file to the component
identified in the file.
OPERANDS
-list
components
version
-comp comp
groups
-comp comp
mib -comp comp [-file filename]
defaults
-comp comp -group grp
attributes
-comp comp [-group grp]
classes
-comp comp [-group grp]
keys
-comp comp [-group grp]
types
-comp comp
[-group grp [-attr attr1[,attr2,...attrN]]]
access
-comp comp
[-group grp [-attr attr1[,attr2,...attrN]]]
description
-comp comp
[-group grp [-attr attr1[,attr2,...attrN]]]
values
-comp comp -group grp
[-attr attr1[,attr2,...attrN]]
[-key1 k1 [-key2 k2]]
-set
values
-comp comp -group grp
[-attr attr1[=newval],attr2=[newval],...
...attrN=[newval]]
[-key1 k1 [-key2 k2]]
-delete
row -comp comp -group grp
[-key1 k1 [-key2 k2]]
-add
row -comp comp -group grp
[-data "{attr1val} {attr2val} ... {attrNval}"]
-cdf
save
-comp comp -file filename
[-cdfgroups {ALL | groups}]
validate
-file filename
apply
-file filename
DESCRIPTION
The sysman -cli command provides a generic command line interface to System
Management (SysMan) data. The SysMan data is defined as that which is used
to configure a system, or perform management tasks such as configuring the
network.
The sysman -cli command can be used to view or modify SysMan data. It can
also be used to view dictionary type information such as data descriptions,
key information, and type information of the SysMan data. The SysMan data
is hierarchical in nature and is broken down as follows:
Component
The broadest SysMan data item is the component. A component covers all
data functionality for a specific SysMan task. For example the
component networkedSystems covers data relating to many aspects of
configuring the network.
Group
Within a component, there may be one or more groups. Each group item
deals with one aspect of the component such as the hostMappings group
of the networkedSystems component.
Attribute
Each group is made of one or more attributes. An attribute corresponds
to a data item of the group such as the aliases, networkAddress, or
systemName, attribute of the hostMappings group.
The following example commands show how you can display the hierarchy of
attribute, group and component:
# sysman -cli -list components
.
.
networkServices
networkedSystems
networks
nfs_export
.
.
# sysman -cli -list groups -comp networkedSystems
Component: networkedSystems
Group(s):
hostEquivalencies
hostEquivFileText
hostFileText
hostMappings
joinMappingService
componentid
digitalmanagementmodes
# sysman -cli -list attributes -comp networkedSystems \
-group hostMappings
Group: hostMappings
Attribute(s):
aliases
comment
networkAddress
systemName
The first command provides a list of all components on the system
(truncated in this example). The second command returns all the groups for
the component networkedSystems. The third command returns all the
attributes for the group hostMappings.
Within a group, one or two attributes may be identified as KEY attributes.
This designation indicates that the group is a table, possibly containing
multiple rows of data. These KEY attributes allow specific data to be
uniquely identified among similar data entries. An example group which is a
table is the hostMappings group of the networkedSystems component. This
group is associated with the /etc/hosts file and contains one row of data
for each non-comment line in the /etc/hosts file. The following example
shows how you identify key attributes.
# sysman -cli -list keys -comp networkedSystems -group hostMappings
Component: networkedSystems
Group: hostMappings Keys: systemName,networkAddress
The key attributes in this group are systemName and networkAddress. These
attributes are used to uniquely reference a row in the /etc/hosts file. The
-list keys option can be used to identify the key attributes for any group.
An example group which is not a table is the client group of the nfsconfig
component. This group identifies how (or if) the system is configured as an
NFS client. Since there is only one NFS client definition, the group is
not a table.
The SysMan data hierarchy is represented in files called MCLs. The name MCL
stands for MIF Command Language. An MCL is an ASCII (text) file with TCL
origins, which contains the hierarchical representation of a component (one
component per MCL) and the TCL code required to manage the data. The MCL
files are located in the /usr/share/sysman/mcl directory. The MCLDIR
environment variable can be used to reference a different directory, if
appropriate.
EXIT STATUS
The sysman -cli command utilizes the following exit codes:
0 (Zero)
Success.
1 An error occurred.
ERRORS
The following errors may be returned by sysman -cli:
· SYSMAN_INVALID_COMPONENT
Explanation:
The component name specified is incorrect. Use the -list components
option to view component names.
· SYSMAN_INVALID_GROUP
Explanation:
The group name specified is incorrect. Use the -list groups option
with a valid component name to view group names.
· SYSMAN_INVALID_ATTRIBUTE
Explanation:
The attribute name specified is incorrect. Use the -list attributes
option with a valid component and group name to view attribute names.
· SYSMAN_INVALID_ARGUMENT
Explanation:
An invalid argument to an option was given. Use the -help option to
view valid option arguments .
· SYSMAN_MUST_SUPPLY_COMPONENT
Explanation:
A component name (via the -comp option) is required. Enter a valid
component name.
· SYSMAN_MUST_SUPPLY_GROUP
Explanation:
A group name (via the -group option) is required. Enter a valid group
name.
· SYSMAN_MUST_SUPPLY_ATTRIBUTE
Explanation:
An attribute name (via the -attr option) is required. Enter a valid
attribute name.
· SYSMAN_INVALID_FLAG
Explanation:
An invalid option was given. Use the -help option to view valid
options.
· SYSMAN_NO_DATA
Explanation:
No row could be found with the given keys.
· SYSMAN_VALIDATE_ERROR
Explanation:
A validation error for a set value, add row or delete row was found.
The value entered for the attribute is invalid.
EXAMPLES
Note
See the code examples in /usr/examples/systems_management/sysman_cli
for information on using sysman -cli within shell scripts.
In the following examples, the format of some output has been modified to
fit on the printed page. It may appear differently on the screen. A
backslash (\) indicates that text which appears on a single line on the
screen has a line break inserted in the printed example.
1. The following example will list the known components. The list is
truncated in this example:
# sysman -cli -list components
Component(s):
account_management
atm
auditconfig
bindconfig
bttape
ciconfig
.
.
.
The second version of this command shows the -list components option
used on a cluster. The cluster member host name is specified as an
argument to the -focus option.
# sysman -cli -focus curley -list components
Component(s):
account_management
atm
auditconfig
bindconfig
bttape
ciconfig
.
.
.
2. This example lists the values in the hostMappings group of the
networkedSystems component:
# sysman -cli -list values -comp networkedSystems \
-group hostMappings
Component: networkedSystems
Group: hostMappings
{} {} 127.0.0.1 localhost
ychain {group server}11.111.212.13 ychain.zz.dic.com
paun {dev system} 11.111.212.31 paun.zz.dic.com
nyth {} 11.111.212.50 nyth.zz.dic.com
This group represents the contents of the /etc/hosts file, and is
therefore a table, with rows of data organized in columns. Where
there is no data in a cell, a null entry is displayed as {}.
By looking at the attributes for the same group, we can see that they
have the following names, each of which maps to a column in the table
of data
# sysman -cli -list attributes -comp networkedSystems \
-group hostMappings
Component: networkedSystems
Group: hostMappings
Attribute(s):
aliases
comment
networkAddress
systemName
Putting this information together gives you an idea of how the data is
manipulated when you use sysman -cli to add rows or modify attributes
in a table. Each attribute is a cell in the table as follows:
Attr | aliases comment networkAddress systemName
------+--------------------------------------------------
Row 1 | {} {} 127.0.0.1 localhost
Row 2 | ychain {group server} 11.111.212.13 ychain.zz.dic.com
Row 3 | paun {dev system} 11.111.212.31 paun.zz.dic.com
Row 4 | nyth {} 11.111.212.50 nyth.zz.dic.com
You can also display columns of attribute data from the table by
specifying a single attribute as follows:
# sysman -cli -list values -comp networkedSystems -group \
hostMappings -attr systemName
Component: networkedSystems
Group: hostMappings
localhost
ychain.zz.dic.com
paun.zz.dic.com
nyth.zz.dic.com
3. This example will change attribute values for a particular entry in
the hostMappings group of the networkedSystems component. The effect
is to change an entry in the /etc/hosts file. Note that because this
group is a table of several rows, you will be prompted to supply key
data to identify the row that you want to change.
# sysman -cli -set value -comp networkedSystems \
-group hostMappings
Please enter key 1 [systemName]: bongo.aaa.bbb.ccc
Please enter key 2 [networkAddress]: 111.222.111.112
Attribute Name: aliases
Attribute Description: Alternate names for this system.
Attribute Type: STRING(24), Current Value:
Enter New Attribute Value (<CR> to keep unchanged): sysman
Attribute Name: comment
Attribute Description: End-of-line comment.
Attribute Type: STRING(24), Current Value:
Enter New Attribute Value (<CR> to keep unchanged): \
Central system for site system management.
Attribute Name: networkAddress (key attribute)
Attribute Description: The string of numbers identifying \
this system to a network. For example, 192.2.3.4.
Attribute Type: STRING(24), Current Value: 111.222.111.112
Enter New Attribute Value (<CR> to keep unchanged): \
111.222.111.222
Attribute Name: systemName (key attribute)
Attribute Description: Full name of this interface to the \
network. For example, hostx.someco.com
Attribute Type: STRING(24), Current Value: bongo.aaa.bbb.ccc
Enter New Attribute Value (<CR> to keep unchanged):
Component: networkedSystems
Group: hostMappings
Keys: 'bongo.aaa.bbb.ccc' & '111.222.111.222'
Attribute: aliases Value: sysman
Attribute: comment Value: Central system for \
site system management
Attribute: networkAddress Value: 111.222.111.222
Attribute: systemName Value: bongo.aaa.bbb.ccc
4. This example adds a host as a new row in the etc/hosts file:
# sysman -cli -add row -comp networkedSystems \
-group hostMappings
Attribute Name: aliases
Attribute Description: Alternate names for this system.
Attribute Type: STRING(24), Default Value: <NONE>
Enter Attribute Value: news
Attribute Name: comment
Attribute Description: End-of-line comment.
Attribute Type: STRING(24), Default Value: <NONE>
Enter Attribute Value: the news server for the site
Attribute Name: networkAddress (key attribute)
Attribute Description: The string of numbers identifying \
this system to a network. For example, 192.2.3.4.
Attribute Type: STRING(24), Default Value: <NONE>
Enter Attribute Value: 150.2.3.4
Attribute Name: systemName (key attribute)
Attribute Description: Full name of this interface to \
the network. For example, hostx.someco.com
Attribute Type: STRING(24), Default Value: <NONE>
Enter Attribute Value: newshst.pubs.com
5. This example will add the given (complete) row of data to the
hostMappings group of the networkedSystems component. The data for
each attribute is enclosed in braces {}, and the entire set of
attributes is enclosed by quotes ("" or '').
# sysman -cli -add row -comp networkedSystems \
-group hostMappings -data "{newsserver} {nsrv} \
{newsystem.site.com} {111.222.333.111}"
6. This example shows how the -noverbose option can be used to limit the
output to the minimal data necessary. First, the current NFS client
configuration is shown in verbose mode. It is then followed by the
same command in noverbose mode:
# sysman -cli -list value -comp nfsconfig -group client
Component: nfsconfig
Group: client
Attribute: name Value: cldhpr
Attribute: configured Value: yes
Attribute: locking Value: yes
Attribute: locking_status Value: running
Attribute: nfsiod Value: 8
Attribute: nfsiod_status Value: running
Attribute: automount Value: yes
Attribute: amargs Value: -h -v
Attribute: automount_status Value: running
Attribute: daemon_action Value: noaction
Attribute: cluster_override Value: 0
# sysman -cli -noverbose -list value -comp nfsconfig \
-group client
cldhpr yes yes running 8 running yes {-h -v} running noaction 0
7. This example shows how you create a configuration definition (cdf)
file for the nfsconfig component, saving only the clientgroup which
defines the current configuration of the NFS client. The componentid
group is saved automatically:
# sysman -cli -cdf save -comp nfsconfig -file /cdftest \
-cdfgroups client
Saving component nfsconfig (group: client)
Saving component nfsconfig (group: componentid)
The configuration file, /cdf_test has the following content for the
/nfsconfig configuration settings:
#
# CDF Created: Thu May 27 14:55:17 EDT 1999
#
#
# Component: nfsconfig
#
#
# Group: client
#
/nfsconfig/client:
cdf_record=00000001
name=cymro
configured=yes
locking=yes
locking_status=running
nfsiod=7
nfsiod_status=running
automount=yes
amargs=-h -v -D MACH=ALPHA -D OS=OSF1 -D NET=
automount_status=running
daemon_action=noaction
cluster_override=0
#
# Group: componentid
#
/nfsconfig/componentid:
manufacturer=manufacturer_name
product=Network Filesystem Configuration
version=NFS-1.1.4.19
serialnumber=1.1.4.19
installation=installation_number
verify=7
Note that if you are not sure which groups of a component are
configured, you can use the -cdfgroups ALL option and view the output
file.
The cdf file can be validated (checked) with the following command:
# sysman -cli -cdf validate -file /cdf_test
Validating component nfsconfig (group: client)
Validating component nfsconfig (group: componentid)
ENVIRONMENT VARIABLES
MCLDIR
Normally not set. This is checked for the location of the MCL files.
If this variable is unset, the /usr/share/sysman/mcl directory is used.
FILES
/usr/sbin/sysman -cli
The executable image.
/usr/share/sysman/mcl
The default location of component MCL files
/usr/examples/systems_management/sysman_cli
Shell scripting examples
SEE ALSO
Commands: sysman(8), sysman_station(8)
System Administration
 |
Index for Section 8 |
|
 |
Alphabetical listing for S |
|
 |
Top of page |
|