All Projects → wushikj → mix-agent

wushikj / mix-agent

Licence: GPL-2.0 license
基于rust语言开发的一套运维监控探针,支持widnows、linux、macos系统

Programming Languages

rust
11053 projects
powershell
5483 projects
shell
77523 projects

Projects that are alternatives of or similar to mix-agent

Myperf4j
High performance Java APM. Powered by ASM. Try it. Test it. If you feel its better, use it.
Stars: ✭ 2,281 (+16192.86%)
Mutual labels:  agent, monitor
Librehardwaremonitor
Libre Hardware Monitor, home of the fork of Open Hardware Monitor
Stars: ✭ 685 (+4792.86%)
Mutual labels:  monitor, system
WindowsMonitor
WMI namespaces and classes
Stars: ✭ 15 (+7.14%)
Mutual labels:  monitor, system
Iglance
Free system monitor for OSX and macOS. See all system information at a glance in the menu bar.
Stars: ✭ 1,358 (+9600%)
Mutual labels:  monitor, system
Bistoury
Bistoury是去哪儿网的java应用生产问题诊断工具,提供了一站式的问题诊断方案
Stars: ✭ 3,198 (+22742.86%)
Mutual labels:  agent, monitor
Sysmon
A B/S mode system monitor for linux (demo http://199.247.1.240:2048)
Stars: ✭ 110 (+685.71%)
Mutual labels:  monitor, system
Node Os Monitor
simple OS monitoring for Node.js
Stars: ✭ 83 (+492.86%)
Mutual labels:  monitor, system
Logdna Agent
LogDNA Agent streams from log files to your LogDNA account. Works with Linux, Windows, and macOS Servers
Stars: ✭ 134 (+857.14%)
Mutual labels:  agent, monitor
monitor
mac 实时网速监控 bandwidh monitor
Stars: ✭ 23 (+64.29%)
Mutual labels:  monitor, system
laravel-gamify
Laravel Gamify: Gamification System with Points & Badges support
Stars: ✭ 35 (+150%)
Mutual labels:  system
YggdrasilOfficialProxy
MojangYggdrasil的更新! 以代理的方式提供伪正版与正版的实现
Stars: ✭ 89 (+535.71%)
Mutual labels:  agent
ansible-role-dns
Install and configure dns on your system.
Stars: ✭ 39 (+178.57%)
Mutual labels:  system
vaper
Take a look at the relations among servers.
Stars: ✭ 16 (+14.29%)
Mutual labels:  monitor
bundlemon
Monitor your bundle size
Stars: ✭ 53 (+278.57%)
Mutual labels:  monitor
KubeArmor
Cloud-native Runtime Security Enforcement System
Stars: ✭ 434 (+3000%)
Mutual labels:  system
swarm-monitor
Monitor a Docker Swarm with Blinkt! LED
Stars: ✭ 48 (+242.86%)
Mutual labels:  monitor
monitor-man
HTTP API monitor based on postman and newman.
Stars: ✭ 44 (+214.29%)
Mutual labels:  monitor
dynamic-engine
Monitor events in the background on Android.
Stars: ✭ 24 (+71.43%)
Mutual labels:  monitor
StatusPilatus
Monitor your PC like never before!
Stars: ✭ 52 (+271.43%)
Mutual labels:  monitor
evoplex
Evoplex is a fast, robust and extensible platform for developing agent-based models and multi-agent systems on networks. It's available for Windows, Linux and macOS.
Stars: ✭ 98 (+600%)
Mutual labels:  agent

基于rust的监控探针,主要用于监控硬件及操作系统,监控日志上报至服务端进行分析、计算、告警。

探针

已完成

  • mix_agent_cpu cpu 监控,默认5秒执行一次(收集10次发送)
  • mix_agent_machine 获取服务器基本信息,默认1天一次(零点)
  • mix_agent_memory 内存监控,默认15秒一次
  • mix_agent_disk 磁盘监控,默认30分钟一次
  • mix_agent_directory 获取目录信息,默认1天一次(零点)
  • mix_agent_process 进程监控,默认10分钟一次
  • mix_agent_service windows服务监控,默认10分钟一次

说明:所有探针在安装后会自动执行一次,不需要等到指定的时间。

待完成

  • mix_agent_updater
  • mix_agent_keeper
  • mix_agent_network

全局配置

以下配置信息保存在 config/app.yml 文件

customer-id: 2acb32811b9c93f6d5d6e90440771398 # 客户编号
project-id: P20200008,P20200009 # 多个使用逗号分隔
mix-endpoint: http://abc.com # 日志接收端点
mix-endpoint-key: 1234513abABqe131413 # 端点密钥
keeper-check-cron: 1/15 * * * * * * # 暂未实现
print-log-json: true # 是否输入日志内容,生产环境建议false
env: dev # 环境,默认dev。prod正式,dev开发、test测试
timeout: 5000 # 接口请求超时配置,毫秒
push-log: true # 是否提交日志,一般只用于开发测试

探针配置

配置文件均放在config目录下,有些探针强制需要配置文件,有些则不需要。

  • global.yml - 必要,全局配置,主要修改customer-idproject-id
  • mix_agent_machine.yml - 必要,machine探针使用,主要配置machine-name属性,以指示服务器的名称,未指定时web系统中的服务名称将无法显示(为空)
  • mix_agent_directory.yml - directory探针使用,主要配置root-path属性,以指示要监控的目录地址
  • mix_agent_process.yml - 进程探针使用,配置要监控的目录进程
  • mix_agent_service.yml - windows服务监控探针使用,配置要监控的目录服务

日志格式

{
        "batch_id": "20210105200851081379000", //纳秒
        "identity": {
            "customer_id": "460001",
            "project_id": "P12342",
            "target_ip": "192.168.30.11"  //目标IP
        },
        "time": "1610697769239",  //毫秒
        "level": "info",
        "tags": [    //tags的内容可选
            "os|linux",
            "ip|192.168.30.11"
        ],
        "content":"",  //目前只有探针使用此字段
        "category": "",
        "raw_data": {
            "percent_used": 41.39,
            "used": 3.27,
            "free": 4.63,
            "total": 7.91
        },
        "remark": "",  //备注
        "priority": "height",
        "env": "prod",
        "source": {
            "from": "agent",  //日志来源
            "name": "mix_agent_cpu",
            "version": "1.1.2",
            "lang": "java", //开发探针的语言
            "ip": "192.168.30.199" //探针所在主机Ip
        }
    }

日志来源

可自定义

level-日志级别

  • info
  • error
  • warn
  • trace
  • debug

priority-优先级

  • high
  • middle
  • low

部署

目录结构

  • mix_agent_cpu
  • mix_agent_disk
  • ....
  • mix_agent_keeper
  • control.sh
  • control.ps1
  • shawl.exe windows平台使用的服务安排工具
  • config

以命令行运行

该方式可用于安装为后台服务前的测试。

linux

./mix_agent_xxx

windows

使用 管理员权限打开 powershell命令行执行相关操作。

.\mix_agent_xxx

说明:以上命令中的xxx代表具体的探针名称。

安装为后台服务

Linux

linux下目前设计了4个控制脚本:

  • install.sh 用于安装单个探针
  • install_basic_agent.sh 用于安装基础探针(cpu、内存、磁盘、服务器信息)
  • query_installed_agent.sh 用于查询本机已安装的探针
  • stop_all_agent.sh 用于停止所有探针(即kill -9进程号)

以下仅针对 install.sh脚本做说明

./install.sh agent_name

agent_name为具体的探针名称

windows

  • control.ps1 用于安装、启用、停止、删除探针服务
  • install_basic_agent.ps1 用于安装基础探针(cpu、内存、磁盘、服务器信息)
  • query_installed_agent.ps1 用于查询本机已安装的探针
  • stop_all_agent.ps1 用于停止所有探针

使用 管理员权限打开 powershell,转到工作目录下执行 control.ps1脚本文件,注意需使用管理员权限。

安装-install

注:安装成功后,会自动启动

.\control.ps1 -type install -name mix_agent_cpu

启动-start

.\control.ps1 -type start -name mix_agent_cpu

启动所有服务

.\control.ps1 -type start -all

重启-restart

.\control.ps1 -type restart -name mix_agent_cpu

重启所有服务

.\control.ps1 -type restart -all

删除-remove

删除时,会自动先停止对应服务再删除

.\control.ps1 -type remove -name mix_agent_cpu

删除所有服务

删除时,会自动先停止对应服务再删除

.\control.ps1 -type remove -all

停止-stop

.\control.ps1 -type stop -name mix_agent_cpu

停止所有服务

.\control.ps1 -type stop -all

查看状态-status

.\control.ps1 -type status -name mix_agent_cpu
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].