Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Blog
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
Yandex project
© 2023 Yandex.Cloud LLC
Yandex Monitoring
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Working with metrics
      • Delivering Linux system metrics
      • Delivering custom application metrics
      • Delivering metrics from HAProxy and other third-party applications
      • Delivering metrics from hosts outside Yandex Cloud
      • Writing custom metrics via the API
      • Getting a list of metrics
      • Downloading metrics
      • Exporting metrics in Prometheus format
    • Working with dashboards
      • Creating dashboards
      • Copying dashboards
      • Adding widgets to a dashboard
      • Deleting widgets from a dashboard
      • Deleting dashboards
      • Examples of working with the gRPC API
    • Working with alerts
      • Creating alerts
      • Creating notification channels
      • Deleting alerts
  • Concepts
    • Service overview
    • Data model
    • Visualization
      • Overview
      • Query string
      • Widgets
      • Dashboards
    • Transmitting metrics
      • Agent for delivering metrics
        • Overview
        • Installation and startup
        • Configuration
        • Best practices for using the agent
    • Query language
    • Alerting
    • Data decimation
    • Deleting expired metrics (TTL)
    • Quotas and limits
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Policy before October 1, 2020
  • API reference
    • Authentication in the API
    • REST
      • Overview
      • MetricsData
        • Overview
        • read
        • write
        • prometheusMetrics
      • MetricsMeta
        • Overview
        • listLabelKeys
        • listLabelValues
        • listMetricNames
        • listMetrics
    • gRPC
      • Overview
      • DashboardService
  • Metric reference
  • Questions and answers
    • General questions
    • Navigation
    • Metric collection and export
    • Metrics and units of measure
    • Alerts / notifications
    • All questions on one page
  1. Step-by-step instructions
  2. Working with metrics
  3. Delivering Linux system metrics

Delivering Linux system metrics

Written by
Yandex Cloud

    To deliver system metrics for virtual machines running on Linux-compatible operating systems to Yandex Monitoring, use the input linux_metrics.

    Warning

    Delivery of system metrics for virtual machines run on Windows and macOS is planned for upcoming Yandex Unified Agent releases.

    To configure Yandex Unified Agent to collect system metrics from a Yandex Cloud VM, follow these steps:

    1. Set up a service account from which metrics will be written to Yandex Monitoring.

      1. Create a service account in the folder you want to write metrics to and assign it the monitoring.editor role.

      2. Link your service account to a virtual machine with Unified Agent installed.

    2. Install and configure Yandex Unified Agent.

      1. Create a file named config.yml in your home folder:

        config.yml:

         status:
           port: "16241"
        
         storages:
           - name: main
             plugin: fs
             config:
               directory: /var/lib/yandex/unified_agent/main
               max_partition_size: 100mb
               max_segment_size: 10mb
        
         channels:
           - name: cloud_monitoring
             channel:
               pipe:
                 - storage_ref:
                     name: main
               output:
                 plugin: yc_metrics
                 config:
                   folder_id: "$FOLDER_ID"
                   iam:
                     cloud_meta: {}
        
         routes:
           - input:
               plugin: linux_metrics
               config:
                 namespace: sys
             channel:
               channel_ref:
                 name: cloud_monitoring
        
           - input:
               plugin: agent_metrics
               config:
                 namespace: ua
             channel:
               pipe:
                 - filter:
                     plugin: filter_metrics
                     config:
                       match: "{scope=health}"
               channel_ref:
                 name: cloud_monitoring
        
         import:
           - /etc/yandex/unified_agent/conf.d/*.yml
        

        Where $FOLDER_ID is the ID of the folder to write metrics to.

      2. Install Unified Agent on your VM by running the following command in the home folder:

        docker run \
        -p 16241:16241 -it --detach --uts=host \
        --name=ua \
        -v `pwd`/config.yml:/etc/yandex/unified_agent/config.yml \
        -v /proc:/ua_proc \
        -e PROC_DIRECTORY=/ua_proc \
        -e FOLDER_ID=a1bs... \
        cr.yandex/yc/unified-agent
        

        You can find more ways to install the agent in Installing and running Yandex Unified Agent.

    3. Make sure the metrics are delivered to Yandex Monitoring.

      1. On the home page Yandex Monitoring, go to Metric Explorer.

      2. In the query block, select:

      • The folder where metrics are collected.
      • The label value service=custom.
      • The metric name starting with the sys prefix.

    What's next

    • Review Unified Agent concepts
    • Learn more about configuring Unified Agent
    • Read the Unified Agent operating instructions

    Was the article helpful?

    Language / Region
    Yandex project
    © 2023 Yandex.Cloud LLC