Documentation
¶
Overview ¶
Package datastore : データ保存
Package datastore : データ保存
Package datastore : データ保存
Index ¶
- Constants
- Variables
- func AddDevice(d *DeviceEnt)
- func AddEventLog(e *EventLogEnt)
- func AddFlow(f *FlowEnt)
- func AddLine(l *LineEnt) error
- func AddNode(n *NodeEnt) error
- func AddPolling(p *PollingEnt) error
- func AddPollingLog(p *PollingEnt) error
- func AddServer(s *ServerEnt)
- func AddUser(u *UserEnt)
- func CheckDBBackup()
- func ClearAllReport() error
- func ClearPollingLog(pollingID string) error
- func CloseDataStore()
- func DeleteAIResult(id string) error
- func DeleteAllLogs()
- func DeleteArp()
- func DeleteDevice(id string)
- func DeleteFlow(id string)
- func DeleteGeoIP()
- func DeleteGrokEnt(id string) error
- func DeleteLine(lineID string) error
- func DeleteNode(nodeID string) error
- func DeleteNodeStateChanged(id string)
- func DeletePolling(pollingID string) error
- func DeleteReport(report, id string) error
- func DeleteServer(id string)
- func DeleteUser(id string)
- func FindVendor(mac string) string
- func ForEachArp(f func(*ArpEnt) bool) error
- func ForEachDevices(f func(*DeviceEnt) bool)
- func ForEachEventLog(st, et int64, f func(*EventLogEnt) bool) error
- func ForEachFlows(f func(*FlowEnt) bool)
- func ForEachGrokEnt(f func(*GrokEnt) bool)
- func ForEachLastEventLog(skey string, f func(*EventLogEnt) bool) error
- func ForEachLines(f func(*LineEnt) bool)
- func ForEachLog(st, et int64, t string, f func(*LogEnt) bool) error
- func ForEachNodes(f func(*NodeEnt) bool)
- func ForEachPollingLog(st, et int64, pollingID string, f func(*PollingLogEnt) bool) error
- func ForEachPollingTemplate(f func(*PollingTemplateEnt) bool)
- func ForEachPollings(f func(*PollingEnt) bool)
- func ForEachServers(f func(*ServerEnt) bool)
- func ForEachStateChangedNodes(f func(string) bool)
- func ForEachUsers(f func(*UserEnt) bool)
- func GetBackImage() ([]byte, error)
- func GetCipherSuiteName(id string) (string, bool)
- func GetLoc(sip string) string
- func GetPrivateKey() string
- func GetServiceName(prot, port int) (string, bool)
- func Init(ctx context.Context, path string, fs http.FileSystem) error
- func InitInfluxdb() error
- func IsGlobalUnicast(ips string) bool
- func IsPrivateIP(ip net.IP) bool
- func LaodReportConf() error
- func LoadReport() error
- func ResetArpTable() error
- func SaveAIResult(res *AIResult) error
- func SaveBackImage(img []byte) error
- func SaveBackup() error
- func SaveDiscoverConf() error
- func SaveInfluxdbConf() error
- func SaveLogBuffer(logBuffer []*LogEnt)
- func SaveMapConf() error
- func SaveNotifyConf() error
- func SaveReport(last int64) error
- func SaveReportConf() error
- func SendAIScoreToInfluxdb(pe *PollingEnt, res *AIResult) error
- func SendPollingLogToInfluxdb(pe *PollingEnt) error
- func SetNodeStateChanged(id string)
- func UpdateArpEnt(ip, mac string) error
- func UpdateDBStats()
- func UpdateGeoIP(path string) error
- func UpdateGrokEnt(g *GrokEnt) error
- func UpdateLine(l *LineEnt) error
- func UpdateNode(n *NodeEnt) error
- func UpdatePolling(p *PollingEnt) error
- type AIResult
- type ArpEnt
- type DBBackupEnt
- type DBStatsEnt
- type DBStatsLogEnt
- type DeviceEnt
- type DiscoverConfEnt
- type EventLogEnt
- type FlowEnt
- type GrokEnt
- type InfluxdbConfEnt
- type LineEnt
- type LogEnt
- type LogFilterEnt
- type MIBTreeEnt
- type MapConfEnt
- type NodeEnt
- type NotifyConfEnt
- type PollingEnt
- type PollingLogEnt
- type PollingTemplateEnt
- type ReportConfEnt
- type ServerEnt
- type UserEnt
Constants ¶
View Source
const ( // MaxDispLog : ログの検索結果の最大値 MaxDispLog = 20000 // MaxDelLog : ログ削除処理の最大削除数 MaxDelLog = 500000 )
View Source
const ( LogModeNone = iota LogModeAlways LogModeOnChange LogModeAI )
Variables ¶
View Source
var ( // Conf Data on Memory MapConf MapConfEnt NotifyConf NotifyConfEnt InfluxdbConf InfluxdbConfEnt DiscoverConf DiscoverConfEnt Backup DBBackupEnt DBStats DBStatsEnt DBStatsLog []DBStatsLogEnt Yasumi string // MIBDB *gomibdb.MIBDB )
View Source
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
View Source
var MIBTree = []*MIBTreeEnt{}
Functions ¶
func AddEventLog ¶
func AddEventLog(e *EventLogEnt)
func AddPollingLog ¶
func AddPollingLog(p *PollingEnt) error
func CheckDBBackup ¶
func CheckDBBackup()
func ClearAllReport ¶
func ClearAllReport() error
func ClearPollingLog ¶
func DeleteAIResult ¶
func DeleteAllLogs ¶
func DeleteAllLogs()
func DeleteDevice ¶
func DeleteDevice(id string)
func DeleteFlow ¶
func DeleteFlow(id string)
func DeleteGrokEnt ¶
func DeleteLine ¶
func DeleteNode ¶
func DeleteNodeStateChanged ¶
func DeleteNodeStateChanged(id string)
func DeletePolling ¶
func DeleteReport ¶
func DeleteServer ¶
func DeleteServer(id string)
func DeleteUser ¶
func DeleteUser(id string)
func ForEachArp ¶
func ForEachDevices ¶
func ForEachEventLog ¶
func ForEachEventLog(st, et int64, f func(*EventLogEnt) bool) error
func ForEachFlows ¶
func ForEachGrokEnt ¶
func ForEachLastEventLog ¶
func ForEachLastEventLog(skey string, f func(*EventLogEnt) bool) error
func ForEachNodes ¶
func ForEachPollingLog ¶
func ForEachPollingLog(st, et int64, pollingID string, f func(*PollingLogEnt) bool) error
func ForEachPollingTemplate ¶
func ForEachPollingTemplate(f func(*PollingTemplateEnt) bool)
func ForEachServers ¶
func ForEachUsers ¶
func GetBackImage ¶
func GetCipherSuiteName ¶
func GetPrivateKey ¶
func GetPrivateKey() string
func GetServiceName ¶
func InitInfluxdb ¶
func InitInfluxdb() error
func IsGlobalUnicast ¶
func IsPrivateIP ¶
func LoadReport ¶
func LoadReport() error
func ResetArpTable ¶
func ResetArpTable() error
func SaveAIResult ¶
func SaveBackImage ¶
func SaveBackup ¶
func SaveBackup() error
func SaveDiscoverConf ¶
func SaveDiscoverConf() error
func SaveInfluxdbConf ¶
func SaveInfluxdbConf() error
func SaveLogBuffer ¶
func SaveLogBuffer(logBuffer []*LogEnt)
func SaveMapConf ¶
func SaveMapConf() error
func SaveNotifyConf ¶
func SaveNotifyConf() error
func SaveReport ¶
func SaveReportConf ¶
func SaveReportConf() error
func SendAIScoreToInfluxdb ¶
func SendAIScoreToInfluxdb(pe *PollingEnt, res *AIResult) error
func SendPollingLogToInfluxdb ¶
func SendPollingLogToInfluxdb(pe *PollingEnt) error
func UpdateArpEnt ¶
func UpdateDBStats ¶
func UpdateDBStats()
func UpdateLine ¶
func UpdateNode ¶
func UpdatePolling ¶
func UpdatePolling(p *PollingEnt) error
Types ¶
type AIResult ¶
func GetAIReesult ¶
type DBBackupEnt ¶
type DBStatsEnt ¶
type DBStatsLogEnt ¶
type DeviceEnt ¶
type DiscoverConfEnt ¶
type EventLogEnt ¶
type FlowEnt ¶
type FlowEnt struct { ID string // ID Client:Server Client string Server string Services map[string]int64 Count int64 Bytes int64 ClientName string ClientNodeID string ClientLoc string ServerName string ServerNodeID string ServerLoc string Score float64 ValidScore bool Penalty int64 FirstTime int64 LastTime int64 UpdateTime int64 }
type GrokEnt ¶
func GetGrokEnt ¶
type InfluxdbConfEnt ¶
type LineEnt ¶
type LogFilterEnt ¶
type MIBTreeEnt ¶
type MIBTreeEnt struct { OID string `json:"oid"` Name string `json:"name"` Children []*MIBTreeEnt `json:"children"` }
type MapConfEnt ¶
type MapConfEnt struct { MapName string BackImage backImage UserID string Password string PollInt int Timeout int Retry int LogDays int LogDispSize int SnmpMode string Community string SnmpUser string SnmpPassword string PublicKey string PrivateKey string // TLSCert string EnableSyslogd bool EnableTrapd bool EnableNetflowd bool EnableArpWatch bool AILevel string AIThreshold int GeoIPInfo string }
MapConfEnt : マップ設定
type NodeEnt ¶
type NodeEnt struct { ID string Name string Descr string Icon string State string X int Y int IP string MAC string SnmpMode string Community string User string Password string PublicKey string URL string Type string AddrMode string }
func FindNodeFromIP ¶
func FindNodeFromMAC ¶
type NotifyConfEnt ¶
type PollingEnt ¶
type PollingLogEnt ¶
type PollingLogEnt struct { Time int64 // UnixNano() PollingID string State string Result map[string]interface{} }
func GetAllPollingLog ¶
func GetAllPollingLog(pollingID string) []PollingLogEnt
GetAllPollingLog :全てのポーリングログを取得する
type PollingTemplateEnt ¶
type PollingTemplateEnt struct { ID string Name string Level string Type string Mode string Params string Filter string Extractor string Script string Descr string AutoMode string }
func GetPollingTemplate ¶
func GetPollingTemplate(id string) *PollingTemplateEnt
type ReportConfEnt ¶
type ReportConfEnt struct { DenyCountries []string DenyServices []string AllowDNS string AllowDHCP string AllowMail string AllowLDAP string AllowLocalIP string JapanOnly bool DropFlowThTCPPacket int RetentionTimeForSafe int }
var ReportConf ReportConfEnt
type ServerEnt ¶
Click to show internal directories.
Click to hide internal directories.