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.
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.
-
Move to the directory where the private key (in
.pem
format) is located. -
After confirming the OS of the instance, connect to the instance via SSH.
CentOS Commandchmod 400 {PRIVATE_KEY}.pem # Grant read permission
ssh -i {PRIVATE_KEY}.pem centos@{INSTANCE_IP}ubuntu Commandchmod 400 {PRIVATE_KEY}.pem # grant read permission
ssh -i {PRIVATE_KEY}.pem ubuntu@{INSTANCE_IP}Item Description {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 -
Use the following command to install the agent.
CentOS commandsudo 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 commandwget 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 -
Use the
vi
command to edit the/etc/default/kic_monitor_agent
file.Open kic_monitor_agent filevi /etc/default/kic_monitor_agent
sudo vi /etc/default/kic_monitor_agentModify kic_monitor_agent fileKIC_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=""
# Path of the log file to be sent
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.254Item Description KIC_LOG_FILE_PATH Enter 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_URL Enter https://monitoring.kr-central-2.kakaocloud.com
.KIC_MONITOR_AGENT_AUTH_APPLICATION_CREDENTIAL_ID Enter 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_SECRET Enter the security access key issued from the console.
- This is only viewable at the time of access key creation. -
Run the following commands to start the agent.
Start agentsudo systemctl restart kic_monitor_agent // Manually start the agent
sudo systemctl enable kic_monitor_agent // Set to enable automatic start upon computer boot -
Verify that the agent is running correctly.
Verify agent executionsudo 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.
-
Search for
cmd
in the taskbar search box, run Command Prompt as administrator, and enter thepowershell
command. -
Retrieve the compressed file (
.zip
) from Object Storage.Command to retrieve compressed fileInvoke-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
-
Use the following command to unzip the compressed file.
Command to unzip the fileExpand-Archive -Path kic_monitor_agent-1.0.0_windows_amd64.zip
-
Move to the directory where the compressed file was extracted.
Change directorycd .\kic_monitor_agent-1.0.0_windows_amd64\kic_monitor_agent-1.0.0
-
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 agentpowershell.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 sentpowershell.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 -
After the agent is installed, check if the agent is running properly.
Verify agent executionGet-Content 'C:\Program Files\KicMonitorAgent\kic_monitor_agent.log' -Wait -Tail 10