feat: 初步集成 zabbix agent

This commit is contained in:
2024-08-22 16:48:04 +08:00
parent e148d8aeda
commit dc53b3aaf8
12 changed files with 289 additions and 19 deletions

View File

@ -2,13 +2,19 @@ package onvif
import (
"github.com/IOTechSystems/onvif"
"strings"
)
type Connection struct {
Device *onvif.Device `json:"device"`
}
func NewConnection(xaddr string, username string, password string) (*Connection, error) {
func New(xaddr string, username string, password string) (*Connection, error) {
// 规范化连接地址
if !strings.Contains(xaddr, ":") {
xaddr += ":80"
}
dev, err := onvif.NewDevice(onvif.DeviceParams{
Xaddr: xaddr,
Username: username,