IBM Cloud Docs
Monitoring an Ubuntu Linux VPC server instance

Monitoring an Ubuntu Linux VPC server instance

Use this tutorial to learn how to configure an Ubuntu host to forward metrics to the IBM Cloud Monitoring service in the IBM Cloud.

These instructions are for Ubuntu systems but can be used for other Linux systems.

To configure an Ubuntu server to forward metrics, you must install a monitoring agent. The agent uses an access key (token) to authenticate with the IBM Cloud Monitoring instance. The monitoring agent acts as a data collector. It automatically collects metrics.

By default, this agent collects core infrastructure and network time series that you can use to monitor the host. For a list of collected metrics, see Metrics Available for non-orchestrated environments.

The Monitoring agent automatically collects the following types of system metrics per host:

  • System hosts metrics provide information about CPU, memory, and storage usage metrics, that you can use to analyze the performance and resource utilization of all your processes.

  • File and File System metrics provide information about files and file system that you can use to analyze file interactions that occur in your system. For example, you can find information about your open files, bytes going in and out, or the percentage of usage of a given file system.

  • Process metrics provide information about the processes that run in your servers. For example, you can use these metrics to explore the number of processes, or get client or server information.

  • Network metrics provide information about the network. They offer insight to the connections that are established between your applications, containers, and servers. For example, you can find information about the bytes that are being sent or received, or the number of HTTP requests, connections, and latency. In addition, for SQL or MongoDB, the agent collects additional information when it is configured in troubleshooting mode.

Through the Monitoring UI, you can analyze data in the Advisor tab, the Explore tab, and in the Dashboard tab. You monitor the data through metric views and dashboards.

Consider the following information when monitoring your data:

  • In the Explorer tab, you can monitor individual metrics.

  • In the Advisor tab, you can monitor Red Hat OpenShift or host level metrics.

    This tab is only available for users that belong to a team that has access to monitor Red Hat OpenShift or host level metrics.

  • In the Dashboard tab, you can monitor through panels predefined dashboards or custom ones and get a specialized insight into network data, application data, topology, services, hosts, and containers. A panel displays a metric or group of metrics in a dashboard.

For each metric view and dashboard, you can define the scope of the data, how to aggregate data, and what time and group filters to apply to the data. For more information, see Managing panels.

You can configure a dashboard as the default entry point for a team, unifying a team's experience, and allowing users to focus their immediate attention on the most relevant information for them.

For more information, see Viewing metrics.

Before you begin

Read about IBM Cloud Monitoring.

Work in a supported region, for example the US South region.

Use a user ID that is a member or an owner of an IBM Cloud account. To get an IBM Cloud IBMID, go to Create an account.

Your IBMID must have assigned IAM policies for each of the following resources:

Table 1. List of IAM policies required to complete the tutorial
Resource Scope of the access policy Role Region Information
Resource group default Resource group Viewer US South This policy is required to allow the user to see service instances in the default resource group.
IBM Cloud Monitoring service Resource group Editor US South This policy is required to allow the user to provision and administer the IBM Cloud Monitoring service in the default resource group.

The IBM Cloud CLI must be installed. For more information, see Installing the IBM Cloud CLI.

Provision an Ubuntu Linux VPC server instance

If you have an existing Ubuntu Linux virtual server instance you want to monitor, you can skip this step.

  1. If you don't have a virtual private cloud, use the IBM Cloud console to create VPC resources.

  2. If you don't have an Ubuntu Linux virtual server instance, create an Umbuntu Linux virtual server instance by using the UI and selecting Ubuntu Linux as the Operating System.

Provision an IBM Cloud Monitoring instance

To provision an instance of IBM Cloud Monitoring through the IBM Cloud UI, complete the following steps:

  1. Log in to your IBM Cloud account.

    After you log in with your user ID and password, the IBM Cloud UI opens.

  2. Click Catalog. The list of the services that are available in IBM Cloud opens.

  3. To filter the list of services that is displayed, select the Logging and Monitoring category.

  4. Click the IBM Cloud Monitoring tile. The Observability dashboard opens.

  5. Select the Create tab.

  6. Select a region for the service instance.

  7. Select the Lite service plan.

    By default, the Lite plan is set.

    For more information about other service plans, see Pricing.

  8. Enter a Service name for the service instance.

  9. Select the default resource group.

    By default, the default resource group is set.

  10. (Optional) Specify any tags you want to use.

  11. Select whether of not the service instance receives platform metrics for all service instances in the region.

  12. To provision the IBM Cloud Monitoring service in the IBM Cloud resource group where you are logged in, click Create.

After you provision an instance, the Monitoring dashboard opens.

Note: To provision an instance through the CLI, see Provisioning an instance through the IBM Cloud CLI.

Configure your Ubuntu server to send metrics to your instance

To configure your Ubuntu server to send metrics to your IBM Cloud Monitoring instance, you must install a monitoring agent.

Complete the following steps from a command line:

  1. Open a terminal. Then, log in to the IBM Cloud. Run the following command and follow the prompts:

    ibmcloud login -a cloud.ibm.com
    

    Select the account and region where the IBM Cloud Monitoring instance is available.

  2. Access your Ubuntu server.

  3. Obtain the access key. For more information, see Getting the access key through the IBM Cloud UI.

  4. Obtain the ingestion URL. For more information, see collector endpoints.

  5. Deploy the monitoring agent. Run the following command:

    curl -sL https://ibm.biz/install-sysdig-agent | sudo bash -s -- --access_key <ACCESS_KEY> --collector <COLLECTOR_ENDPOINT> --collector_port 6443 --secure true --check_certificate false --tags <TAG_DATA> --additional_conf 'sysdig_capture_enabled: false'
    

    Where

    • ACCESS_KEY is the access key for the instance.

    • COLLECTOR_ENDPOINT is the ingestion URL for the region where the monitoring instance is available. To determine the endpoint, see Collector endpoints.

    • TAG_DATA are comma-separated tags that are formatted as TAG_NAME:TAG_VALUE. You can associate one or more tags to your monitoring agent. For example, role:serviceX,location:us-south. Later on, you can use these tags to identify metrics from the environment where the agent is running.

    • The sysdig_capture_enabled is set to false to disable the capture feature. By default this is set to true. For more information, see Working with captures.

    • The secure flag must be set to true to use a secure SSL/TLS connection to send metrics to the collector.

    If the monitoring agent fails to install correctly, install the kernel headers manually. Choose a distribution and run the command for that distribution. Then, retry the deployment of the monitoring agent.

    • For Debian and Ubuntu Linux distributions, run the following command:

      apt-get -y install linux-headers-$(uname -r)
      
    • For RHEL, CentOS, and Fedora Linux distributions, run the following command:

      yum -y install kernel-devel-$(uname -r)
      
  6. Configure the agent for non-orchestrated environments.

    Open the dragent.yaml file that is located in /opt/draios/etc/.

    Add the following configuration parameter:

    feature:
      mode: monitor_light
    

    Restart the agent. Run the following command:

    service dragent restart
    

Launch the monitoring UI

Complete the following steps to launch the web UI:

  1. Log in to your IBM Cloud account.

    After you log in with your user ID and password, the IBM Cloud Dashboard opens.

  2. In the navigation menu, select Observability.

  3. Select Monitoring.

    The list of instances that are available on IBM Cloud is displayed.

  4. Select your instance. Then, click Open dashboard.

IIt may take some time before you see the server entry while the information is initally collected and processed by the monitoring agent.

You only can monitor one instance per browser. You could have multiple tabs for the same instance.

Monitor your Ubuntu server

You can monitor your Ubuntu server in the Overview view that is available through the Web UI. This view is your starting point to troubleshoot and monitor your infrastructure. It is the default homepage of the Web UI.

In the section Hosts & containers, you can find the entry for your Ubuntu server. Click Hosts & containers Hosts & containers to switch data sources. Then, select your Ubuntu server. The data that is displayed corresponds to the selected server.

To configure color-coding for a column, complete the following steps:

  1. Select a column by hovering your mouse over the column title. Then, click the pencil icon.

  2. Toggle Enable to enable color-coding.

  3. Set values for the different thresholds.

Next steps