feat: 初步集成 zabbix agent
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user