sls

command module
v0.0.0-...-25c83c6 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

Server-Listener-Sender

Monitor the server CPU memory disk size and report

Install

go install github.com/pkg6/sls@latest

Config.json

Default Path

config.json ,~/.sls/config.json, /etc/sls/config.json

➜  ~ mkdir -p ~/.sls
➜  ~ cat > ~/.sls/config.json << EOF
{
  "listener": [
    "host_info",
    "cpu_percent",
    "loadavg",
    "memory",
    "disk"
  ],
  "sender": {
    "console": {}
  }
}
EOF

Or Run with config

sls -f config.json

RUN results

----------------------------------主机信息----------------------------------
主机名:zhiqiang.local 内核版本:23.5.0 运行时间:12Day正在运行进程数:763
--------------------------------------------------------------------------------
----------------------------------CPU使用率----------------------------------
6.265664
--------------------------------------------------------------------------------
----------------------------------工作负载----------------------------------
1分钟:3.229492 5分钟:3.187012 15分钟:3.087891
--------------------------------------------------------------------------------
-------------------------------------内存-------------------------------------
总内存:16384MB 空闲内存:1366.06MB 已使用内存:9688.38MB
--------------------------------------------------------------------------------
----------------------------------磁盘信息----------------------------------
路径:/ 大小:465.63GB 已使用:127.20GB 可用:338.43GB
路径:/dev 大小:0.00GB 已使用:0.00GB 可用:0GB
路径:/System/Volumes/Preboot 大小:465.63GB 已使用:127.20GB 可用:338.43GB
路径:/System/Volumes/VM 大小:465.63GB 已使用:127.20GB 可用:338.43GB
路径:/System/Volumes/Update 大小:465.63GB 已使用:127.20GB 可用:338.43GB
路径:/System/Volumes/Data 大小:465.63GB 已使用:127.20GB 可用:338.43GB
路径:/System/Volumes/Data/home 大小:0GB 已使用:0GB 可用:0GB
--------------------------------------------------------------------------------

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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