Token导航 LogoToken导航TokenDH.com
MCP Ebpf logo
运维云端未说明官方级别未说明来源级核验

MCP Ebpf

MCP Server

一个模块化的eBPF监控系统,提供HTTP API服务器,用于实时网络和系统事件监控,支持Kubernetes和虚拟机部署。

工具数

0

提示词数

0

GitHub Stars

18

资源数

0
网络监控实时监控Go

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

SRodi

提供方

SRodi

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

eBPF网络监视器

![CI](https://github.com/srodi/ebpf-server/actions/workflows/ci.yml) ![API Documentation](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/srodi/ebpf-server/main/docs/swagger/swagger.json) ![OpenAPI Spec](docs/swagger.json) ](https://golang.org)

具有HTTP API服务器的模块化eBPF监控系统,用于实时网络和系统事件监控。 支持VM和Kubernetes部署 具有自动元数据丰富功能。

🚀 部署选项

Kubernetes部署(推荐)

通过自动节点元数据丰富在整个Kubernetes集群中部署:

# Quick deployment with built-in script
./scripts/deploy.sh all --registry your-registry.com

# Or step by step
make docker-build
make docker-push REGISTRY=your-registry.com
make k8s-deploy

📖 完整的Kubernetes指南 -详细的设置和配置

带种类的本地测试

在本地测试完整的Kubernetes部署:

# Full automated test
make kind-full-test

# Or step by step:
make kind-cluster-create    # Create local cluster
make kind-deploy           # Deploy to kind cluster  
make kind-integration-test # Run comprehensive tests

获取聚合器的详细API文档,仅在Kubernetes模式下可用 请参阅API聚合器文档

VM部署(传统)

对于单服务器部署:

# Install dependencies (Ubuntu/Debian)
sudo apt install -y golang-go clang libbpf-dev linux-headers-$(uname -r)

# Build and run
make build
sudo ./bin/ebpf-server

# Test the API
curl http://localhost:8080/health
curl "http://localhost:8080/api/events?type=connection&limit=10"

📚 交互式API文档 -在浏览器中测试API

✨ 主要特点

🔄 双重部署支持

  • Kubernetes模式:用于集群范围监控的DaemonSet+聚合器架构
  • 虚拟机模式:传统的单服务器部署
  • 自动检测:无缝检测环境并调整行为

🏷️ Kubernetes元数据扩展

Kubernetes中的事件包含丰富的元数据:

{
  "id": "abc123",
  "type": "connection",
  "k8s_node_name": "worker-node-1",
  "k8s_pod_name": "ebpf-monitor-xyz",
  "k8s_namespace": "ebpf-system",
  ...
}

🏗️ 可扩展体系结构

Kubernetes模式:具有集中聚合功能的分布式监控

┌─────────────────────────────────────────────────────────┐
│                    Kubernetes Cluster                   │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────┐  │
│  │    Node 1   │  │    Node 2   │  │        Node N   │  │
│  │ ┌─────────┐ │  │ ┌─────────┐ │  │   ┌─────────┐   │  │
│  │ │ eBPF    │ │  │ │ eBPF    │ │  │   │ eBPF    │   │  │
│  │ │ Agent   │ │  │ │ Agent   │ │  │   │ Agent   │   │  │
│  │ │+K8s Meta│ │  │ │+K8s Meta│ │  │   │+K8s Meta│   │  │
│  │ └────┬────┘ │  │ └────┬────┘ │  │   └────┬────┘   │  │
│  └──────┼──────┘  └──────┼──────┘  └────────┼────────┘  │
│         │                │                  │           │
│         └────────────────┼──────────────────┘           │
│                          │                              │
│                    ┌─────▼─────┐                        │
│                    │   eBPF    │                        │
│                    │ Aggregator│◄─── Unified API        │
│                    │           │                        │
│                    └───────────┘                        │
└─────────────────────────────────────────────────────────┘

虚拟机模式:模块化、基于接口的监控系统

┌─────────────────────────────────────────────────────┐
│                     eBPF Programs                   │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  │
│  │ Connection  │  │ Packet Drop │  │   Custom    │  │
│  │ Monitor     │  │ Monitor     │  │   Monitors  │  │
│  └──────┬──────┘  └──────┬──────┘  └─────────┬───┘  │
└─────────┼─────────────────┼──────────────────┼-─────┘
          │                 │                  │
          └─────────────────┼──────────────────┘
                            ▼
               ┌─────────────────────────┐
               │    Event Processing     │
               │   (Manager + Storage)   │
               └─────────────┬───────────┘
                             ▼
               ┌─────────────────────────┐
               │       HTTP API          │
               │    (/api/events)        │
               └─────────────────────────┘

📊 统一监控

  • 交叉节点相关性:查看整个Kubernetes集群中的事件
  • 节点特定筛选:按特定节点或Pod查询事件
  • 汇总统计数据:集群范围内的事件统计和指标
  • 向后兼容:现有VM部署继续保持不变

📡 API功能

  • 统一事件API:单人 /api/events 所有监控数据的端点
  • 灵活过滤:按事件类型、PID、命令和时间窗口筛选
  • Kubernetes过滤:按节点名称、pod名称或命名空间筛选
  • 程序状态:通过查看程序状态和指标 /api/programs
  • 自动生成的文档:代码注释中的OpenAPI 3.0规范
  • 交互式测试:用于API勘探的内置Swagger UI

核心终点

  • GET /health -系统健康和状态
  • GET /api/events -查询支持过滤的事件
  • GET /api/programs -列出所有程序及其状态

查询示例

# Get all connection events from the last hour
curl "http://localhost:8080/api/events?type=connection&since=2023-01-01T00:00:00Z"

# Get events for a specific process
curl "http://localhost:8080/api/events?pid=1234&limit=50"

# Kubernetes: Get events from specific node
curl "http://localhost:8080/api/events?k8s_node_name=worker-1"

查询参数

  • type:事件类型过滤器(例如,“connection”、“packet_drop”)
  • pid:进程ID筛选器
  • command:命令名称筛选器
  • k8s_node_name, k8s_pod_name, k8s_namespace:Kubernetes过滤器
  • since, until:RFC3339时间戳过滤器
  • limit:最大结果(默认值:100)

🛠️ 发展

# Development build with debug logging
make build-dev && sudo ./bin/ebpf-server-dev

# Generate API docs
make docs

# Run tests
make test

# Build eBPF programs
make build-bpf

📚 完整开发指南 -创建新eBPF监控程序的详细指南

📁 项目结构

├── cmd/                 # Application entry points
│   ├── server/         # eBPF monitoring server
│   └── aggregator/     # Kubernetes aggregator
├── internal/
│   ├── core/          # Core interfaces and types
│   ├── events/        # Event system (BaseEvent, streams)
│   ├── programs/      # eBPF program implementations
│   ├── storage/       # Event storage and querying
│   ├── api/          # HTTP API handlers
│   ├── kubernetes/   # Kubernetes metadata integration
│   └── system/       # System initialization
├── bpf/              # eBPF C programs and headers
├── kubernetes/       # Kubernetes manifests
├── scripts/          # Deployment and testing scripts
└── docs/            # Documentation and API specs

🔧 需求

  • Linux内核4.18+ 支持eBPF
  • Root权限 用于eBPF程序加载
  • 依赖项:Go 1.23+、Clang、libbpf-dev、内核头文件
  • 库贝内特斯:1.20+(适用于K8s部署)

📖 安装指南: docs/setup.md

📄 许可证

MIT许可证-请参阅 许可证 文件。

目录标签

目录标签

网络监控实时监控Go本地部署eBPFKubernetes系统事件

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP