更新包路径
This commit is contained in:
1 parent
6ab1876899
commit
a4f7c82de6
101 files changed
+220
-250
No files matched your search
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
)
|
||||
|
||||
// FileAssetsCollector 文件资产收集器
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
)
|
||||
|
||||
// fillFileOwnership 填充文件所有者和组信息 (Unix系统)
|
||||
|
||||
@@ -5,7 +5,7 @@ package audit
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
)
|
||||
|
||||
// fillFileOwnership 填充文件所有者和组信息 (Windows系统)
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
)
|
||||
|
||||
// KernelAssetsCollector 内核资产收集器
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
)
|
||||
|
||||
// LoginAssetsCollector 登录日志收集器
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
gopsutilNet "github.com/shirou/gopsutil/v4/net"
|
||||
"github.com/shirou/gopsutil/v4/process"
|
||||
)
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
"github.com/shirou/gopsutil/v4/process"
|
||||
)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
)
|
||||
|
||||
// UserAssetsCollector 用户资产收集器
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
)
|
||||
|
||||
// 状态常量
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
"github.com/shirou/gopsutil/v4/host"
|
||||
"github.com/shirou/gopsutil/v4/process"
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
|
||||
"github.com/shirou/gopsutil/v4/cpu"
|
||||
)
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
)
|
||||
|
||||
// 默认 IPv4 API 列表
|
||||
|
||||
+13
-13
@@ -3,20 +3,20 @@ package collector
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/dushixiang/pika/pkg/agent/config"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/pkg/agent/config"
|
||||
"github.com/shirou/gopsutil/v4/disk"
|
||||
)
|
||||
|
||||
// 不以 /dev/ 开头但仍是真实存储的文件系统类型
|
||||
var realFSTypes = map[string]bool{
|
||||
"nfs": true,
|
||||
"nfs4": true,
|
||||
"cifs": true,
|
||||
"smbfs": true,
|
||||
"zfs": true,
|
||||
"nfs": true,
|
||||
"nfs4": true,
|
||||
"cifs": true,
|
||||
"smbfs": true,
|
||||
"zfs": true,
|
||||
"glusterfs": true,
|
||||
"cephfs": true,
|
||||
"cephfs": true,
|
||||
}
|
||||
|
||||
// DiskCollector 磁盘监控采集器
|
||||
@@ -47,12 +47,12 @@ func isRealDisk(device, fstype string) bool {
|
||||
|
||||
// macOS APFS 容器内与数据卷共享物理空间的系统辅助卷
|
||||
var macosSystemVolumes = map[string]bool{
|
||||
"Preboot": true,
|
||||
"VM": true,
|
||||
"Update": true,
|
||||
"xarts": true,
|
||||
"Preboot": true,
|
||||
"VM": true,
|
||||
"Update": true,
|
||||
"xarts": true,
|
||||
"iSCPreboot": true,
|
||||
"Hardware": true,
|
||||
"Hardware": true,
|
||||
}
|
||||
|
||||
// isMacOSRedundant 判断是否为 macOS APFS 冗余系统卷
|
||||
|
||||
@@ -3,7 +3,7 @@ package collector
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
"github.com/shirou/gopsutil/v4/disk"
|
||||
)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
)
|
||||
|
||||
const nvidiaSmiTimeout = 15 * time.Second
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/dushixiang/pika/pkg/agent/config"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/pkg/agent/config"
|
||||
)
|
||||
|
||||
// ErrNoData 表示采集成功但当前周期无有效数据可上报(如 GPU 不存在、磁盘列表为空)。
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package collector
|
||||
|
||||
import (
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
"github.com/shirou/gopsutil/v4/mem"
|
||||
)
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
)
|
||||
|
||||
// MonitorCollector 监控采集器
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/dushixiang/pika/pkg/agent/config"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/pkg/agent/config"
|
||||
gopsutilNet "github.com/shirou/gopsutil/v4/net"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package collector
|
||||
|
||||
import (
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
"github.com/shirou/gopsutil/v4/net"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package collector
|
||||
|
||||
import (
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
"github.com/shirou/gopsutil/v4/host"
|
||||
"github.com/shirou/gopsutil/v4/load"
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
"github.com/shirou/gopsutil/v4/sensors"
|
||||
)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/pkg/agent/utils"
|
||||
"github.com/pika-monitor/pika/pkg/agent/utils"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -6,8 +6,8 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/dushixiang/pika/pkg/agent/utils"
|
||||
"github.com/google/uuid"
|
||||
"github.com/pika-monitor/pika/pkg/agent/utils"
|
||||
)
|
||||
|
||||
// Manager 管理探针的唯一标识
|
||||
|
||||
@@ -13,14 +13,14 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/dushixiang/pika/pkg/agent/audit"
|
||||
"github.com/dushixiang/pika/pkg/agent/collector"
|
||||
"github.com/dushixiang/pika/pkg/agent/config"
|
||||
"github.com/dushixiang/pika/pkg/agent/id"
|
||||
"github.com/dushixiang/pika/pkg/agent/sshmonitor"
|
||||
"github.com/dushixiang/pika/pkg/agent/tamper"
|
||||
"github.com/dushixiang/pika/pkg/version"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/pkg/agent/audit"
|
||||
"github.com/pika-monitor/pika/pkg/agent/collector"
|
||||
"github.com/pika-monitor/pika/pkg/agent/config"
|
||||
"github.com/pika-monitor/pika/pkg/agent/id"
|
||||
"github.com/pika-monitor/pika/pkg/agent/sshmonitor"
|
||||
"github.com/pika-monitor/pika/pkg/agent/tamper"
|
||||
"github.com/pika-monitor/pika/pkg/version"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/jpillora/backoff"
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"sort"
|
||||
"sync"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
)
|
||||
|
||||
// metricsStore is a constant-size, latest-wins snapshot store. Delivery state
|
||||
|
||||
@@ -3,7 +3,7 @@ package service
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
)
|
||||
|
||||
func metricSample(metricType protocol.MetricType, timestamp int64) protocol.MetricSample {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/dushixiang/pika/pkg/agent/utils"
|
||||
"github.com/pika-monitor/pika/pkg/agent/utils"
|
||||
)
|
||||
|
||||
const legacyMetricsBufferDBName = "metrics_buffer.db"
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/dushixiang/pika/pkg/agent/collector"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/pkg/agent/collector"
|
||||
)
|
||||
|
||||
// collectorBaseInterval 采集循环的基础节奏,所有采集器的采集间隔必须是它的整数倍
|
||||
|
||||
@@ -12,12 +12,12 @@ import (
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/dushixiang/pika/pkg/agent"
|
||||
"github.com/dushixiang/pika/pkg/agent/config"
|
||||
"github.com/dushixiang/pika/pkg/agent/sshmonitor"
|
||||
"github.com/dushixiang/pika/pkg/agent/sysutil"
|
||||
"github.com/dushixiang/pika/pkg/agent/updater"
|
||||
"github.com/kardianos/service"
|
||||
"github.com/pika-monitor/pika/pkg/agent"
|
||||
"github.com/pika-monitor/pika/pkg/agent/config"
|
||||
"github.com/pika-monitor/pika/pkg/agent/sshmonitor"
|
||||
"github.com/pika-monitor/pika/pkg/agent/sysutil"
|
||||
"github.com/pika-monitor/pika/pkg/agent/updater"
|
||||
)
|
||||
|
||||
// program 实现 service.Interface
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/dushixiang/pika/pkg/agent/config"
|
||||
"github.com/pika-monitor/pika/pkg/agent/config"
|
||||
)
|
||||
|
||||
func TestRemoveAgentDataDefaultConfig(t *testing.T) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
)
|
||||
|
||||
// SendEventFromEnv 从 PAM 环境变量构建并发送事件
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/internal/protocol"
|
||||
"github.com/pika-monitor/pika/internal/protocol"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/dushixiang/pika/pkg/agent/config"
|
||||
"github.com/minio/selfupdate"
|
||||
"github.com/pika-monitor/pika/pkg/agent/config"
|
||||
)
|
||||
|
||||
// VersionInfo 版本信息
|
||||
|
||||
Reference in new issue
Block a user