Skip to main content

Install monitoring agent

Before using the monitoring service, you need to install the monitoring agent. The installation process varies depending on the operating system (os) and is divided into linux and windows methods. Instructions for each are provided below.

info

It takes approximately 3 minutes to start collecting data after agent installation.
If user application usage is high, the agent may not be able to collect metrics and logs.
For monitoring agent versions 1.0.0 or lower, it is recommended to set the cpu and memory usage of the user's application to below 95% using cgroup.

Prerequisites

An instance and access key are required for monitoring agent installation.
Refer to Create and connect instance and Get access keys for more details.

Linux users

Follow these steps to install the monitoring agent on an instance with linux os.

  1. Move to the directory where the private key (in .pem format) is located.

  2. After confirming the OS of the instance, connect to the instance via SSH.

    CentOS Command
    chmod 400 {PRIVATE_KEY}.pem # Grant read permission
    ssh -i {PRIVATE_KEY}.pem centos@{INSTANCE_IP}
    ubuntu Command
    chmod 400 {PRIVATE_KEY}.pem # grant read permission
    ssh -i {PRIVATE_KEY}.pem ubuntu@{INSTANCE_IP}
    ItemDescription
    {PRIVATE_KEY}Name of the private key file
    {INSTANCE_IP}Can be found under the Network tab by selecting the pre-created instance in Virtual Machine > Instance
    - If a public IP is not assigned, Bastion or other configuration is required
  3. Use the following command to install the agent.

    CentOS command
    sudo yum localinstall https://objectstorage.kr-central-2.kakaocloud.com/v1/52867b7dc99d45fb808b5bc874cb5b79/kic-monitoring-agent/package/kic_monitor_agent-1.0.0.x86_64.rpm
    Ubuntu command
    wget https://objectstorage.kr-central-2.kakaocloud.com/v1/52867b7dc99d45fb808b5bc874cb5b79/kic-monitoring-agent/package/kic_monitor_agent_1.0.0_amd64.deb
    sudo dpkg -i kic_monitor_agent_1.0.0_amd64.deb
  4. Use the vi command to edit the /etc/default/kic_monitor_agent file.

    Open kic_monitor_agent file
    vi /etc/default/kic_monitor_agent
    sudo vi /etc/default/kic_monitor_agent
    Modify kic_monitor_agent file
    KIC_MONITOR_ENDPOINT_URL="https://monitoring.kr-central-2.kakaocloud.com"

    # ID of the issued user API key
    KIC_MONITOR_AGENT_AUTH_APPLICATION_CREDENTIAL_ID=""

    # Secret of the issued user API key
    KIC_MONITOR_AGENT_AUTH_APPLICATION_CREDENTIAL_SECRET=""

    # Log file path accessible through the Log Explorer
    KIC_LOG_FILE_PATH=""

    ## If the host cannot directly access the public network, an HTTP proxy server can be specified.
    # HTTP_PROXY=http://proxy
    # HTTPS_PROXY=https://proxy
    # NO_PROXY=169.254.169.254
    ItemDescription
    KIC_LOG_FILE_PATHEnter the path of the log file to be sent by the user.
    - Optional; logs sent can be viewed through the Log Explorer.
    - If no file is specified, a file in log format must be designated.
    KIC_MONITOR_ENDPOINT_URLEnter https://monitoring.kr-central-2.kakaocloud.com.
    KIC_MONITOR_AGENT_AUTH_APPLICATION_CREDENTIAL_IDEnter the Access key ID issued from the console.
    - This can be checked at the time of Access key creation or
    by clicking the relevant Access key item in the Access key list.
    KIC_MONITOR_AGENT_AUTH_APPLICATION_CREDENTIAL_SECRETEnter the secret access key issued from the console.
    - This is only viewable at the time of Access key creation.
  5. Run the following commands to start the agent.

    Start agent
    sudo systemctl restart kic_monitor_agent // Manually start the agent
    sudo systemctl enable kic_monitor_agent // Set to enable automatic start upon computer boot
  6. Verify that the agent is running correctly.

    Verify agent execution
    sudo journalctl -u kic_monitor_agent -f

Windows users

The following steps explain how to install the monitoring agent on an instance running the Windows OS.

  1. Search for cmd in the taskbar search box, run Command Prompt as administrator, and enter the powershell command.

  2. Retrieve the compressed file (.zip) from Object Storage.

    Command to retrieve compressed file
    Invoke-WebRequest https://objectstorage.kr-central-2.kakaocloud.com/v1/52867b7dc99d45fb808b5bc874cb5b79/kic-monitoring-agent/package/kic_monitor_agent-1.0.0_windows_amd64.zip -OutFile kic_monitor_agent-1.0.0_windows_amd64.zip
  3. Use the following command to unzip the compressed file.

    Command to unzip the file
    Expand-Archive -Path kic_monitor_agent-1.0.0_windows_amd64.zip
  4. Move to the directory where the compressed file was extracted.

    Change directory
    cd .\kic_monitor_agent-1.0.0_windows_amd64\kic_monitor_agent-1.0.0
  5. Use the following command to install the agent. If upgrading the agent version, uninstall the existing agent first, then proceed with the installation.

    Uninstall agent (for agent version upgrade)
    ./kic_monitor_agent_uninstall.ps1
    Initial execution of agent
    powershell.exe ./kic_monitor_agent_install.ps1 "https://monitoring.kr-central-2.kakaocloud.com" "{Issued Access key ID}" "{Issued Access key Secret}"
    If there are log files to be sent
    powershell.exe ./kic_monitor_agent_install.ps1 "Issued Access key ID" "Issued Access key secret" "Absolute path of the log file"
    Reboot agent
    ./kic_monitor_agent_ctl.ps1 -a stop
    ./kic_monitor_agent_ctl.ps1 -a start
  6. After the agent is installed, check if the agent is running properly.

    Verify agent execution
    Get-Content 'C:\Program Files\KicMonitorAgent\kic_monitor_agent.log' -Wait -Tail 10