Sun Management Center 3.6.1 User's Guide

Extended CLI Commands

Several types of extended commands that are available in the CLI are described in these sections:

Module Extended Commands

Seven extended commands are available for managing modules.

Parameters for the Module Command

The following parameters can be used by the module commands. For details about the a and m parameters, refer to Predefined Parameters and Flags.

moduleName

The internationalized name of the module

moduleDesc

The text description of the module

moduleParams

The comma-separated list of module parameters

-default

The default settings of the module

Module Commands

disableModule

Description

The disableModule command disables a module or modules in an agent or agents.

Syntax

disableModule a=host[:port][,host[:port]]* m=module[+instance][,module[+instance]]*

Parameters

a and m

enableModule

Description

The enableModule command enables a module or modules in an agent or agents.

Syntax

enableModule a=host[:port][,host[:port]]* m=module[+instance][,module[+instance]]*

Parameters

a and m

getLoadedModules

Description

The getLoadedModules command obtains a list of loaded modules in an agent or agents.

Syntax

getLoadedModules a=host[:port][,host[:port]]*

Parameter

a

getModule

Description

The getModule command obtains information for a particular module in an agent or agents.

Syntax

getModule a=host[:port][,host[:port]]* m=module[+instance]

Parameters

a and m

getModules

Description

The getModules command obtains a list of all available modules in an agent or agents.

Syntax

getModules a=host[:port][,host[:port]]*

Parameter

a

loadModule

Description

The loadModule command loads a module in an agent or agents.

Syntax

loadModule a=host[:port][,host[:port]]* m=module[+instance] [moduleName= name] [moduleDesc=description] [moduleParams= key=value[,key=value]*] [-default]

Parameters

a, m, moduleName, moduleDesc, moduleParams, and -default.

unloadModule

Description

The unloadModule command unloads one or more modules in an agent or agents.

Syntax

unloadModule a=host[:port][,host[:port]]* m=module[+instance][,module[+instance]]*

Parameters

a and m

Module Command Examples

To determine which modules are loaded on a host whose agentHost name is seattle, you would type the following command at the CLI prompt:


> getLoadedModules a=seattle

To load the kernel-reader module on the host seattle at port 1776, you would type the following command:


> loadModule a=seattle:1776 m=kernel-reader

Object Attribute Extended Commands

There are four extended commands for managing object attributes and attribute values.

Parameters for the Object Attribute Command

The following parameters can be used by the object attribute commands. For details about the a and m parameters, refer to Predefined Parameters and Flags.

mgtObj

The value of the mgtObj parameter is the name of the managed object whose attributes and properties are being set or retrieved.

property

The value of the property parameter is the name of the property whose attributes and values are being set or retrieved.

propInst

The value of the propInst parameter is the name of the instance of the property whose attributes and values are being set or retrieved.

rowValues

The value of the rowValues parameter is a comma-separated list of name-value pairs. name is the name of a column in the row. value is the value in that column.

attribute

The value of the attribute parameter is a comma-separated list of attribute names that belong to the property whose attributes and values are being set or retrieved. When used with the setAttributes command, each attribute name in the attribute parameter must have a corresponding value in the value parameter.

value

The value of the value parameter is a comma-separated list of values that correspond to the attributes that are specified in the attribute parameter. When used with the setAttributes command, there must be a value for each attribute specified.

Object Attribute Commands

You can set and retrieve object attributes and attribute values with the following commands:

addRow

Description

The addRow command adds a row with the specified values to a table.

Syntax

addRow a=host[:port][,host[:port]]* m=module[+instance] mgtObj=managedObject [property=property] [propInst=propertyInstance] rowValues=name=value[,name=value]

Parameters

a, m, mgtObj, property, propInst, and rowValues.

delRow

Description

The delRow command deletes a row with the specified values from a table.

Syntax

delRow a=host[:port][,host[:port]]* m=module[+instance] mgtObj=managedObject [property=property] [propInst=propertyInstance] rowValues=name=value[,name=value]

Parameters

a, m, mgtObj, property, propInst, and rowValues.

getAttributes

Description

The getAttributes command retrieves the information for a property or retrieves specified attributes from an agent or a list of agents.

Syntax

getAttributes a=host[:port][,host[:port]]* m=module[+instance] mgtObj=managedObject property=property [propInst=propertyInstance] [attribute=attribute[,attribute]*]

Parameters

a, m, mgtObj, property, propInst, and attribute.

setAttributes

Description

The setAttributes command sets a property or sets values to the specified attributes in an agent or a list of agents. You can also reset the value of a specified attribute to null.

Syntax

setAttributes a=host[:port][,host[:port]]* m=module[+instance] mgtObj=managedObject property=property [propInst=propertyInstance] [attribute=attribute[,attribute]*] value=value[,value]*

Parameters

a, m, mgtObj, property, propInst, attribute, and value.

For each attribute specified in the attribute parameter, there must be a corresponding value in the value parameter.

Examples for the Object Attribute Command

The following command retrieves all attributes for the size property in the totalstats managed object in the agent-stats module at port 1161 on host haiku:


> getAttributes a=haiku:1161 m=agent-stats mgtObj=totalstats \
property=size

The following command sets the attribute alarmlimits.error-gt to the value of 2 in the size property specified in the previous example:


> setAttributes a=haiku:1161 m=agent-stats mgtObj=totalstats \
property=size attribute=alarmlimits.error-gt value=2

The following command deletes the row that is specified in rowValues from the managed object that is specified in mgtObj:


> delRow a=haiku:1161 \
m=filemon mgtObj=filemonstats/filemonTable/filemonEntry \
rowValues="name=test,desc=this,filename=/etc/passwd"

Alarm Extended Commands

There are five extended commands for managing alarms.

Alarm Command Parameters

The following parameters can be used by the extended commands for alarms. For details about the a and m parameters, refer to Predefined Parameters and Flags.

ack

The value of the ack parameter is a comma-separated list of values that indicate whether the alarms being managed have been acknowledged. Legal values for the ack parameter are ACK (Acknowledged) and NOACK (Not Acknowledged).

command

The value of the command parameter is the alarm action to be performed.

domain

The value of the domain parameter is the name of the Sun Management Center domain for which alarms are to be managed. If no domain is specified, the Default Domain is used.

mgtObj

The value of the mgtObj parameter is the name of the managed object for which alarms are to be managed.

note

The value of the note parameter is a text annotation for the command being run.

property

The value of the property parameter is the name of the property for which alarms are to be managed.

propInst

The value of the propInst parameter is the name of the specific property instance for which alarms are to be managed.

qualifier

The value of the qualifier parameter is the name of the qualifier that is associated with the managed property whose alarms are to be managed.

severity

The value of the severity parameter is a comma-separated list of severity values for the alarms being managed. The following values are allowed for the severity parameter:

  • ERR — Error

  • WRN — Warning

  • INF — Informative

  • IRR — Irrational

  • DWN — Down

  • DIS — Disabled

  • OFF — Off

state

The value of the state parameter is a comma-separated list of state values for the alarms being managed. Legal values for the state parameter are Open, Closed, and Fixed.

Alarm Commands

You can examine alarm values and set alarm actions with the following commands:

ackAlarms

Description

The ackAlarms command acknowledges alarms in an agent or a list of agents.

Syntax

ackAlarms a=host[:port][,host[:port]]* [domain=domain] [m=module[+instance][mgtObj=managedObject [property=property [propInst=propertyInstance] [qualifier=qualifier]]]] [severity=DIS|DWN|ERR|INF|IRR|OFF|WRN] [state=OPEN|CLOSED|FIXED] [note=reason]

Parameters

a, domain, m, mgtObj, property, propInst, qualifier, severity, state, and note.

If no value is specified for the state parameter, state defaults to Open.

delAlarms

Description

The delAlarms command deletes alarms in an agent or a list of agents.

Syntax

delAlarms a=host[:port][,host[:port]]* [domain=domain] [m=module[+instance][mgtObj=managedObject [property=property [propInst=propertyInstance] [qualifier=qualifier]]]] [severity=DIS|DWN|ERR|INF|IRR|OFF|WRN] [state=OPEN|CLOSED|FIXED] [ack=ACK|NOACK] [note=reason]

Parameters

a, domain, m, mgtObj, property, propInst, qualifier, severity, state, ack, and note.

If no value is specified for the state parameter, state defaults to Closed.

getAlarms

Description

The getAlarms command retrieves alarm information for an agent or a set of agents.

Syntax

getAlarms a=host[:port][,host[:port]]* [domain=domain] [m=module[+instance][mgtObj=managedObject [property=property [propInst=propertyInstance] [qualifier=qualifier]]]] [severity=DIS|DWN|ERR|INF|IRR|OFF|WRN] [state=OPEN|CLOSED|FIXED] [ack=ACK|NOACK]

Parameters

a, domain, m, mgtObj, property, propInst, qualifier, severity, state, and ack.

If no parameters are specified, getAlarms returns all alarm information.

runAlarmAction

Description

The runAlarmAction command runs a manual or delayed alarm action for all alarms under a domain of an agent or a list of agents.

Syntax

runAlarmAction a=host[:port][,host[:port]]* [domain=domain] [m=module[+instance][mgtObj=managedObject [property=property [propInst=propertyInstance] [qualifier=qualifier]]]] [severity=DIS|DWN|ERR|INF|IRR|OFF|WRN] [state=OPEN|CLOSED|FIXED] [ack=ACK|NOACK]

Parameters

a, domain, m, mgtObj, property, propInst, qualifier, severity, state, and ack.

setAlarmAction

Description

The setAlarmAction command sets a manual or delayed alarm action for all alarms under a domain of an agent or a list of agents.

Syntax

setAlarmAction a=host[:port][,host[:port]]* command=command [domain=domain] [m=module[+instance][mgtObj=managedObject [property=property [propInst=propertyInstance] [qualifier=qualifier]]]] [severity=DIS|DWN|ERR|INF|IRR|OFF|WRN] [state=OPEN|CLOSED|FIXED] [ack=ACK|NOACK]

To set up email alerts for an alarm, the command format can either be

command="email.sh:<email-id>:<message>" or

command="email:<email-id>:<message>"

Parameters

a, command, domain, m, mgtObj, property, propInst, qualifier, severity, state, and ack.

Alarm Command Examples

The following command retrieves all alarms with severity of ERR or DWN from the host haiku:


> getAlarms a=haiku severity=ERR,DWN

Topology Extended Commands

There are nine extended commands for managing topology.

Topology Command Parameters

The following parameters can be used by the extended commands for topology. For details about the a and t parameters, refer to Predefined Parameters and Flags.

agentPort

The value of the agentPort parameter is the agent port number. If agentPort is not specified, the default value of 161 is used. The agentPort parameter is optional. This parameter is only specified if the url parameter is not specified and if you do not want the default port.

arch

The value of the arch parameter is the architecture of the topology object.

domain

The value of the domain parameter is the name of the Sun Management Center domain that you must specify for the setCurrentDomain command.

domainmode

The value of the domainmode parameter can be follow or ignore. If the value is follow, the import command imports both the group and domain information from the file to the specified target domain. If the value is ignore, the import command ignores the domain information.

family

The value of the family parameter is the object family of the topology object. If this is not specified, this will be automatically obtained.

filename

The value of the filename parameter is the name of the file. This parameter is used by export and import commands to export and import topology data.

fullDesc

The value of the fullDesc parameter is a text description of the entity or group being created.

isPolled

The value of the isPolled parameter can be true or false. If the value is true, the entity polls for status information according to the polling type (pollType). The default value is true.

mode

The value of the mode parameter can be append or overwrite. If the value is append, the export command adds the topology data to the end of the file. If the value is overwrite, the export command overwrites the file with the topology data.

nodemode

The value of the nodemode parameter can be replace or ignore. If there is a mismatch of data in the file and in the domain, the replace value replaces the data in the domain with data in the file. The ignore value ignores any mismatch of data.

pollType

The value of the pollType parameter is the type of polling for this entity. The following values are allowed for the pollType parameter:

  • agroup – Identifies a group on which an active agent is installed and running

  • ahost – Identifies a host on which an active agent is installed and running

  • amod – Identifies a module that has an active agent

  • aprox – Identifies an agent that is running an SNMP proxy module

  • dummy – Identifies a device that is not monitored

  • ping – Identifies a host to be monitored using the ICMP ping command

  • snmp – Identifies a host to be monitored using the SNMP ping command

readInfo

The value of the readInfo parameter is the name of the SNMPv1 read community for SNMP polled objects.

targetHost

The value of the targetHost parameter is the name of the target host.

targetIp

The value of the targetIP parameter is the IP address of the target host.

topoCfg

The value of the topoCfg parameter is configuration information for the topological representation of a managed entity.

topoType

The value of the topoType parameter is the topological representation type of a managed entity.

url

The value of the url parameter is the URL of the entity to be polled. The value of the url parameter can be specified in the following formats:

ping://hostname
snmp://hostname:port/oid/#.#.#.#
snmp://hostname:port/[mod,sym]/path
validity

The value of the validity parameter is the duration (in days) you want the exported topology data to be valid. The value of the validity parameter can be Unlimited, 7, 15, 30, or 90.

writeInfo

The value of the writeInfo parameter is the name of the SNMPv1 write community for SNMP polled objects.

Topology Commands

There are nine extended commands for managing topology.

createEntity

Description

The createEntity command creates a managed entity.

Syntax

createEntity t=topoObject pollType=ahost|amod|aprox|dummy|ping|snmp [fullDesc=text] [targetHost=host] [agentPort=port] [targetIp=ip] [family=family] [isPolled=true|false] [topoType=text] [topoCfg=text] [readInfo=text] [writeInfo=text] [url=url]

Parameters

t, pollType, fullDesc, targetHost, agentPort, targetIp, family, isPolled, topoType, topoCfg, readInfo, writeInfo, and url.

If the url or agentPort parameters are specified, the default port of 161 is not used.

createGroup

Description

The createGroup command creates a topology domain or group.

Syntax

createGroup t=topoObject [family=base|building-view|campus-view|network-view|subnetwork-view] [fullDesc=desc]

Parameters

t, family, and fullDesc.

If the entity being created is a group, the family parameter is mandatory.

If the entity being created is a domain, the family and fullDesc parameters are ignored.

delTopoObject

Description

The delTopoObject command deletes a managed topology object in the managed topology hierarchy. All objects under the specified topology object are deleted as well.

Syntax

delTopoObject t=topoObject

Parameter

t

export

Description

The export command exports topology data in a domain or domains to a file.

Syntax

export filename=filename domain=domain|"All Domains" mode=append|overwrite validity=Unlimited|7|15|30|90 [comment=text]

Parameters

filename, domain, mode, validity, and comment.

getAgentPort

Description

The getAgentPort command returns a port number of the Sun Management Center agent running on the specified host in a topology domain. If there are multiple agents, a list of port numbers is returned.

Syntax

getAgentPort a=host[,host]* [t=topoObject]

Parameters

a and t.

If the t parameter is not specified, the default domain is used.

getAllTopoObjects

Description

The getAllTopoObjects command returns a list of all managed objects in the managed topology hierarchy that satisfy conditions specified by the arch, family, or pollType parameters.

Syntax

getAllTopoObjects t=topoObject [arch=os] [family=platform] [pollType=aview|ahost|amod|aprox|dummy|ping|snmp]

Parameters

t, arch, family, and pollType.

getCurrentDomain

Description

The getCurrentDomain command returns the name of the current domain.

Syntax

getCurrentDomain

Parameters

None

getDomains

Description

The getDomains command returns a list of all managed domains in the current server context.

Syntax

getDomains

Parameters

None

getTopoObject

Description

The getTopoObject command returns a list of managed topology objects directly under the topology object specified by parameter t that satisfy conditions specified by the arch, family, or pollType parameters.

Syntax

getTopoObject t=topoObject [arch=os] [family=platform] [pollType=aview|ahost|amod|aprox|dummy|ping|snmp]

Parameters

t, arch, family, and pollType.

import

Description

The export command imports topology data from a file to a domain.

Syntax

import filename=filename domainmode=follow|ignore nodemode=replace|ignore [domain=domain]

Parameters

filename, domainmode, nodemode, and domain.

setCurrentDomain

Description

The setCurrentDomain command sets the home domain to the value specified in the domain parameter.

Syntax

setCurrentDomain domain=domainName

Parameter

domain

Topology Command Examples

The following command returns a list of all Sun Management Center agent hosts on the sun4u family in group building12 in the menlo_park domain that are running SunOS 5.7 software:


> getTopoObject t=/menlo_park/building12 pollType=ahost \
arch="SunOS 5.7" family=sun4u

The following command creates a group that is named building19 under an existing domain that is named headquarters_test:


> createGroup t=/headquarters_test/building19 \
fullDesc="test headquarters domain" family=building-location

The following command creates a managed entity that is named myHost in the group building12 in the domain test_domain. The topology object is a host with the agent running in port 1161.


> createEntity t=/test_domain/building12/myHost \
fullDesc="my test host" family=ultra-2 topoType="" \
topoCfg="" isPolled=false pollType=ahost readInfo="" \
writeInfo="" targetHost=osftserv targetIp="" agentPort=1161