各 CIM クラスには、クラス オブジェクトの配列を返す静的な getInstances() メソッドがあります。
CA Server Automation で管理されているシステムをすべて取得するには、以下のコマンドを使用します。
aObjs = CA_ComputerSystem.getInstances() ? "Query returned", oObjs.length
CA Server Automation で管理されているシステムのサブセットを取得するには、以下のフィルタ表現のいずれかを使用します。
aObjs = CA_ComputerSystem.getInstances("ElementName=’Everest.local'")
または
aObjs = CA_ComputerSystem.getInstances("ElementName like 'Ev*'")
システム名と説明を取得するには、以下のコマンドを使用します。
aObjs = CA_ComputerSystem.getInstances(); for(i=0; i<aObjs.length; i++) ? aObjs[i].getElementName(),aObjs[i].getDescription()
CIM オブジェクトのプロパティと値を取得するには、以下のコマンドを使用します。
aObjs = CA_ComputerSystem.getInstances("ElementName='Debian1'")
show-cimObject aObjs[0]
例: show-cimObject コマンドの出力
CA_ComputerSystem ================= Caption: null Description: null ElementName: Debian1 Facets: 44 InstallDate: null Name: 47332da1-e782-0308-d614-c2e99de989bc OperationalStatus: undefined StatusDescriptions: undefined Status: null HealthState: 5 PropagatedHealthState: null IsPropagated: true PrimaryStatus: null DetailedStatus: null OperatingStatus: null CommunicationStatus: null ManagementStatus: null EnabledState: null OtherEnabledState: null RequestedState: null EnabledDefault: null TimeOfLastStateChange: null AvailableRequestedStates: undefined TransitioningToState: null CreationClassName: CA_ComputerSystem NameFormat: null PrimaryOwnerName: null PrimaryOwnerContact: null Roles: undefined OtherIdentifyingInfo: undefined IdentifyingDescriptions: undefined Dedicated: undefined OtherDedicatedDescriptions: undefined ResetCapability: null PowerManagementCapabilities: undefined HostName: 192.168.1.119 IpAddress: null SerialNumber: null Version: null CpuCount: 1 TotalVisibleMemorySize: 256 PatchLevel: null BiosVersion: null Fans: null Chassis: null DrCapable: null VendorId: null MacAddress: null ArchTypeUID: null Available: null LastUpdate: null SnapshotType: null TotalStorageCapacity: null Model: null CpuSpeed: null SystemImageId: null HardwareClassId: null
|
Copyright © 2013 CA.
All rights reserved.
|
|