Overview
SAP Host Agent provides the following Web service APIs to access operating system data:
Provided data is based on the Common Information Model (CIM). CIM class documentation is available here:
The following documents provide the mapping of the deprecated saposcol-based APIs to the new APIs:
- Mapping of saposcol metrics to SAP_Metric classes
- Mapping of SAP_ComputerSystem data to SAP_ITSAM classes
The saphostctrl command line tool provides convenient methods to access this data:
GetCIMObject API
The GetCIMObject API is a CIM-based API providing access to different information providers. The API is mainly semantic free and returns an array of CIMObject. The method gets parameters as key/value pairs. Every key/value pair represents a method call on a provider. It is also possible to bind more requests together in one Web service call.
Please refer to the WSDL of the SAPHostControl Web service for more details on the method signature and data structures (http://:1128/SAPHostControl/?wsdl ).
The following groups of operating system classes are supported:
SAP_ITSAM Classes
SAP_ITSAM classes provide access to configuration-like, infrequent changing, data. The following classes are available:
Classname
|
Description
|
Supported method
|
---|---|---|
SAP_ITSAMComputerSystem | Provides computer system data |
|
SAP_ITSAMOperatingSystem | Provides operating system data |
|
SAP_ITSAMProcessor | Provides processor data. An instance for each processor is provided. |
|
SAP_ITSAMNetworkPort | Provides network interface data. An instance for each network interface is provided. |
|
SAP_ITSAMFileSystem | Provides file system data. An instance for each file system is provided. |
|
SAP_ITSAMSoftwarePackage | Provides installed software data. An instance for each installed software package is provided. |
|
SAP_ITSAMSoftwarePatch | Provides installed patches data. An instance for each installed patch is provided. |
|
SAP_ITSAMOSProcess | Provides OS process data. An instance for each running process is provided. Returned instances can be filtered as described in Enumerating SAP_ITSAMOSProcess Instances. |
|
SAP_ITSAMVirtualComputerSystem | Provides virtual computer system data. It will only be provided if the computer system is running in a virtual machine or container. |
|
SAP_ITSAMHostComputerSystem | Describes a computer system that hosts a SAP_ITSAMVirtualComputerSystem. It will only be provided if the computer system is running in a virtual machine or container. |
|
For detailed documentation of the classes and its properties please refer to SAP CIM Model for Operating System Monitoring.
In case you want to get all data describing the complete computer system you can also use the more convenient GetComputerSystem API.
Enumerating SAP_ITSAMOSProcess Instances
Returned SAP_ITSAMOSProcess instances can be filtered by the following properties:
Name
|
Description
|
---|---|
CommandLine | Filter by CommandLine property. '*' wildcard character can be used to match zero or more characters and '?' to match one character. Can be specified multiple times. |
Username | Filter by Username property. '*' wildcard character can be used to match zero or more characters and '?' to match one character. Can be specified multiple times. |
PID | Filter by PID property. Can be specified multiple times. |
Filter properties that can be specified multiple times can also be combined. Per default same filter types are or'ed, different are and'ed. Optionally, the combination operators AND/OR can explicitly be specified. The AND operator has higher precedence than OR.
Filter properties are specified like a URI query, they are introduced with a ? character and separated by an & character.
If a reserved URI character ( '?&%' ) it used in the filter pattern it must be percent-encoded (http://tools.ietf.org/html/rfc3986). For an example please refer to Enumerate processes and filter by a term that contains a reserved URI character.
If the result of an enumeration would exceed 25000 instances an "Not selective enough" exception is returned.
Enumerating Top CPU Consuming SAP_ITSAMOSProcess Instances
By specifying the optional argument topprocesses the top N (default 40) CPU consuming processes will be returned. The topprocesses argument needs to be specified by using two ? characters.
Examples
Enumerate operating system data
Use the following query to enumerate operating system data:
Enumerate file system data
Use the following query to enumerate file system data:
Enumerate processes that match a single filter term
Simple example to enumerate processes that match a single filter term, the command line contains saphostexec:
Enumerate processes that match multiple filter terms
To enumerate processes that match multiple filter terms, the command line contains sapstartsrv and command is executed by user sapadm:
Enumerate processes that match multiple filter terms using the AND operator
The previous query can also be specified by explicitly using the AND combination operator:
Enumerate processes and combine filter terms using AND/OR operators
More advanced example to filter out processes where the command line contains either saphostexec or sapstartsrv and the latter is executed by the sapadm user:
Enumerate processes and filter by a term that contains a reserved URI character
To filter out processes that are executed in context of any adm user one could use the filter pattern ???adm. Whereas the ? character denotes a wildcard that matches one character. As the ? character is a reserved URI character is must be percent-encoded as %3F. So the actual query arguments would be:
Enumerate the top 40 CPU consuming processes
Enumerate the top 10 CPU consuming processes
SAP_Metric Classes
These classes provide OS performance metrics.
Classname
|
Description
|
Supported method
|
---|---|---|
SAP_MetricDefinition | Provides the meta data of a metric |
|
SAP_MetricValue | Provides the actual value of a metric. Returned instances can be filtered as described in Enumerating SAP_MetricValue Instances. |
|
Enumerating SAP_MetricValue Instances
Returned SAP_MetricValue instances can be filtered by the following properties:
Name
|
Description
|
---|---|
Interval |
Filter by interval. There are 5, 15 and 60 minute summation intervals in addition to the 1 minute collection interval.
Needs to be specified in CIM datetime interval format: 00000000000100.000000:000 (1 min, default), 00000000000500.000000:000 (5 min), ... |
MetricDefinitionId | Filter by MetricDefinitionId e.g. OS.UserTimePercentage. '*' wildcard character can be used to match zero or more characters and '?' to match one character. Can be specified multiple times. |
MeasuredElementType | Filter by measured resource type. Currently, valid types are OperatingSystem, Disk, FileSystem, NetworkPort, VirtualComputerSystem, HostComputerSystem. '*' wildcard character can be used to match zero or more characters and '?' to match one character. Can be specified multiple times. |
MeasuredElementName | Filter by MeasuredElementName. '*' wildcard character can be used to match zero or more characters and '?' to match one character. Can be specified multiple times. |
StartTime/EndTime
| Filter by time range. Times need to be specified in CIM datetime format. StartTime=0: Only current values are returned (default). StartTime=-1: All available values are returned. |
Filter properties that can be specified multiple times can also be combined. Per default same filter types are or'ed, different are and'ed. Optionally, AND, OR properties can be used to explicitly specify the combination operator. AND has higher precedence than OR.
If the result of an enumeration would exceed 25000 instances an "Not selective enough" exception is returned.
Examples
Enumerate all available metrics
Enumerate all metric definitions
Enumerate overall CPU user and system time
Enumerate all metrics of a specified file system
Enumerate all disk metrics
Enumerate available physical memory from the 5 minute interval
Enumerate all hourly overall CPU idle times from a specific time in the past
GetComputerSystem API
The method GetComputerSystem is designed as a commodity function to select from a CIM-based repository all the classes describing the features of the computer system where the SAPHostAgent is running.
The method returns a CIMObject. This represents an instance of CIM_ComputerSystem (or a derived class). The instances of the other classes that describe the computer system are provided as members of the CIM_ComputerSystem instance.
The method accepts the following optional properties as arguments:
Key
|
Description
|
---|---|
provider
|
Specifies the providers to be used for gathering the computer system data.
wbem: The operating system's WBEM infrastructure (if available) will be used for gathering the computer system data sapitsam: Computer system data as supplied by the SAP_ITSAM Providers |
Please refer to the WSDL of the SAPHostControl Web service for more details on the method signature and data structures (http://:1128/SAPHostControl/?wsdl ).
SAP_ITSAM Providers
Instances of the following classes will be provided:
- SAP_ITSAMComputerSystem
- SAP_ITSAMOperatingSystem
- SAP_ITSAMProcessor
- SAP_ITSAMNetworkPort
- SAP_ITSAMFileSystem
- SAP_ITSAMVirtualComputerSystem
- SAP_ITSAMHostComputerSystem
SAP_ITSAMVirtualComputerSystem and SAP_ITSAMHostComputerSystem instances will only be provided if the computer system is running in a virtual machine or container. All instances are members of the SAP_ITSAMComputerSystem instance, except SAP_ITSAMHostComputerSystem which is a member of the SAP_ITSAMVirtualComputerSystem instance.
The SAP_ITSAM providers accept the following optional properties as arguments:
Key
|
Description
|
---|---|
swpackages
|
Include installed software represented as SAP_ITSAMSoftwarePackage instances. These instances are provided as members of SAP_ITSAMComputerSystem.
|
swpatches
|
Include installed patches represented as SAP_ITSAMSoftwarePatch instances. These instances are provided as members of SAP_ITSAMComputerSystem.
|
topprocesses
|
Include top N (default 40) CPU consuming processes represented as SAP_ITSAMOSProcess instances. These instances are provided as members of SAP_ITSAMOperatingSystem.
|
SAP CIM Model for Operating System Monitoring
CIM model for operating system classes is available here. Please download it, extract it and point a browser to the contained index.html.
The saphostctrl Command Line Tool
The saphoctrl command line tool provides a convenient interface for accessing the operating system data. To get the detailed usage you can run the following command, e.g. on Unix:
To get the usage of a specific Web service method:
Get Computer System Data
The GetComputerSystem function provides the GetComputerSystem API data. To get the complete usage, execute the following command:
Examples
Get the SAP_ITSAM computer system data
Get the SAP_ITSAM computer system data along with the information about installed software
List operating system processes
The ListOSProcesses provides the SAP_ITSAMOSProcess data. To get the complete usage, execute the following command::
Examples
Enumerate processes that match a single filter term
Simple example to enumerate processes that match a single filter term, the command line contains saphostexec:
Enumerate processes that match multiple filter terms
To enumerate processes that match multiple filter terms, the command line contains sapstartsrv and command is executed by user sapadm:
Enumerate processes that match multiple filter terms using the AND operator
The previous query can also be specified by explicitly using the AND combination operator:
Enumerate processes and combine filter terms using AND/OR operators
More advanced example to filter out processes where the command line contains either saphostexec or sapstartsrv and the latter is executed by the sapadm user:
Enumerate the top 40 CPU consuming processes
Enumerate the top 10 CPU consuming processes
Operating System Monitoring - APIs
List operating system metrics
The ListOSMetrics provides the SAP_Metric data. To get the complete usage, execute the following command:
No comments:
Post a Comment