Documentation ¶
Index ¶
- Constants
- func Migrate(host string, port int, user string, password string, dbname string, ...) error
- type Agent
- type BasicRuleConfig
- type Cluster
- type Config
- type Container
- type DatabaseConfig
- type Event
- type Incident
- type IncidentBasicRule
- type IncidentItem
- type K8sCluster
- type K8sConnector
- type K8sContainer
- type K8sDaemonSet
- type K8sDeployment
- type K8sEvent
- type K8sLabel
- type K8sMetric
- type K8sNamespace
- type K8sNode
- type K8sObject
- type K8sObjectTag
- type K8sPod
- type K8sReplicaSet
- type K8sStatefulSet
- type Metric
- type MetricEndpoint
- type MetricLabel
- type MetricName
- type MetricType
- type NexServer
- func (s *NexServer) AddIncident(eventName string, item *IncidentItem) bool
- func (s *NexServer) ApiAgentList(c *gin.Context)
- func (s *NexServer) ApiAgentListAll(c *gin.Context)
- func (s *NexServer) ApiClusterList(c *gin.Context)
- func (s *NexServer) ApiHealth(c *gin.Context)
- func (s *NexServer) ApiIncidentBasic(c *gin.Context)
- func (s *NexServer) ApiMetricNameList(c *gin.Context)
- func (s *NexServer) ApiMetricsClusterSummary(c *gin.Context)
- func (s *NexServer) ApiMetricsContainers(c *gin.Context)
- func (s *NexServer) ApiMetricsNodes(c *gin.Context)
- func (s *NexServer) ApiMetricsPods(c *gin.Context)
- func (s *NexServer) ApiMetricsProcesses(c *gin.Context)
- func (s *NexServer) ApiNodeList(c *gin.Context)
- func (s *NexServer) ApiNodeListAll(c *gin.Context)
- func (s *NexServer) ApiResponseJson(c *gin.Context, code int, status, message string)
- func (s *NexServer) ApiSnapshotContainers(c *gin.Context)
- func (s *NexServer) ApiSnapshotNodes(c *gin.Context)
- func (s *NexServer) ApiSnapshotPods(c *gin.Context)
- func (s *NexServer) ApiSnapshotProcesses(c *gin.Context)
- func (s *NexServer) ApiStatus(c *gin.Context)
- func (s *NexServer) ApiSummaryClusters(c *gin.Context)
- func (s *NexServer) ApiSummaryNodes(c *gin.Context)
- func (s *NexServer) CheckNodeBasicIncident(nodeMetricChan chan Metric)
- func (s *NexServer) CheckRequiredParams(c *gin.Context, params []string) (map[string]string, bool)
- func (s *NexServer) ClearAgentConnected(clusterId, nodeId uint, hostName string)
- func (s *NexServer) ClearIncident(eventName string, item *IncidentItem) bool
- func (s *NexServer) ConnectDatabase() (*gorm.DB, error)
- func (s *NexServer) FireAgentDisconnected(clusterId, nodeId uint, hostName string)
- func (s *NexServer) InitBasicRuleChecker()
- func (s *NexServer) IsExistIncident(eventName string, item *IncidentItem) bool
- func (s *NexServer) IsSameIncident(left, right *IncidentItem) bool
- func (s *NexServer) IsValidParams(clusterId string, query *Query, existDateRange bool, existMetricNames bool) bool
- func (s *NexServer) LoadConfig(configPath string) error
- func (s *NexServer) Param(c *gin.Context, key string) string
- func (s *NexServer) ParseQuery(c *gin.Context) *Query
- func (s *NexServer) Ping(stream pb.Collector_PingServer) error
- func (s *NexServer) QueryRowsWithTime(q *gorm.DB) (*sql.Rows, error, time.Duration)
- func (s *NexServer) RemoveSpecialChar(key string) string
- func (s *NexServer) ReportContainerMetrics(ctx context.Context, in *pb.ContainerMetrics) (*pb.Response, error)
- func (s *NexServer) ReportK8SMetrics(ctx context.Context, in *pb.K8SMetrics) (*pb.Response, error)
- func (s *NexServer) ReportMetrics(ctx context.Context, in *pb.Metrics) (*pb.Response, error)
- func (s *NexServer) ReportNodeMetrics(ctx context.Context, in *pb.NodeMetrics) (*pb.Response, error)
- func (s *NexServer) ReportProcessMetrics(ctx context.Context, in *pb.ProcessMetrics) (*pb.Response, error)
- func (s *NexServer) SetBasicRule(nodeCpuLoad1, nodeDiskFree, nodeMemoryFree float64)
- func (s *NexServer) SetDatabaseConfig(dbHost string, dbPort int, dbUser, dbPass, dbName, dbSslMode string)
- func (s *NexServer) SetServerConfig(bindAddress string, agentPort, apiPort int)
- func (s *NexServer) SetupApiHandler()
- func (s *NexServer) Start() error
- func (s *NexServer) UpdateAgent(ctx context.Context, in *pb.Agent) (*pb.Response, error)
- func (s *NexServer) UpdateContainer(ctx context.Context, in *pb.ContainerAll) (*pb.Response, error)
- func (s *NexServer) UpdateK8SCluster(ctx context.Context, in *pb.K8SCluster) (*pb.Response, error)
- func (s *NexServer) UpdateNode(ctx context.Context, in *pb.Node) (*pb.Response, error)
- func (s *NexServer) UpdateProcess(ctx context.Context, in *pb.ProcessAll) (*pb.Response, error)
- type Node
- type Process
- type Query
- type ServerConfig
- type Setting
- type TLSConfig
Constants ¶
View Source
const ( AppName = "NexServer" AppDescription = "NexServer for NexClipper Monitoring System" NexServerVersion = "0.3.0" ConfigFilename = "nexserver.yaml" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent struct { gorm.Model Online bool Version string `gorm:"size:32"` Ipv4 string `gorm:"size:16"` Ipv6 string `gorm:"size:40"` PublicIpv4 string `gorm:"size:16"` PublicIpv6 string `gorm:"size:40"` LastContact time.Time Disabled bool Uuid string `gorm:"size:36;unique_index"` MachineID string `gorm:"size:70;unique_index"` Description string ClusterID uint `gorm:"index"` Node Node }
type BasicRuleConfig ¶
type Config ¶
type Config struct { Server ServerConfig Database DatabaseConfig TLS TLSConfig BasicRule BasicRuleConfig }
type DatabaseConfig ¶
type IncidentBasicRule ¶
type IncidentItem ¶
type K8sCluster ¶
type K8sConnector ¶
type K8sContainer ¶
type K8sDaemonSet ¶
type K8sDeployment ¶
type K8sNamespace ¶
type K8sReplicaSet ¶
type K8sStatefulSet ¶
type MetricEndpoint ¶
type MetricLabel ¶
type MetricName ¶
type MetricType ¶
type MetricType struct { gorm.Model Name string `gorm:"size:32;unique_index"` MetricNames []MetricName }
type NexServer ¶
func NewNexServer ¶
func NewNexServer() *NexServer
func (*NexServer) AddIncident ¶
func (s *NexServer) AddIncident(eventName string, item *IncidentItem) bool
func (*NexServer) ApiAgentList ¶
func (*NexServer) ApiAgentListAll ¶
func (*NexServer) ApiClusterList ¶
func (*NexServer) ApiIncidentBasic ¶
func (*NexServer) ApiMetricNameList ¶
func (*NexServer) ApiMetricsClusterSummary ¶
func (*NexServer) ApiMetricsContainers ¶
func (*NexServer) ApiMetricsNodes ¶
func (*NexServer) ApiMetricsPods ¶
func (*NexServer) ApiMetricsProcesses ¶
func (*NexServer) ApiNodeList ¶
func (*NexServer) ApiNodeListAll ¶
func (*NexServer) ApiResponseJson ¶
func (*NexServer) ApiSnapshotContainers ¶
func (*NexServer) ApiSnapshotNodes ¶
func (*NexServer) ApiSnapshotPods ¶
func (*NexServer) ApiSnapshotProcesses ¶
func (*NexServer) ApiSummaryClusters ¶
func (*NexServer) ApiSummaryNodes ¶
func (*NexServer) CheckNodeBasicIncident ¶
func (*NexServer) CheckRequiredParams ¶
func (*NexServer) ClearAgentConnected ¶
func (*NexServer) ClearIncident ¶
func (s *NexServer) ClearIncident(eventName string, item *IncidentItem) bool
func (*NexServer) FireAgentDisconnected ¶
func (*NexServer) InitBasicRuleChecker ¶
func (s *NexServer) InitBasicRuleChecker()
func (*NexServer) IsExistIncident ¶
func (s *NexServer) IsExistIncident(eventName string, item *IncidentItem) bool
func (*NexServer) IsSameIncident ¶
func (s *NexServer) IsSameIncident(left, right *IncidentItem) bool
func (*NexServer) IsValidParams ¶
func (*NexServer) LoadConfig ¶
func (*NexServer) QueryRowsWithTime ¶
func (*NexServer) RemoveSpecialChar ¶
func (*NexServer) ReportContainerMetrics ¶
func (*NexServer) ReportK8SMetrics ¶
func (*NexServer) ReportMetrics ¶
func (*NexServer) ReportNodeMetrics ¶
func (*NexServer) ReportProcessMetrics ¶
func (*NexServer) SetBasicRule ¶
func (*NexServer) SetDatabaseConfig ¶
func (*NexServer) SetServerConfig ¶
func (*NexServer) SetupApiHandler ¶
func (s *NexServer) SetupApiHandler()
func (*NexServer) UpdateAgent ¶
func (*NexServer) UpdateContainer ¶
func (*NexServer) UpdateK8SCluster ¶
func (*NexServer) UpdateNode ¶
func (*NexServer) UpdateProcess ¶
type Node ¶
type Node struct { gorm.Model Host string `gorm:"size:128"` Ipv4 string `gorm:"size:16"` Ipv6 string `gorm:"size:40"` PublicIpv4 string `gorm:"size:16"` PublicIpv6 string `gorm:"size:40"` Os string `gorm:"size:64"` Platform string `gorm:"size:64"` PlatformFamily string `gorm:"size:64"` PlatformVersion string `gorm:"size:64"` Info postgres.Jsonb Uuid string `gorm:"size:36;unique_index"` Description string Disabled bool AgentID uint `gorm:"index"` ClusterID uint `gorm:"index"` Containers []Container Processes []Process }
type ServerConfig ¶
Click to show internal directories.
Click to hide internal directories.