Giter Site home page Giter Site logo

moyu's Introduction

墨鱼探针

简介

墨鱼探针目前是单页面探针,后期将做成主从架构,用同一个监控面板监控多个vps。

技术栈:go(fiber) + vue2 + element-ui + nes.css。

最终将前端和后端全部编译到一个二进制程序中,方便部署。

展示

moyu_pic

Docker运行

前提说明

直接运行docker无法获取宿主机信息,需要添加一些运行参数:

  1. 由于需要获取宿主机网络接口流量,所以需要以host方式运行docker。
  2. 获取磁盘分区信息需要/proc/N/mountinfo,所以需要将宿主机的某个进程的文件挂载到docker中,然后设置HOST_PROC_MOUNTINFO并运行项目。
  3. 项目PORT变量默认8080,可自行指定其他端口。

容器运行

  1. 自行编译或下载我编译好的镜像,下载的版本号可以是latestrelease版本号。
    docker build -t moyu .
    docker pull liuxu/moyu
    docker pull liuxu/moyu:v1.0.3
  2. 单磁盘挂载情况下运行,其中--network=host指定使用宿主机网络,--mount挂载dockerd的进程mountinfo文件到docker中,并设置HOST_PROC_MOUNTINFO为挂载的文件路径。
    docker run --network=host -e PORT=8080 --mount type=bind,source="/proc/$(pidof dockerd)/mountinfo",target=/root/mountinfo -e HOST_PROC_MOUNTINFO=/root/mountinfo liuxu/moyu
  3. (可选)如果还有其他分区,如我的/boot/efi挂载到了独立分区,想获取到这个分区信息,需要把这个目录挂载到docker中。
    docker run --network=host -e PORT=8080 -v /boot/efi:/boot/efi:ro --mount type=bind,source="/proc/$(pidof dockerd)/mountinfo",target=/root/mountinfo -e HOST_PROC_MOUNTINFO=/root/mountinfo liuxu/moyu

编译使用

依赖:

make: ^4.0

nodejs: ^18.0

go: ^1.19.0

一键编译

  1. 进入项目目录。

    cd moyu
  2. 一键编译。

    make
  3. 运行墨鱼探针。

    PORT=80 ./backend/moyu
  4. (可选)清理项目,删除编译的墨鱼探针二进制等文件。

    make clean

手动编译

  1. 进入项目目录。

    cd moyu
  2. 编译前端资源。

    cd frontend
    npm run build
  3. 编译后端项目。

    cd ../backend
    go build .
  4. 运行墨鱼探针。

    PORT=80 ./moyu

moyu's People

Contributors

liuquanhao avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.