Skip to main content
Version: v1.6.x

Monitoring:Using Scripts to Monitor Linux Operating System

Preparation

To monitor the local machine, simply deploy Hertzbeat. To monitor other hosts, you need to deploy a collector on the target host. Refer to this link for step 5 of the installation process. When creating a monitoring task and selecting a collector, choose the corresponding collector deployed on the target host.

Configuration Parameters

Parameter NameParameter Description
Monitor HostThe IPv4, IPv6, or domain of the monitored endpoint. Note ⚠️ Do not include protocol headers (e.g., https://, http://).
Task NameThe name identifying this monitoring task, which needs to be unique.
CollectorSpecifies which collector will be used for data collection in this monitoring task.
Monitoring IntervalThe time interval for periodic data collection, in seconds.
Binding TagClassification management tags for monitoring resources.
Description NotesAdditional notes to describe this monitoring task. Users can add remarks here.

Metrics Collection

Metric Set: basic

Metric NameMetric UnitMetric Description
hostnameNoneName of the host
versionNoneOperating system version
uptimeNoneSystem uptime

Metric Set: cpu

Metric NameMetric UnitMetric Description
infoNoneCPU model
coresNumberNumber of CPU cores
interruptCountNumber of CPU interrupts
loadNoneAverage CPU load over the last 1/5/15 minutes
context_switchCountCurrent number of context switches
usage%CPU usage percentage

Metric Set: memory

Metric NameMetric UnitMetric Description
totalMbTotal memory capacity
usedMbMemory used by user programs
freeMbFree memory capacity
buff_cacheMbMemory used by cache
availableMbAvailable memory capacity
usage%Memory usage percentage

Metric Set: disk

Metric NameMetric UnitMetric Description
disk_numCountTotal number of disks
partition_numCountTotal number of partitions
block_writeCountTotal number of blocks written to disk
block_readCountTotal number of blocks read from disk
write_rateiopsRate of blocks written to disk per second

Metric Set: interface

Metric NameMetric UnitMetric Description
interface_nameNoneNetwork interface name
receive_bytesbyteInbound data traffic (bytes)
transmit_bytesbyteOutbound data traffic (bytes)

Metric Set: disk_free

Metric NameMetric UnitMetric Description
filesystemNoneName of the filesystem
usedMbUsed disk size
availableMbAvailable disk size
usage%Disk usage percentage
mountedNoneMount point directory

Metric Set: Top 10 Programs by CPU Usage

Metric NameMetric UnitMetric Description
idNoneProcess ID
cpu%CPU usage percentage
ws%Memory usage percentage
commandNoneExecuted command

Metric Set: Top 10 Programs by Memory Usage

Metric NameMetric UnitMetric Description
idNoneProcess ID
cpu%CPU usage percentage
ws%Memory usage percentage
commandNoneExecuted command