Documentation
¶
Overview ¶
Package datastore : データ保存
Package datastore : データ保存
Index ¶
- Constants
- Variables
- func AddDrawItem(di *DrawItemEnt) error
- func AddEventLog(e *EventLogEnt)
- func AddLine(l *LineEnt) error
- func AddNetwork(n *NetworkEnt) error
- func AddNode(n *NodeEnt) error
- func AddOTelMetric(m *OTelMetricEnt)
- func AddOrUpdateIcon(i *IconEnt) error
- func AddPolling(p *PollingEnt) error
- func AddPollingLog(p *PollingEnt) error
- func AddPollingWithDupCheck(p *PollingEnt) error
- func BackupDB(file string) error
- func CheckCharCode(s string) string
- func ClearCAData()
- func ClearPollingLogs(ids []string) error
- func CloseDB()
- func CompactDB(srcPath, dstPath string) error
- func DeleteAIResult(id string) error
- func DeleteAllLogs(b string) error
- func DeleteAllMqttStat() error
- func DeleteAllOTelData() error
- func DeleteArpEnt(ips []string) error
- func DeleteCertMonitor(id string)
- func DeleteDrawItem(id string) error
- func DeleteIcon(icon string) error
- func DeleteLine(lineID string) error
- func DeleteMqttStats(ids []string)
- func DeleteNetwork(id string) error
- func DeleteNode(nodeID string) error
- func DeleteNodeStateChanged(id string)
- func DeleteNotifyOAuth2Token() error
- func DeleteOTelMetric(m *OTelMetricEnt)
- func DeleteOldMqttStats(days int)
- func DeletePollings(ids []string) error
- func FindVendor(mac string) string
- func ForEachArp(f func(*ArpEnt) bool)
- func ForEachCert(cb func(c *CertEnt) bool)
- func ForEachCertMonitors(f func(*CertMonitorEnt) bool)
- func ForEachEventLog(st, et int64, f func(*EventLogEnt) bool) error
- func ForEachItems(f func(*DrawItemEnt) bool)
- func ForEachLastArpLogs(f func(*ArpLogEnt) bool) error
- func ForEachLastEventLog(f func(*EventLogEnt) bool) error
- func ForEachLastPollingLog(pollingID string, f func(*PollingLogEnt) bool) error
- func ForEachLastSyslog(f func(*SyslogEnt) bool) error
- func ForEachLastTraps(f func(*TrapEnt) bool) error
- func ForEachLines(f func(*LineEnt) bool)
- func ForEachLogs(st, et int64, lt string, f func(*LogEnt) bool) error
- func ForEachMqttStat(f func(s *MqttStatEnt) bool)
- func ForEachNetFlow(st, et int64, f func(*NetFlowEnt) bool) error
- func ForEachNetworks(f func(*NetworkEnt) bool)
- func ForEachNodes(f func(*NodeEnt) bool)
- func ForEachOTelMetric(f func(m *OTelMetricEnt) bool)
- func ForEachOTelTrace(tbk string, f func(t *OTelTraceEnt) bool)
- func ForEachPollings(f func(*PollingEnt) bool)
- func ForEachSFlow(st, et int64, f func(*SFlowEnt) bool) error
- func ForEachSFlowCounter(st, et int64, f func(*SFlowCounterEnt) bool) error
- func ForEachStateChangedNodes(f func(string) bool)
- func ForEachSyslog(st, et int64, f func(*SyslogEnt) bool) error
- func ForEachTraps(st, et int64, f func(*TrapEnt) bool) error
- func GenSSHPrivateKey() []byte
- func GetDBSize() int64
- func GetDataStorePath() string
- func GetLLM(ctx context.Context) (llms.Model, error)
- func GetLoc(sip string) string
- func GetMIBValueString(name string, variable *gosnmp.SnmpPDU, raw bool) string
- func GetNodeMemo(nodeID string) string
- func GetNotifyOAuth2Token() *oauth2.Token
- func GetOTelTraceBucketList() []string
- func GetPrivateKey(pm bool) []byte
- func GetSSHPublicKey() (string, error)
- func GetServiceName(prot, port int) (string, bool)
- func GetSshdPublicKeys() string
- func HasLine(l1 *LineEnt, isNet bool) bool
- func HasValidNotifyOAuth2Token(n NotifyConfEnt) bool
- func Init(ctx context.Context, path string, wg *sync.WaitGroup) error
- func InitCAConf(req CreateCAReq) error
- func IsGlobalUnicast(ips string) bool
- func IsPrivateIP(ip net.IP) bool
- func LoadMailTemplate(t string) string
- func LoadMqttStat()
- func LoadOTelMetric()
- func PrintDateAndTime(i interface{}) string
- func PrintHintedMIBIntVal(val int32, hint string, us bool) string
- func PrintIPAddress(i interface{}) string
- func PrintMIBStringVal(i interface{}) string
- func ResetArpTable() error
- func RevokeCert(cert *CertEnt) error
- func RevokeCertByID(id string) error
- func SaveAIConf() error
- func SaveAIResult(res *AIResult) error
- func SaveBackImage() error
- func SaveCertMonitor(c *CertMonitorEnt) error
- func SaveDiscoverConf() error
- func SaveLocConf() error
- func SaveLogBuffer(logBuffer []*LogEnt)
- func SaveMapConf() error
- func SaveMapData()
- func SaveMqttStats()
- func SaveNodeMemo(nodeID, memo string) error
- func SaveNotifyConf() error
- func SaveNotifyOAuth2Token(token *oauth2.Token) error
- func SaveOTelMetric()
- func SavePKIConf() error
- func SaveSshdPublicKeys(pk string) error
- func SetDark(dark bool) error
- func SetNodeStateChanged(id string)
- func UpdateArpEnt(ip, mac string)
- func UpdateCert(cert *CertEnt) error
- func UpdateLine(l *LineEnt) error
- func UpdateMqttStat(clientID, remote, topic string, b int)
- func UpdateNetwork(n *NetworkEnt) error
- func UpdateOTelTrace(list []*OTelTraceEnt) error
- func UpdatePolling(p *PollingEnt, save bool) error
- type AIConfEnt
- type AIResult
- type ArpEnt
- type ArpLogEnt
- type BackImageEnt
- type CertEnt
- type CertMonitorEnt
- type CreateCAReq
- type DiscoverConfEnt
- type DrawItemEnt
- type DrawItemType
- type EventLogEnt
- type IconEnt
- type LineEnt
- type LocConfEnt
- type LogEnt
- type LogFilterEnt
- type MIBInfo
- type MIBModuleEnt
- type MIBTreeEnt
- type MIBTypeEnt
- type MapConfEnt
- type MqttStatEnt
- type NetFlowEnt
- type NetworkEnt
- type NodeEnt
- type NotifyConfEnt
- type OTelMetricDataPointEnt
- type OTelMetricEnt
- type OTelTraceEnt
- type OTelTraceSpanEnt
- type PKIConfEnt
- type PKIControlEnt
- type PollingEnt
- type PollingLogEnt
- type PollingTemplateEnt
- type PortEnt
- type SFlowCounterEnt
- type SFlowEnt
- type SyslogEnt
- type TrapEnt
Constants ¶
const ( DrawItemTypeRect = iota DrawItemTypeEllipse DrawItemTypeText DrawItemTypeImage DrawItemTypePollingText DrawItemTypePollingGauge DrawItemTypePollingNewGauge DrawItemTypePollingBar DrawItemTypePollingLine )
const ( LogModeNone = iota LogModeAlways LogModeOnChange LogModeAI )
Variables ¶
var ( // Conf Data on Memory MapConf MapConfEnt BackImage BackImageEnt NotifyConf NotifyConfEnt DiscoverConf DiscoverConfEnt AIConf AIConfEnt LocConf LocConfEnt AutoCharCode bool // Restart snmptrapd RestartSnmpTrapd bool // MIBDB *gomibdb.MIBDB Dark bool // for TwLogEye gRPC CACert string ClientCert string ClientKey string // from Command Line PingMode string SyslogPort int TrapPort int NetFlowPort int SFlowPort int TCPPort int SSHdPort int // OpenTelemetry OTelHTTPPort int OTelgRPCPort int OTelCert string OTelKey string OTelCA string // MCP Server MCPCert string MCPKey string // MQTT Server MqttTCPPort int MqttWSPort int MqttCert string MqttKey string MqttFrom string MqttUsers string )
var ( ErrNoPayload = fmt.Errorf("no payload") ErrInvalidNode = fmt.Errorf("invalid node") ErrInvalidParams = fmt.Errorf("invald params") ErrDBNotOpen = fmt.Errorf("db not open") ErrInvalidID = fmt.Errorf("invalid id") )
Define errors
var MIBInfoMap = make(map[string]*MIBInfo)
var MIBModules = []*MIBModuleEnt{}
var MIBTree = []*MIBTreeEnt{}
var MIBTypeMap = make(map[string]MIBTypeEnt)
var (
NotifyOAuth2RedirectPort int
)
var PollingTemplateList []*PollingTemplateEnt
Functions ¶
func AddDrawItem ¶
func AddDrawItem(di *DrawItemEnt) error
func AddEventLog ¶
func AddEventLog(e *EventLogEnt)
func AddNetwork ¶ added in v1.9.0
func AddNetwork(n *NetworkEnt) error
func AddOTelMetric ¶ added in v1.22.0
func AddOTelMetric(m *OTelMetricEnt)
func AddOrUpdateIcon ¶
func AddPollingLog ¶
func AddPollingLog(p *PollingEnt) error
func AddPollingWithDupCheck ¶ added in v1.15.0
func AddPollingWithDupCheck(p *PollingEnt) error
AddPollingWithDupCheck : 重複しないようにポーリングを追加する
func CheckCharCode ¶ added in v1.9.0
func ClearCAData ¶ added in v1.18.0
func ClearCAData()
func ClearPollingLogs ¶ added in v1.5.0
ClearPollingLogs : ポーリングログの削除をまとめて行う
func DeleteAIResult ¶
func DeleteAllLogs ¶
func DeleteAllMqttStat ¶ added in v1.28.0
func DeleteAllMqttStat() error
func DeleteAllOTelData ¶ added in v1.22.0
func DeleteAllOTelData() error
func DeleteArpEnt ¶ added in v0.9.1
DeleteArpEnt deletes ARP table entries associated with the specified IP addresses.
func DeleteCertMonitor ¶ added in v1.24.0
func DeleteCertMonitor(id string)
func DeleteDrawItem ¶
func DeleteIcon ¶
func DeleteLine ¶
func DeleteMqttStats ¶ added in v1.28.0
func DeleteMqttStats(ids []string)
func DeleteNetwork ¶ added in v1.9.0
func DeleteNode ¶
func DeleteNodeStateChanged ¶
func DeleteNodeStateChanged(id string)
func DeleteNotifyOAuth2Token ¶ added in v1.26.0
func DeleteNotifyOAuth2Token() error
func DeleteOTelMetric ¶ added in v1.22.0
func DeleteOTelMetric(m *OTelMetricEnt)
func DeleteOldMqttStats ¶ added in v1.35.0
func DeleteOldMqttStats(days int)
func DeletePollings ¶
func ForEachArp ¶
func ForEachCert ¶ added in v1.18.0
func ForEachCertMonitors ¶ added in v1.24.0
func ForEachCertMonitors(f func(*CertMonitorEnt) bool)
func ForEachEventLog ¶
func ForEachEventLog(st, et int64, f func(*EventLogEnt) bool) error
func ForEachItems ¶
func ForEachItems(f func(*DrawItemEnt) bool)
func ForEachLastArpLogs ¶
ForEachLastArpLogs は最新のARP Logを返します。
func ForEachLastEventLog ¶
func ForEachLastEventLog(f func(*EventLogEnt) bool) error
func ForEachLastPollingLog ¶
func ForEachLastPollingLog(pollingID string, f func(*PollingLogEnt) bool) error
func ForEachLastSyslog ¶
ForEachLastSyslog get syslogs
func ForEachLastTraps ¶
ForEachLastTraps get TRAP
func ForEachLogs ¶ added in v1.4.0
ForEachLogs returns logs that match the specified conditions.
func ForEachMqttStat ¶ added in v1.28.0
func ForEachMqttStat(f func(s *MqttStatEnt) bool)
func ForEachNetFlow ¶ added in v1.5.0
func ForEachNetFlow(st, et int64, f func(*NetFlowEnt) bool) error
ForEachNetFlow get NetFlow log
func ForEachNetworks ¶ added in v1.9.0
func ForEachNetworks(f func(*NetworkEnt) bool)
ForEachNetworks : Network毎の処理
func ForEachNodes ¶
func ForEachOTelMetric ¶ added in v1.22.0
func ForEachOTelMetric(f func(m *OTelMetricEnt) bool)
func ForEachOTelTrace ¶ added in v1.22.0
func ForEachOTelTrace(tbk string, f func(t *OTelTraceEnt) bool)
func ForEachSFlow ¶ added in v1.8.0
ForEachSFlow get sFlow log
func ForEachSFlowCounter ¶ added in v1.8.0
func ForEachSFlowCounter(st, et int64, f func(*SFlowCounterEnt) bool) error
ForEachSFlowCounter gets sFlow counter logs.
func ForEachSyslog ¶ added in v1.3.0
ForEachSyslog get syslogs
func ForEachTraps ¶ added in v1.3.0
ForEachTraps get TRAP
func GenSSHPrivateKey ¶ added in v1.4.0
func GenSSHPrivateKey() []byte
func GetDataStorePath ¶
func GetDataStorePath() string
GetDataStorePath returns the path to the data store.
func GetMIBValueString ¶ added in v1.9.0
func GetNodeMemo ¶ added in v1.19.0
GetNodeMemo retrieves a memo related to the specified node.
func GetNotifyOAuth2Token ¶ added in v1.26.0
func GetOTelTraceBucketList ¶ added in v1.22.0
func GetOTelTraceBucketList() []string
func GetPrivateKey ¶
func GetSSHPublicKey ¶ added in v1.4.0
func GetServiceName ¶
func GetSshdPublicKeys ¶ added in v1.4.0
func GetSshdPublicKeys() string
func HasValidNotifyOAuth2Token ¶ added in v1.26.0
func HasValidNotifyOAuth2Token(n NotifyConfEnt) bool
func InitCAConf ¶ added in v1.18.0
func InitCAConf(req CreateCAReq) error
func IsGlobalUnicast ¶
func IsPrivateIP ¶
func LoadMailTemplate ¶
func LoadMqttStat ¶ added in v1.28.0
func LoadMqttStat()
func LoadOTelMetric ¶ added in v1.23.0
func LoadOTelMetric()
LoadOTelMetric loads metrics from the DB.
func PrintDateAndTime ¶ added in v1.2.0
func PrintDateAndTime(i interface{}) string
PrintDateAndTime formats a value according to the SNMP DateAndTime display hint.
func PrintHintedMIBIntVal ¶ added in v1.1.0
func PrintIPAddress ¶ added in v1.2.0
func PrintIPAddress(i interface{}) string
func PrintMIBStringVal ¶ added in v1.2.0
func PrintMIBStringVal(i interface{}) string
func RevokeCert ¶ added in v1.18.0
func RevokeCertByID ¶ added in v1.18.0
func SaveAIConf ¶
func SaveAIConf() error
func SaveAIResult ¶
func SaveBackImage ¶
func SaveBackImage() error
func SaveCertMonitor ¶ added in v1.24.0
func SaveCertMonitor(c *CertMonitorEnt) error
func SaveDiscoverConf ¶
func SaveDiscoverConf() error
func SaveLocConf ¶ added in v1.1.0
func SaveLocConf() error
func SaveLogBuffer ¶
func SaveLogBuffer(logBuffer []*LogEnt)
func SaveMapConf ¶
func SaveMapConf() error
func SaveMqttStats ¶ added in v1.30.0
func SaveMqttStats()
func SaveNodeMemo ¶ added in v1.19.0
SaveNodeMemo saves a memo related to the specified node.
func SaveNotifyConf ¶
func SaveNotifyConf() error
func SaveNotifyOAuth2Token ¶ added in v1.26.0
func SaveOTelMetric ¶ added in v1.23.0
func SaveOTelMetric()
SaveOTelMetric saves metrics to the DB.
func SavePKIConf ¶ added in v1.18.0
func SavePKIConf() error
func SaveSshdPublicKeys ¶ added in v1.4.0
func UpdateArpEnt ¶
func UpdateArpEnt(ip, mac string)
func UpdateCert ¶ added in v1.18.0
func UpdateLine ¶
func UpdateMqttStat ¶ added in v1.28.0
func UpdateNetwork ¶ added in v1.9.0
func UpdateNetwork(n *NetworkEnt) error
func UpdateOTelTrace ¶ added in v1.22.0
func UpdateOTelTrace(list []*OTelTraceEnt) error
func UpdatePolling ¶
func UpdatePolling(p *PollingEnt, save bool) error
Types ¶
type AIResult ¶
type AIResult struct {
PollingID string `json:"PollingID"`
LastTime int64 `json:"LastTime"`
ScoreData [][]float64 `json:"ScoreData"`
}
func GetAIReesult ¶
type ArpEnt ¶
type BackImageEnt ¶
type CertEnt ¶ added in v1.18.0
type CertEnt struct {
ID string `json:"ID"`
Subject string `json:"Subject"`
NodeID string `json:"NodeID"`
Created int64 `json:"Created"`
Revoked int64 `json:"Revoked"`
Expire int64 `json:"Expire"`
Type string `json:"Type"`
Certificate string `json:"Certificate"`
Info map[string]string `json:"Info"`
}
type CertMonitorEnt ¶ added in v1.24.0
type CertMonitorEnt struct {
ID string `json:"ID"`
State string `json:"State"`
Target string `json:"Target"`
Port uint16 `json:"Port"`
Subject string `json:"Subject"`
Issuer string `json:"Issuer"`
SerialNumber string `json:"SerialNumber"`
Verify bool `json:"Verify"`
NotAfter int64 `json:"NotAfter"`
NotBefore int64 `json:"NotBefore"`
Error string `json:"Error"`
FirstTime int64 `json:"FirstTime"`
LastTime int64 `json:"LastTime"`
}
func GetCertMonitor ¶ added in v1.24.0
func GetCertMonitor(id string) *CertMonitorEnt
type CreateCAReq ¶ added in v1.18.0
type CreateCAReq struct {
RootCAKeyType string `json:"RootCAKeyType"`
Name string `json:"Name"`
SANs string `json:"SANs"`
AcmePort int `json:"AcmePort"`
HTTPBaseURL string `json:"HttpBaseURL"`
AcmeBaseURL string `json:"AcmeBaseURL"`
HTTPPort int `json:"HttpPort"`
RootCATerm int `json:"RootCATerm"`
CrlInterval int `json:"CrlInterval"`
CertTerm int `json:"CertTerm"`
}
CreateCAReq represents a request from the frontend.
type DiscoverConfEnt ¶
type DiscoverConfEnt struct {
StartIP string `json:"StartIP"`
EndIP string `json:"EndIP"`
Timeout int `json:"Timeout"`
Retry int `json:"Retry"`
X int `json:"X"`
Y int `json:"Y"`
AddPolling bool `json:"AddPolling"`
PortScan bool `json:"PortScan"`
ReCheck bool `json:"ReCheck"`
AddNetwork bool `json:"AddNetwork"`
}
type DrawItemEnt ¶
type DrawItemEnt struct {
ID string `json:"ID"`
Type DrawItemType `json:"Type"`
X int `json:"X"`
Y int `json:"Y"`
W int `json:"W"`
H int `json:"H"`
Color string `json:"Color"`
Path string `json:"Path"`
Text string `json:"Text"`
Size int `json:"Size"`
PollingID string `json:"PollingID"`
VarName string `json:"VarName"`
Format string `json:"Format"`
Value float64 `json:"Value"`
Scale float64 `json:"Scale"`
Cond int `json:"Cond"`
Values []float64 `json:"Values"`
}
func GetDrawItem ¶
func GetDrawItem(id string) *DrawItemEnt
type DrawItemType ¶
type DrawItemType int
type EventLogEnt ¶
type IconEnt ¶
type LineEnt ¶
type LineEnt struct {
ID string `json:"ID"`
NodeID1 string `json:"NodeID1"`
PollingID1 string `json:"PollingID1"`
State1 string `json:"State1"`
NodeID2 string `json:"NodeID2"`
PollingID2 string `json:"PollingID2"`
State2 string `json:"State2"`
PollingID string `json:"PollingID"`
Width int `json:"Width"`
State string `json:"State"`
Info string `json:"Info"`
Port string `json:"Port"`
}
type LocConfEnt ¶ added in v1.1.0
type LocConfEnt struct {
Style string `json:"Style"`
Center string `json:"Center"`
Zoom float64 `json:"Zoom"`
IconSize int `json:"IconSize"`
}
LocConfEnt : 地図設定
type LogFilterEnt ¶
type MIBInfo ¶
type MIBInfo struct {
OID string
Status string
Type string
Enum string
Defval string
Units string
Index string
Description string
EnumMap map[int]string
Hint string
}
func FindMIBInfo ¶
type MIBModuleEnt ¶
type MIBModuleEnt struct {
Type string `json:"Type"`
File string `json:"File"`
Name string `json:"Name"`
Error string `json:"Error"`
}
MIBModuleEnt represents an entry in the list of loaded MIB modules.
type MIBTreeEnt ¶
type MIBTreeEnt struct {
OID string `json:"oid"`
Name string `json:"name"`
MIBInfo *MIBInfo
Children []*MIBTreeEnt `json:"children"`
}
type MIBTypeEnt ¶ added in v1.1.0
type MapConfEnt ¶
type MapConfEnt struct {
MapName string `json:"MapName"`
PollInt int `json:"PollInt"`
Timeout int `json:"Timeout"`
Retry int `json:"Retry"`
LogDays int `json:"LogDays"`
SnmpMode string `json:"SnmpMode"`
Community string `json:"Community"`
SnmpUser string `json:"SnmpUser"`
SnmpPassword string `json:"SnmpPassword"`
EnableSyslogd bool `json:"EnableSyslogd"`
EnableTrapd bool `json:"EnableTrapd"`
EnableArpWatch bool `json:"EnableArpWatch"`
EnableNetflowd bool `json:"EnableNetflowd"`
EnableSshd bool `json:"EnableSshd"`
EnableSFlowd bool `json:"EnableSFlowd"`
EnableTcpd bool `json:"EnableTcpd"`
EnableOTel bool `json:"EnableOTel"`
EnableMqtt bool `json:"EnableMqtt"`
MqttToSyslog bool `json:"Mqtt2Syslog"`
MCPTransport string `json:"MCPTransport"`
MCPEndpoint string `json:"MCPEndpoint"`
MCPToken string `json:"MCPToken"`
MCPFrom string `json:"MCPFrom"`
IconSize int `json:"IconSize"`
MapSize int `json:"MapSize"`
ArpWatchRange string `json:"ArpWatchRange"`
ArpTimeout int `json:"ArpTimeout"`
OTelRetention int `json:"OTelRetention"`
OTelFrom string `json:"OTelFrom"`
LLMProvider string `json:"LLMProvider"`
LLMBaseURL string `json:"LLMBaseURL"`
LLMAPIKey string `json:"LLMAPIKey"`
LLMModel string `json:"LLMModel"`
}
MapConfEnt : マップ設定
type MqttStatEnt ¶ added in v1.28.0
type NetFlowEnt ¶ added in v1.5.0
type NetFlowEnt struct {
Time int64 `json:"Time"`
SrcAddr string `json:"SrcAddr"`
SrcPort int `json:"SrcPort"`
SrcLoc string `json:"SrcLoc"`
SrcMAC string `json:"SrcMAC"`
DstAddr string `json:"DstAddr"`
DstPort int `json:"DstPort"`
DstLoc string `json:"DstLoc"`
DstMAC string `json:"DstMAC"`
Bytes int `json:"Bytes"`
Packets int `json:"Packets"`
TCPFlags string `json:"TCPFlags"`
Protocol string `json:"Protocol"`
ToS int `json:"ToS"`
Start int64 `json:"Start"`
End int64 `json:"End"`
Dur float64 `json:"Dur"`
}
type NetworkEnt ¶ added in v1.9.0
type NetworkEnt struct {
ID string `json:"ID"`
Name string `json:"Name"`
Descr string `json:"Descr"`
IP string `json:"IP"`
SnmpMode string `json:"SnmpMode"`
Community string `json:"Community"`
User string `json:"User"`
Password string `json:"Password"`
SnmpPort int `json:"SnmpPort"`
URL string `json:"URL"`
ArpWatch bool `json:"ArpWatch"`
Unmanaged bool `json:"Unmanaged"`
HPorts int `json:"HPorts"`
X int `json:"X"`
Y int `json:"Y"`
W int `json:"W"`
H int `json:"H"`
SystemID string `json:"SystemID"`
Error string `json:"Error"`
LLDP bool `json:"LLDP"`
Ports []PortEnt `json:"Ports"`
}
func FindNetwork ¶ added in v1.9.0
func FindNetwork(id, ip string) *NetworkEnt
FindNetwork : システムIDと管理IPでNetwrorkを検索する
func FindNetworkByIP ¶ added in v1.15.0
func FindNetworkByIP(ip string) *NetworkEnt
FindNetworkByIP : 管理IPでNetwrorkを検索する
func GetNetwork ¶ added in v1.9.0
func GetNetwork(id string) *NetworkEnt
type NodeEnt ¶
type NodeEnt struct {
ID string `json:"ID"`
Name string `json:"Name"`
Descr string `json:"Descr"`
Icon string `json:"Icon"`
Image string `json:"Image"`
State string `json:"State"`
X int `json:"X"`
Y int `json:"Y"`
IP string `json:"IP"`
MAC string `json:"MAC"`
Vendor string `json:"Vendor"`
SnmpMode string `json:"SnmpMode"`
Community string `json:"Community"`
User string `json:"User"`
SSHUser string `json:"SSHUser"`
Password string `json:"Password"`
GNMIPort string `json:"GNMIPort"`
GNMIEncoding string `json:"GNMIEncoding"`
GNMIUser string `json:"GNMIUser"`
GNMIPassword string `json:"GNMIPassword"`
PublicKey string `json:"PublicKey"`
URL string `json:"URL"`
AddrMode string `json:"AddrMode"`
AutoAck bool `json:"AutoAck"`
Loc string `json:"Loc"`
SnmpPort int `json:"SnmpPort"`
}
func FindNodeFromIP ¶
func FindNodeFromMAC ¶
func FindNodeFromName ¶
type NotifyConfEnt ¶
type NotifyConfEnt struct {
Provider string `json:"Provider"`
MailServer string `json:"MailServer"`
InsecureSkipVerify bool `json:"InsecureSkipVerify"`
User string `json:"User"`
Password string `json:"Password"`
MailTo string `json:"MailTo"`
MailFrom string `json:"MailFrom"`
Subject string `json:"Subject"`
Interval int `json:"Interval"`
Level string `json:"Level"`
Report bool `json:"Report"`
LLMSummary bool `json:"LLMSummary"`
NotifyRepair bool `json:"NotifyRepair"`
ExecCmd string `json:"ExecCmd"`
BeepHigh string `json:"BeepHigh"`
BeepLow string `json:"BeepLow"`
WebHookNotify string `json:"WebHookNotify"`
WebHookReport string `json:"WebHookReport"`
ClientID string `json:"ClientID"`
ClientSecret string `json:"ClientSecret"`
MSTenant string `json:"MSTenant"`
}
type OTelMetricDataPointEnt ¶ added in v1.22.0
type OTelMetricDataPointEnt struct {
Start int64 `json:"Start"`
Time int64 `json:"Time"`
Attributes []string `json:"Attributes"`
// Histogram
Count uint64 `json:"Count"`
BucketCounts []uint64 `json:"BucketCounts"`
ExplicitBounds []float64 `json:"ExplicitBounds"`
Sum float64 `json:"Sum"`
Min float64 `json:"Min"`
Max float64 `json:"Max"`
// Gauge
Gauge float64 `json:"Gauge"`
// ExponentialHistogram
Positive []uint64 `json:"Positive"`
Negative []uint64 `json:"Negative"`
Scale int64 `json:"Scale"`
ZeroCount int64 `json:"ZeroCount"`
ZeroThreshold float64 `json:"ZeroThreshold"`
// Index
Index int `json:"Index"`
}
type OTelMetricEnt ¶ added in v1.22.0
type OTelMetricEnt struct {
Host string `json:"Host"`
Service string `json:"Service"`
Scope string `json:"Scope"`
Name string `json:"Name"`
Type string `json:"Type"`
Description string `json:"Description"`
Unit string `json:"Unit"`
DataPoints []*OTelMetricDataPointEnt `json:"DataPoints"`
Count int `json:"Count"`
First int64 `json:"First"`
Last int64 `json:"Last"`
}
func FindOTelMetric ¶ added in v1.22.0
func FindOTelMetric(host, service, scope, name string) *OTelMetricEnt
type OTelTraceEnt ¶ added in v1.22.0
type OTelTraceEnt struct {
Bucket string `json:"Bucket"`
TraceID string `json:"TraceID"`
Start int64 `json:"Start"`
End int64 `json:"End"`
Dur float64 `json:"Dur"`
Spans []OTelTraceSpanEnt `json:"Spans"`
Last int64 `json:"Last"`
}
func GetOTelTrace ¶ added in v1.22.0
func GetOTelTrace(bucket, tid string) *OTelTraceEnt
type OTelTraceSpanEnt ¶ added in v1.22.0
type OTelTraceSpanEnt struct {
SpanID string `json:"SpanID"`
ParentSpanID string `json:"ParentSpanID"`
Host string `json:"Host"`
Service string `json:"Service"`
Scope string `json:"Scope"`
Name string `json:"Name"`
Start int64 `json:"Start"`
End int64 `json:"End"`
Dur float64 `json:"Dur"`
Attributes []string `json:"Attributes"`
}
type PKIConfEnt ¶ added in v1.18.0
type PKIConfEnt struct {
Name string `json:"Name"`
SANs string `json:"AcmeSANs"`
RootCAKeyType string `json:"RootCAKeyType"`
RootCAKey string `json:"RootCAKey"`
RootCACert string `json:"RootCACert"`
RootCATerm int `json:"RootCATerm"`
CertTerm int `json:"CertTerm"`
Serial int64 `json:"Serial"`
AcmeServerKey string `json:"AcmeServerKey"`
AcmeServerCert string `json:"AcmeServerCert"`
AcmeBaseURL string `json:"AcmeBaseURL"`
AcmePort int `json:"AcmePort"`
HTTPBaseURL string `json:"HttpBaseURL"`
HTTPPort int `json:"HttpPort"`
ScepCAKey string `json:"ScepCAKey"`
ScepCACert string `json:"ScepCACert"`
CrlNumber int64 `json:"CrlNumber"`
CrlInterval int `json:"CrlInterval"`
EnableAcme bool `json:"EnableAcme"`
EnableHTTP bool `json:"EnableHttp"`
}
PKIConfEnt is the configuration data for a CA stored in the DB.
var PKIConf PKIConfEnt
type PKIControlEnt ¶ added in v1.18.0
type PollingEnt ¶
type PollingEnt struct {
ID string `json:"ID"`
Name string `json:"Name"`
NodeID string `json:"NodeID"`
Type string `json:"Type"`
Mode string `json:"Mode"`
Params string `json:"Params"`
Filter string `json:"Filter"`
Extractor string `json:"Extractor"`
Script string `json:"Script"`
Level string `json:"Level"`
PollInt int `json:"PollInt"`
Timeout int `json:"Timeout"`
Retry int `json:"Retry"`
LogMode int `json:"LogMode"`
NextTime int64 `json:"NextTime"`
LastTime int64 `json:"LastTime"`
Result map[string]interface{} `json:"Result"`
State string `json:"State"`
FailAction string `json:"FailAction"`
RepairAction string `json:"RepairAction"`
AIMode string `json:"AIMode"`
VectorCols string `json:"VectorCols"`
MqttURL string `json:"MqttURL"`
MqttTopic string `json:"MqttTopic"`
MqttCols string `json:"MqttCols"`
}
type PollingLogEnt ¶
type PollingLogEnt struct {
Time int64 `json:"Time"`
PollingID string `json:"PollingID"`
State string `json:"State"`
Result map[string]interface{} `json:"Result"`
}
func GetAllPollingLog ¶
func GetAllPollingLog(pollingID string) []*PollingLogEnt
GetAllPollingLog :全てのポーリングログを取得する
type PollingTemplateEnt ¶
type PollingTemplateEnt struct {
ID int `json:"ID"`
Name string `json:"Name"`
Level string `json:"Level"`
Type string `json:"Type"`
Mode string `json:"Mode"`
Params string `json:"Params"`
Filter string `json:"Filter"`
Extractor string `json:"Extractor"`
Script string `json:"Script"`
Descr string `json:"Descr"`
AutoParam string `json:"AutoParam"`
}
func GetPollingTemplate ¶
func GetPollingTemplate(id int) *PollingTemplateEnt
type SFlowCounterEnt ¶ added in v1.8.0
type SFlowEnt ¶ added in v1.8.0
type SFlowEnt struct {
Time int64 `json:"Time"`
SrcAddr string `json:"SrcAddr"`
SrcPort int `json:"SrcPort"`
SrcLoc string `json:"SrcLoc"`
SrcMAC string `json:"SrcMAC"`
DstAddr string `json:"DstAddr"`
DstPort int `json:"DstPort"`
DstLoc string `json:"DstLoc"`
DstMAC string `json:"DstMAC"`
Bytes int `json:"Bytes"`
TCPFlags string `json:"TCPFlags"`
Protocol string `json:"Protocol"`
Reason int `json:"Reason"`
}
type SyslogEnt ¶
type SyslogEnt struct {
Time int64 `json:"Time"`
Level string `json:"Level"`
Host string `json:"Host"`
Type string `json:"Type"`
Tag string `json:"Tag"`
Message string `json:"Message"`
Severity int `json:"Severity"`
Facility int `json:"Facility"`
}
SyslogEnt represents a syslog entry.