How to Collect Host Objects¶
Introduction¶
TrueWatch helps you easily monitor any host infrastructure, whether traditional hosts, servers, or public or private cloud objects. By installing DataKit, you can monitor the status, name, operating system, processor, memory, network, disk, connection tracking, files, and more of hosts in real time. Additionally, rich features such as associated queries, custom labels, and interactive host distribution maps allow you not only to manage hosts uniformly but also to monitor their status holistically.
Prerequisites¶
- You need to first create a TrueWatch account.
- Install DataKit
- Supported operating systems:
windows/amd64,windows/386,linux/arm,linux/arm64,linux/386,linux/amd64,darwin/amd64
Methods/Steps¶
Step 1: Enable the Host Object Collector¶
After completing the installation of DataKit on the host/server, you can follow these steps to enable host object data collection:
-
Navigate to the
conf.d/host
directory under the DataKit installation directory, copyhostobject.conf.sample
, and rename it tohostobject.conf
. -
After configuration, restart DataKit using the command
datakit --restart
. -
After configuration, the system will default to enabling a batch of host-related collectors and actively report data to the "TrueWatch" workspace. The list of collectors enabled by default is as follows:
Collector Name | Description |
---|---|
cpu |
Collects CPU usage of the host |
disk |
Collects disk usage |
diskio |
Collects disk IO information of the host |
mem |
Collects memory usage of the host |
swap |
Collects Swap memory usage |
system |
Collects operating system load of the host |
net |
Collects network traffic information of the host |
host_processes |
Collects lists of processes that have been running for more than 10 minutes on the host |
hostobject |
Collects basic information about the host (e.g., operating system and hardware information) |
container |
Collects possible container objects and container logs on the host |
For more host object data collection, refer to the help documentation DataKit Host Object Collector.
Step 2: Enable Cloud Synchronization¶
If the host where DataKit resides is a cloud host, you can enable cloud synchronization via the cloud_provider
tag. Follow these steps:
-
Navigate to the
conf.d/host
directory under the DataKit installation directory at/usr/local/datakit
, copyhostobject.conf.sample
, and rename it tohostobject.conf
. -
Open the
hostobject.conf
file and enable the following configurations: -
Enable
inputs.hostobject.tags
- Enable
cloud_provider = "aliyun"
-
After configuration, use the command
datakit --restart
to restart DataKit for the changes to take effect. -
After enabling cloud synchronization, the system will actively report the following fields to the "TrueWatch" workspace (based on the synchronized fields):
Field Name | Description |
---|---|
cloud_provider |
Cloud provider |
description |
Description |
instance_id |
Instance ID |
instance_name |
Instance name |
instance_type |
Instance type |
instance_charge_type |
Instance billing type |
instance_network_type |
Instance network type |
instance_status |
Instance status |
security_group_id |
Instance group |
private_ip |
Private IP address of the instance |
zone_id |
Zone ID of the instance |
region |
Region ID of the instance |
For more host object data collection, refer to the help documentation DataKit Host Object Collector.
Step 3: View Host Data¶
In the TrueWatch workspace under "Infrastructure" -> "Host", you can view detailed data information for each host within the last 24 hours through the Host Object List, including hostname and tags, CPU utilization, MEM utilization, single-core CPU load, etc.
Clicking on the hostname in the host object list will bring up the Host Details Page, where you can view detailed host information, such as hardware model, basic resource consumption, associated logs, processes, events, and more.
For further host object analysis, refer to the help documentation Host.
Advanced References¶
Associated Analysis¶
- Explore Associated Data
If you want to build comprehensive and in-depth host monitoring, after enabling other related host data collectors, you can instantly explore logs, processes, abnormal events, containers, networks, security checks, and more related to the host through the "TrueWatch" dashboard.
To enable other related host data collectors, refer to Logs, Processes, Containers, Network, Security Checks.
- Custom Built-in Views
Custom built-in views can help you bind associated views to the host details page for linked data viewing. Based on your analytical needs, by selecting official system views or custom user views as built-in views, this feature not only facilitates the rapid expansion of host association analysis scope using official templates but also supports editing new monitoring views according to your requirements.
For example, to monitor the CPU of host objects labeled as "test," add the system view "CPU Monitoring View" as a built-in view on the host details page for linked querying of host CPU status. Follow these steps:
-
In the TrueWatch workspace, navigate to "Management" -> "Built-in Views" and select the system view "CPU Monitoring View".
-
Click "Edit" and select the binding relationship with the field label: test.
-
Click "OK" to create the binding relationship.
- View this built-in view on the corresponding viewer details page.
For more configuration details, refer to Binding Built-in Views.
Interactive Host Topology Map¶
Creating monitorable multi-host environments requires a topology map that clearly displays the operational environment of the data center. On the "TrueWatch" dashboard, by switching the viewer in the upper left corner of the page to "Host Topology Map", you can visually query host metric data sizes and quickly analyze the operational status of hosts across different systems, statuses, versions, regions, and other custom tags.
For more information, refer to Host Topology Map.
Custom Measurement¶
To facilitate categorizing familiar metrics, "TrueWatch" allows you to customize tags for host objects by configuring [inputs.hostobject.tags]
in the host collector. These tags can be used to filter out related host objects.
For detailed configuration methods, refer to: DataKit Host Object Collector
Custom Labels¶
To help you flexibly and effectively manage your IT infrastructure environment, TrueWatch provides an infrastructure label feature. It allows you to classify, search, filter, and centrally manage hosts based on label tags.