The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This chapter describes how to access the SMASH Web Services interface (WS-Management) and provides limited information about its use. For detailed information about using the SMASH WS-Management tool, see the DMTF documentation at this URL:
http://www.dmtf.org/standards/smash
This chapter contains the following topics:
•Obtaining and Installing a WS-Management Client
•Viewing the Available Commands
To use WS-Management, you must obtain and install a WS-Management client for your operating system. Free clients are available for common operating systems, including Windows, Macintosh OS X, and Linux.
For this guide, we will use Microsoft Windows Remote Management (WinRM) as an example. WinRM is included with current Windows desktop and server versions, and is available as a download from Microsoft for selected earlier versions. Refer to Microsoft's documentation for instructions on obtaining and installing the appropriate version of WinRM for your client computer.
After installation, WinRM can be run from a Windows command prompt in any directory. To test the installation, enter the winrm id command at the Windows command prompt. The command output should appear as in the following example:
C:\> winrm id
IdentifyResponse
ProtocolVersion = http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
ProductVendor = Microsoft Corporation
ProductVersion = OS: 5.1.2600 SP: 2.0 Stack: 1.1
By default, WinRM has the following restrictions:
•Requires a secure connection (https)
•Disallows basic authentication
•Trusts no host
You must configure the client to allow unencrypted communication and basic authentication, and to trust certain hosts for unencrypted communication. To make these configuration changes, enter the following commands at the Windows command prompt:
winrm set winrm/config/client/auth @{Basic="true"}
winrm set winrm/config/client @{AllowUnencrypted="true"}
winrm set winrm/config/client @{TrustedHosts="*"}
This example shows how to verify the configuration:
C:\> winrm get winrm/config/client
Client
NetworkDelayms = 5000
URLPrefix = wsman
AllowUnencrypted = true
Auth
Basic = true
Digest = true
Kerberos = true
Negotiate = true
Certificate = true
DefaultPorts
HTTP = 80
HTTPS = 443
TrustedHosts = *
C:\>
To display the WinRM command options, enter the winrm command at the Windows command prompt, as in the following example:
C:\>winrm
Windows Remote Management Command Line Tool
Windows Remote Management (WinRM) is the Microsoft implementation of
the WS-Management protocol which provides a secure way to communicate
with local and remote computers using web services.
Usage:
winrm OPERATION RESOURCE_URI [-SWITCH:VALUE [-SWITCH:VALUE] ...]
[@{KEY=VALUE[;KEY=VALUE]...}]
For help on a specific operation:
winrm g[et] -? Retrieving management information.
winrm s[et] -? Modifying management information.
winrm c[reate] -? Creating new instances of management resources.
winrm d[elete] -? Remove an instance of a management resource.
winrm e[numerate] -? List all instances of a management resource.
winrm i[nvoke] -? Executes a method on a management resource.
winrm id[entify] -? Determines if a WS-Management implementation is
running on the remote machine.
winrm quickconfig -? Configures this machine to accept WS-Management
requests from other machines.
winrm configSDDL -? Modify an existing security descriptor for a URI.
winrm helpmsg -? Displays error message for the error code.
For help on related topics:
winrm help uris How to construct resource URIs.
winrm help aliases Abbreviations for URIs.
winrm help config Configuring WinRM client and service settings.
winrm help certmapping Configuring client certificate access.
winrm help customremoteshell Configures a shell executable and
arguments corresponding to a shell URI.
winrm help remoting How to access remote machines.
winrm help auth Providing credentials for remote access.
winrm help input Providing input to create, set, and invoke.
winrm help switches Other switches such as formatting, options, etc.
Tip The output of the winrm command lists many other help options. Explore these additional options for detailed information about WinRM commands.
The following example shows a typical winrm get command:
C:\> winrm get cimv2/CCIM_IndicatorLED?SystemCreationClassName=CCIM_ComputerSystem+SystemName=srv:1+Creat ionClassName=CCIM_IndicatorLED+DeviceID=LED_FPID -r:https://192.0.20.137:443 -a:Basic -u:admin -p:password -encoding:utf-8 -f:text -skipCAcheck -skipCNcheck
The following table describes the fields of this command:
This section contains the following examples:
•Configuring a Battery Sensor Threshold
•Configuring a Chassis Locator LED
•Viewing and Clearing the System Event Log
•Performing a Power Control Operation
This example reads the 3 volt battery sensor status, sets the LowerThresholdCritical property to a new value of 2000, and reads the sensor again to verify the new value (in this example, the value is shown in bold for readability):
C:\> winrm get cimv2/CCIM_NumericSensor?CreationClassName=CCIM_NumericSensor+DeviceID=0.0.20.1+SystemName =srv:1+SystemCreationClassName=CCIM_ComputerSystem -r:https://192.0.20.137 -a:Basic -u:admin -p:password -encoding:utf-8 -f:text -skipCNcheck -skipCAcheck
CCIM_NumericSensor
Accuracy = null
AccuracyUnits = null
AdditionalAvailability = null
Availability = null
AvailableRequestedStates = null
BaseUnits = 5
Caption = null
CommunicationStatus = null
CreationClassName = CCIM_NumericSensor
CurrentReading = 30096
CurrentState = Normal
Description = null
DetailedStatus = null
DeviceID = 0.0.20.1
ElementName = P3V_BAT_SCALED(0.0.20)
EnabledDefault = 2
EnabledState = 1
EnabledThresholds = null
ErrorCleared = null
ErrorDescription = null
HealthState = 5
Hysteresis = null
IdentifyingDescriptions = null
InstallDate = null
IsLinear = null
LastErrorCode = null
LocationIndicator = null
LowerThresholdCritical = 21780
LowerThresholdFatal = 19932
LowerThresholdNonCritical = 0
MaxQuiesceTime = null
MaxReadable = null
MinReadable = null
Name = null
NominalReading = null
NormalMax = null
NormalMin = null
OperatingStatus = null
OperationalStatus = 2
OtherEnabledState = null
OtherIdentifyingInfo = null
OtherSensorTypeDescription = null
PollingInterval = null
PossibleStates = Normal, Upper Fatal, Upper Critical, Upper Non-Critical, Lower Fatal, Lower Critical, Lower Non-Critical, Unknown
PowerManagementCapabilities = null
PowerManagementSupported = null
PowerOnHours = null
PrimaryStatus = 1
ProgrammaticAccuracy = null
RateUnits = 0
RequestedState = 12
Resolution = null
SensorType = 3
SettableThresholds = 2, 3, 4
Status = null
StatusDescriptions = null
StatusInfo = null
SupportedThresholds = 2, 3, 4
SystemCreationClassName = CCIM_ComputerSystem
SystemName = srv:1
TimeOfLastStateChange = null
Tolerance = null
TotalPowerOnHours = null
TransitioningToState = 12
UnitModifier = -4
UpperThresholdCritical = 33000
UpperThresholdFatal = 0
UpperThresholdNonCritical = 0
ValueFormulation = 2
C:\> winrm set cimv2/CCIM_NumericSensor?CreationClassName=CCIM_NumericSensor+DeviceID=0.0.20.1+SystemName =srv:1+SystemCreationClassName=CCIM_ComputerSystem -r:https://192.0.20.137 -a:Basic -u:admin -p:password -encoding:utf-8 -f:text -skipCNcheck -skipCAcheck @{LowerThresholdCritical="2000"}
CCIM_NumericSensor
Accuracy = null
AccuracyUnits = null
AdditionalAvailability = null
Availability = null
AvailableRequestedStates = null
BaseUnits = 5
Caption = null
CommunicationStatus = null
CreationClassName = CCIM_NumericSensor
CurrentReading = 30096
CurrentState = Normal
Description = null
DetailedStatus = null
DeviceID = 0.0.20.1
ElementName = P3V_BAT_SCALED(0.0.20)
EnabledDefault = 2
EnabledState = 1
EnabledThresholds = null
ErrorCleared = null
ErrorDescription = null
HealthState = 5
Hysteresis = null
IdentifyingDescriptions = null
InstallDate = null
IsLinear = null
LastErrorCode = null
LocationIndicator = null
LowerThresholdCritical = 2000
LowerThresholdFatal = 19932
LowerThresholdNonCritical = 0
MaxQuiesceTime = null
MaxReadable = null
MinReadable = null
Name = null
NominalReading = null
NormalMax = null
NormalMin = null
OperatingStatus = null
OperationalStatus = 2
OtherEnabledState = null
OtherIdentifyingInfo = null
OtherSensorTypeDescription = null
PollingInterval = null
PossibleStates = Normal, Upper Fatal, Upper Critical, Upper Non-Critical, Lower Fatal, Lower Critical, Lower Non-Critical, Unknown
PowerManagementCapabilities = null
PowerManagementSupported = null
PowerOnHours = null
PrimaryStatus = 1
ProgrammaticAccuracy = null
RateUnits = 0
RequestedState = 12
Resolution = null
SensorType = 3
SettableThresholds = 2, 3, 4
Status = null
StatusDescriptions = null
StatusInfo = null
SupportedThresholds = 2, 3, 4
SystemCreationClassName = CCIM_ComputerSystem
SystemName = srv:1
TimeOfLastStateChange = null
Tolerance = null
TotalPowerOnHours = null
TransitioningToState = 12
UnitModifier = -4
UpperThresholdCritical = 33000
UpperThresholdFatal = 0
UpperThresholdNonCritical = 0
ValueFormulation = 2
C:\> winrm get cimv2/CCIM_NumericSensor?CreationClassName=CCIM_NumericSensor+DeviceID=0.0.20.1+SystemName =srv:1+SystemCreationClassName=CCIM_ComputerSystem -r:https://192.0.20.137 -a:Basic -u:admin -p:password -encoding:utf-8 -f:text -skipCNcheck -skipCAcheck
CCIM_NumericSensor
Accuracy = null
AccuracyUnits = null
AdditionalAvailability = null
Availability = null
AvailableRequestedStates = null
BaseUnits = 5
Caption = null
CommunicationStatus = null
CreationClassName = CCIM_NumericSensor
CurrentReading = 30096
CurrentState = Normal
Description = null
DetailedStatus = null
DeviceID = 0.0.20.1
ElementName = P3V_BAT_SCALED(0.0.20)
EnabledDefault = 2
EnabledState = 1
EnabledThresholds = null
ErrorCleared = null
ErrorDescription = null
HealthState = 5
Hysteresis = null
IdentifyingDescriptions = null
InstallDate = null
IsLinear = null
LastErrorCode = null
LocationIndicator = null
LowerThresholdCritical = 1980
LowerThresholdFatal = 19932
LowerThresholdNonCritical = 0
MaxQuiesceTime = null
MaxReadable = null
MinReadable = null
Name = null
NominalReading = null
NormalMax = null
NormalMin = null
OperatingStatus = null
OperationalStatus = 2
OtherEnabledState = null
OtherIdentifyingInfo = null
OtherSensorTypeDescription = null
PollingInterval = null
PossibleStates = Normal, Upper Fatal, Upper Critical, Upper Non-Critical, Lower Fatal, Lower Critical, Lower Non-Critical, Unknown
PowerManagementCapabilities = null
PowerManagementSupported = null
PowerOnHours = null
PrimaryStatus = 1
ProgrammaticAccuracy = null
RateUnits = 0
RequestedState = 12
Resolution = null
SensorType = 3
SettableThresholds = 2, 3, 4
Status = null
StatusDescriptions = null
StatusInfo = null
SupportedThresholds = 2, 3, 4
SystemCreationClassName = CCIM_ComputerSystem
SystemName = srv:1
TimeOfLastStateChange = null
Tolerance = null
TotalPowerOnHours = null
TransitioningToState = 12
UnitModifier = -4
UpperThresholdCritical = 33000
UpperThresholdFatal = 0
UpperThresholdNonCritical = 0
ValueFormulation = 2
Note Because some properties have limited resolution, the actual resulting value may be slightly different from the value specified in the set command, as in this example.
This example reads the current status of the chassis locator LED, turns the LED on by changing the Activation State from 4 to 3, and verifies the new status:
C:\> winrm get cimv2/CCIM_IndicatorLED?SystemCreationClassName=CCIM_ComputerSystem+SystemName=srv:1+Creat ionClassName=CCIM_IndicatorLED+DeviceID=LED_FPID -r:https://192.0.20.137:443 -a:Basic -u:admin -p:password -encoding:utf-8 -f:text -skipCAcheck -skipCNcheck
CCIM_IndicatorLED
ActivationState = 4
AdditionalAvailability = null
Availability = null
AvailableRequestedStates = null
Caption = null
Color = 6
CommunicationStatus = null
ControlMode = 3
ControlPattern = null
CreationClassName = CCIM_IndicatorLED
DefaultActivationState = 4
Description = null
DetailedStatus = null
DeviceID = LED_FPID
ElementName = Chassis Identify LED
EnabledDefault = 2
EnabledState = 5
ErrorCleared = null
ErrorDescription = null
HealthState = null
IdentifyingDescriptions = null
IndicatedConditions = 3
InstallDate = null
LastErrorCode = null
LocationIndicator = null
MaxQuiesceTime = null
Name = null
OperatingStatus = null
OperationalStatus = null
OtherColorDescription = null
OtherEnabledState = null
OtherIdentifyingInfo = null
OtherIndicatedConditionDescription = null
PowerManagementCapabilities = null
PowerManagementSupported = null
PowerOnHours = null
PrimaryStatus = null
RequestedState = 12
Status = null
StatusDescriptions = null
StatusInfo = null
SystemCreationClassName = CCIM_ComputerSystem
SystemName = srv:1
TimeOfLastStateChange = null
TotalPowerOnHours = null
TransitioningToState = 12
C:\> winrm set cimv2/CCIM_IndicatorLED?SystemCreationClassName=CCIM_ComputerSystem+SystemName=srv:1+Creat ionClassName=CCIM_IndicatorLED+DeviceID=LED_FPID -r:https://192.0.20.137:443 -a:Basic -u:admin -p:password -encoding:utf-8 -f:text -skipCAcheck -skipCNcheck @{ActivationState="3"}
CCIM_IndicatorLED
ActivationState = 3
AdditionalAvailability = null
Availability = null
AvailableRequestedStates = null
Caption = null
Color = 6
CommunicationStatus = null
ControlMode = 3
ControlPattern = null
CreationClassName = CCIM_IndicatorLED
DefaultActivationState = 4
Description = null
DetailedStatus = null
DeviceID = LED_FPID
ElementName = Chassis Identify LED
EnabledDefault = 2
EnabledState = 5
ErrorCleared = null
ErrorDescription = null
HealthState = null
IdentifyingDescriptions = null
IndicatedConditions = 3
InstallDate = null
LastErrorCode = null
LocationIndicator = null
MaxQuiesceTime = null
Name = null
OperatingStatus = null
OperationalStatus = null
OtherColorDescription = null
OtherEnabledState = null
OtherIdentifyingInfo = null
OtherIndicatedConditionDescription = null
PowerManagementCapabilities = null
PowerManagementSupported = null
PowerOnHours = null
PrimaryStatus = null
RequestedState = 12
Status = null
StatusDescriptions = null
StatusInfo = null
SystemCreationClassName = CCIM_ComputerSystem
SystemName = srv:1
TimeOfLastStateChange = null
TotalPowerOnHours = null
TransitioningToState = 12
C:\> winrm get cimv2/CCIM_IndicatorLED?SystemCreationClassName=CCIM_ComputerSystem+SystemName=srv:1+Creat ionClassName=CCIM_IndicatorLED+DeviceID=LED_FPID -r:https://192.0.20.137:443 -a:Basic -u:admin -p:password -encoding:utf-8 -f:text -skipCAcheck -skipCNcheck
CCIM_IndicatorLED
ActivationState = 3
AdditionalAvailability = null
Availability = null
AvailableRequestedStates = null
Caption = null
Color = 6
CommunicationStatus = null
ControlMode = 3
ControlPattern = null
CreationClassName = CCIM_IndicatorLED
DefaultActivationState = 4
Description = null
DetailedStatus = null
DeviceID = LED_FPID
ElementName = Chassis Identify LED
EnabledDefault = 2
EnabledState = 5
ErrorCleared = null
ErrorDescription = null
HealthState = null
IdentifyingDescriptions = null
IndicatedConditions = 3
InstallDate = null
LastErrorCode = null
LocationIndicator = null
MaxQuiesceTime = null
Name = null
OperatingStatus = null
OperationalStatus = null
OtherColorDescription = null
OtherEnabledState = null
OtherIdentifyingInfo = null
OtherIndicatedConditionDescription = null
PowerManagementCapabilities = null
PowerManagementSupported = null
PowerOnHours = null
PrimaryStatus = null
RequestedState = 12
Status = null
StatusDescriptions = null
StatusInfo = null
SystemCreationClassName = CCIM_ComputerSystem
SystemName = srv:1
TimeOfLastStateChange = null
TotalPowerOnHours = null
TransitioningToState = 12
This example reads the system event log (SEL) entries, reads the log details, clears the log, and reads the log details again:
C:\> winrm Enumerate cimv2/CCIM_SELLogEntry -r:https://192.0.20.137:443 -a:Basic -u:admin -p:password -encoding:utf-8 -f:text -skipCAcheck -skipCNcheck
CCIM_SELLogEntry
Caption = null
CreationTimeStamp = 20100607145556.000000+000
Description = null
ElementName = System Event Log Entry
InstanceID = CCIM:SEL:Entry:1
Locale = null
LogInstanceID = CCIM:SEL:1
LogName = System Event Log
Message = null
MessageArguments = null
MessageID = null
OwningEntity = null
RecordData = *1*LED_FPID: Platform sensor, OFF event was asserted
RecordFormat = *string Severity*string Description
RecordID = 1
CCIM_SELLogEntry
Caption = null
CreationTimeStamp = 20100607145600.000000+000
Description = null
ElementName = System Event Log Entry
InstanceID = CCIM:SEL:Entry:2
Locale = null
LogInstanceID = CCIM:SEL:1
LogName = System Event Log
Message = null
MessageArguments = null
MessageID = null
OwningEntity = null
RecordData = *1*LED_FPID: Platform sensor, FAST BLINK event was asserted
RecordFormat = *string Severity*string Description
RecordID = 2
C:\> winrm get "http://schemas.cisco.com/wbem/wscim/1/cim-schema/2/CCIM_SELRecordLog?InstanceID=CCIM:SEL: 1" -r:https://192.0.20.137:443 -a:Basic -u:admin -p:password -encoding:utf-8 -f:text -skipCAcheck -skipCNcheck
CCIM_SELRecordLog
AvailableRequestedStates = null
Caption = null
CommunicationStatus = null
CurrentNumberOfRecords = 2
Description = null
DetailedStatus = null
ElementName = System Event Log
EnabledDefault = 2
EnabledState = 2
HealthState = 5
InstallDate = null
InstanceID = CCIM:SEL:1
LogState = 2
MaxNumberOfRecords = 3008
Name = null
OperatingStatus = null
OperationalStatus = 2
OtherEnabledState = null
OverwritePolicy = 7
PrimaryStatus = null
RequestedState = 12
Status = null
StatusDescriptions = null
TimeOfLastStateChange = null
TransitioningToState = 12
C:\> winrm invoke ClearLog "http://schemas.cisco.com/wbem/wscim/1/cim-schema/2/CCIM_SELRecordLog?InstanceID=CCIM:SEL: 1" -r:https://192.0.20.137:443 -a:Basic -u:admin -p:password -encoding:utf-8 -f:text -skipCAcheck -skipCNcheck
ClearLog_OUTPUT
ReturnValue = 0
C:\> winrm get "http://schemas.cisco.com/wbem/wscim/1/cim-schema/2/CCIM_SELRecordLog?InstanceID=CCIM:SEL: 1" -r:https://192.0.20.137:443 -a:Basic -u:admin -p:password -encoding:utf-8 -f:text -skipCAcheck -skipCNcheck
CCIM_SELRecordLog
AvailableRequestedStates = null
Caption = null
CommunicationStatus = null
CurrentNumberOfRecords = 0
Description = null
DetailedStatus = null
ElementName = System Event Log
EnabledDefault = 2
EnabledState = 2
HealthState = 5
InstallDate = null
InstanceID = CCIM:SEL:1
LogState = 2
MaxNumberOfRecords = 3008
Name = null
OperatingStatus = null
OperationalStatus = 2
OtherEnabledState = null
OverwritePolicy = 7
PrimaryStatus = null
RequestedState = 12
Status = null
StatusDescriptions = null
TimeOfLastStateChange = null
TransitioningToState = 12
This example queries the system power management capabilities with a WinRM enumerate command, displays an XML file containing the desired power control changes, and invokes the changes by applying the XML file with a WinRM invoke command:
C:\> winrm enumerate cimv2/CCIM_CSPowerManagementCapabilities -r:https://192.0.20.137:443 -a:Basic -u:admin -p:password -encoding:utf-8 -f:text -skipCAcheck -skipCNcheck
CCIM_CSPowerManagementCapabilities
Caption = null
Description = null
ElementName = Power Management Capabilities
InstanceID = CCIM:pwrmgtcap1
OtherPowerCapabilitiesDescriptions = null
OtherPowerChangeCapabilities = null
PowerCapabilities = null
PowerChangeCapabilities = 3, 4, 7, 8
PowerStatesSupported = 2, 5, 8, 10, 11, 12
C:\> type pwrcntrl_req.xml
<p:RequestPowerStateChange_INPUT xmlns:p='http://schemas.cisco.com/wbem/wscim/1/cim-schema/2/CCIM_CSPowerManagementService' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">
<p:ManagedElement>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
<wsa:ReferenceParameters>
<wsman:ResourceURI>http://schemas.cisco.com/wbem/wscim/1/cim-schema/2/CCIM_ComputerSystem< /wsman:ResourceURI>
<wsman:SelectorSet>
<wsman:Selector Name="Name">srv:1</wsman:Selector>
<wsman:Selector Name="CreationClassName">CCIM_ComputerSystem</wsman:Selector>
</wsman:SelectorSet>
</wsa:ReferenceParameters>
</p:ManagedElement>
<p:PowerState>5</p:PowerState>
<p:Time>00000000000000.000000:000</p:Time>
<p:TimeoutPeriod>00000000000000.000000:000</p:TimeoutPeriod>
</p:RequestPowerStateChange_INPUT>
C:\> winrm invoke RequestPowerStateChange "cimv2/CCIM_CSPowerManagementService?CreationClassName=CCIM_CSPowerManagementService+Name= pwrmgtsvc:1+SystemName=CIMC:1+SystemCreationClassName=CCIM_SPComputerSystem" -r:https://192.0.20.137:443 -a:Basic -u:admin -p:password -encoding:utf-8 -f:pretty -skipCAcheck -skipCNcheck -file:pwrcntrl_req.xml
<n1:RequestPowerStateChange_OUTPUT xmlns:n1="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CCIM_CSPowerManagementService" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<n1:Job xsi:nil="true"></n1:Job>
<n1:ReturnValue>2</n1:ReturnValue>
</n1:RequestPowerStateChange_OUTPUT>