sysbase

command module
v0.0.0-...-d6d71be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2018 License: MIT Imports: 4 Imported by: 0

README

About

Confirm to KISS principle.

Linux system base monitor metrics collector.

Linux 系统基础监控项采集实现。

Usage

go get -u github.com/OpenCCTV/sys_base

For more detail, see main.go.

Network bandwidth

网卡流量统计

注意:多张网卡接口需要用 tags 分类。

Grafana 配图用 order by ts asc,平时调试 SQL 用 order by ts desc。例:

TimescaleDB SQL

select date_trunc('minute', "ts") as time, metric, sum(value) from datapoints where metric='net.in.bytes' and tags->>'face'='enp0s3' group by ts, metric order by ts asc;

Clickhouse SQL

SELECT
    $timeSeries as t,
    value as `net.in.bytes`
FROM $table
WHERE
    $timeFilter
    and endpoint= '$endpoint'
    and metric = 'net.in.bytes'	
    and visitParamExtractString(tags, 'face') = '$iface'
ORDER BY t

查看网卡流量实时变化

watch -n 1  -d 'cat /proc/net/dev'

Documentation

Overview

Example collect all system base monitor metrics.

Directories

Path Synopsis
package metricsCPU implements collect CPU related monitor metrics.
package metricsCPU implements collect CPU related monitor metrics.
package metricsDisk implements collect harddisk related monitor metrics.
package metricsDisk implements collect harddisk related monitor metrics.
package helpers implements helper functions, such as execute command without shell ENV COLUMNS=80 limit, parse size in bytes or from string etc.
package helpers implements helper functions, such as execute command without shell ENV COLUMNS=80 limit, parse size in bytes or from string etc.
package metricsMem implements collect memory related monitor metrics.
package metricsMem implements collect memory related monitor metrics.
package datapoint implements monitor metric model walk around issue about complex nest JSON Object serialization.
package datapoint implements monitor metric model walk around issue about complex nest JSON Object serialization.
package metricsNet implements collect network related monitor metrics.
package metricsNet implements collect network related monitor metrics.
package metricsTop implements collect system load and memory usage related monitor metrics.
package metricsTop implements collect system load and memory usage related monitor metrics.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL