IBM Cloud Docs
Using IBM Metrics Collector for SAP (IMCS) on Linux

Using IBM Metrics Collector for SAP (IMCS) on Linux

The IBM® Metrics Collector for SAP (IMCS) on Linux® is a requirement by SAP Support for IBM Cloud® Virtual Private Cloud Infrastructure only when SAP workloads are running on the virtual server instance (VSI).

The IMCS collects performance-related data from IBM Cloud® Virtual Servers for Virtual Private Cloud for SAP. The SAP Support team uses the collected metric data to monitor, troubleshoot, and improve performance of business transactions. Use the following information to help with installing, configuring, and troubleshooting the IBM Metrics Collector for SAP on Linux.

Before you begin

You need to successfully create an IBM Cloud® Virtual Private Cloud and Virtual Servers for VPC by using the appropriate catalog image for SAP. Check SAP Note 2927211 to make sure that the selected operating system is supported by SAP. The Metrics Collector runs specifically on Virtual Servers for VPC to gather required SAP metrics. Figure 1 outlines the data sources that are used by IBM Metrics Collector for SAP.

Figure 1. Data sources for IBM Metrics Collector for SAP
Figure 1. Data sources for IBM Metrics Collector for SAP

Getting an IBM Cloud API key

You need an IBM Cloud API key for IMCS to successfully collect all required metrics. The API key grants view access to IBM Cloud infrastructure services. You can install IMCS without an API key. However, some metrics are missing and the virtual server is not supported by SAP.

For a list of missing metrics, see Additional Information.

You need to create only one Service ID and one API Key per Account. You can use the same Service ID and API Key for all the Metric Collectors that are installed in the virtual server that is associated to the Account.

Creating a Service ID

You need to first create a Service ID and then the related API key. Use the following steps to create a Service ID.

  1. Sign in to the IBM Cloud console and click Manage > Access (IAM).

    Figure 2. Open the Access (IAM page)

    Figure 2. Open the Access (IAM) page
    Figure 2. Open the Access (IAM) page

  2. Click Services IDs > Create.

  3. Enter a Name and Description for the Service ID and click Create. You can assign the Access Policy after your Service ID is created.

  4. Click Access Policies > Assign Access.

  5. Click IAM Services for Assign Service ID additional access.

  6. Select VPC Infrastructure service for What type of access do you want to assign?

  1. Leave the default Account for in
  2. Leave All resource types for Resource type and click Viewer for Platform Access.
  3. Click Add > Assign. The VPC Infrastructure Service policy is assigned to your Service ID.

Creating an API Key for the Service ID.

Use the following steps to create an API Key for the new Service ID.

  1. Select Service IDs and your newly created Service ID
  2. Click the tab Access Policy and verify that the VPC Infrastructure Service is listed as an Access Policy. If not repeat steps 4-9.
  3. Click the next tab API keys > Create.
  4. Enter a Name and Description for the key and click Create.
  5. Click Copy or Download your API key to save it.

This is the only opportunity to access the API Key's data. You cannot view this API key again, so you cannot retrieve it later.

Installing the IBM Metrics Collector for SAP on Linux

The IMCS is a daemon or service that automatically starts as soon as it is installed and requires an API key. It collects metrics from the metadata of the virtual server, IBM Cloud infrastructure services, runtime data about resources, such as CPU, memory, network, and disk. The metrics are aggregated and displayed through the web server for SAP customers. SAPOSCOL uses the XML output of this web server.

The IMCS uses port 18181 to display the metrics. Make sure that port 18181 is not used by any other application. For more information about checking port availability, see Troubleshooting.

The commands that are listed in this section were run on a Red Hat virtual server instance. If you have a SUSE virtual server, you can follow the same steps but you will see a slightly different user interface.

Use the following steps to download the IMCS.

  1. Download the IMCS.

  2. Select the appropriate tar.gz file. In most cases, use the current version. Connect as guest.

  3. Save the file to your internal Downloads folder and click OK.

  4. Move or copy the IMCS tar.gz file to your VPC virtual server instance.

  5. Extract the file and open the extracted folder.

    tar -xvf sap-metrics-collector-v1.3.tar.gz
    cd sap
    
  6. Run the install-linux.sh file.

    ./install-linux.sh
    
  7. Paste your API key when prompted. If you don't have an API key, see Getting an IBM Cloud API key.

  8. Check to make sure that the IMCS is running after the installation is complete. The service status displays active when it is ready.

    sudo systemctl is-active sap-metrics-collector
    

Verifying data collection

After the installation completes and the service is started, it can take time for the IMCS begins collecting metrics. Wait at least 2 minutes after the installation before you expect full and accurate metrics.

  1. Run the following curl command for your localhost address to see your metrics:

    curl http://localhost:18181/sap/metrics
    
     <metrics>
       <metric category="config" context="vm" device-id="" last-refresh="1607451781" refresh-interval="0" type="string" unit="none">
         <name>Data Provider Version</name>
         <value>1.3</value>
       </metric>
       <metric category="config" context="host" device-id="" last-refresh="1607451781" refresh-interval="0" type="string" unit="none">
         <name>Cloud Provider</name>
          <value>IBM Cloud</value>
       </metric>
       <metric category="config" context="vm" device-id="" last-refresh="1607451781" refresh-interval="0" type="string" unit="none">
         <name>Instance Type</name>
         <value>bx2-8x32</value>
       </metric>
       <metric category="config" context="host" device-id="" last-refresh="1607451781" refresh-interval="0" type="string" unit="none">
         <name>Virtualization Solution</name>
         <value>KVM</value>
       </metric>
       .
       .
       .
     </metrics>
    

You might experience a delay before your data is available.

Troubleshooting

Use the following troubleshooting tips for IMCS.

Uninstalling the Metrics Collector

  1. Run the following command to uninstall IMCS if you have any issues during the installation process. Then, reinstall it.

    ./uninstall-linux.sh
    
    Removing IBM Metric Collector for SAP...
    Successfully removed IBM Metric Collector for SAP.
    

No metrics reported when you run the curl command

No reported metrics message is often due to the port not assigned to SAP Metrics Collector. It needs port 18181 available for localhost. If you have any other applications that use the port, you must close the applications.

  1. Use the following command to see whether the port is assigned to another application.

    nmap -sT -O localhost
    
    Starting Nmap 6.40 (http://nmap.org) at (date and time)
    Nmap scan report for localhost (your localhost address)
    Host is up (0.0s latency).
    Other addresses for localhost (not scanned): (localhost addresses)
    rDNS record for (localhost): sap-mc-redhat
    Not shown: (number of) closed ports
    PORT   STATE SERVICE
    (port)/tcp open  ssh
    (port)/tcp open  smtp
    Device type: general purpose
    Running: Linux 3.X
    OS CPE: cpe:/o:linux:linux_kernel:3
    OS details: Linux 3.7 3.9
    Network Distance: 0 hops
    

nmap not found

You can install nmap on your system by using the appropriate package manager like yum or apt-get.

  • Command for Red Hat: yum install nmap
  • Command for SUSE: zypper install nmap

Additional information

If you don't have an IBM Cloud API key, the IMCS can't collect all of the metrics that are required by SAP, which include

  • Network Adapter Mapping - replaced with local MAC ID.
  • Network Adapter Bandwidth - Port Speed - defaults to 0.
  • Disk Volume Mapping - replaced with Volume Attachment ID.
  • Disk Guaranteed IOPS - defaults to 0.

You must provide an API key so that all metrics can be collected. Otherwise, this virtual server is not fully supported by SAP.