Documentation ¶
Index ¶
- Constants
- Variables
- func DuPaths() []string
- func Hostname() (string, error)
- func IP() string
- func InitLocalIps()
- func InitPublicIps()
- func InitRootDir()
- func InitRpcClients()
- func IsTrustable(remoteAddr string) bool
- func ParseConfig(cfg string)
- func ReportPorts() []int64
- func ReportProcs() map[string]map[int]string
- func ReportUrls() map[string]string
- func SendMetrics(metrics []*model.MetricValue, resp *model.TransferResponse)
- func SendToTransfer(metrics []*model.MetricValue)
- func SetDuPaths(paths []string)
- func SetReportPorts(ports []int64)
- func SetReportProcs(procs map[string]map[int]string)
- func SetReportUrls(urls map[string]string)
- func SetTrustableIps(ipStr string)
- func TrustableIps() []string
- type CollectorConfig
- type GlobalConfig
- type HeartbeatConfig
- type HttpConfig
- type PluginConfig
- type SingleConnRpcClient
- type TransferConfig
Constants ¶
const ( VERSION = "6.1.0" COLLECT_INTERVAL = time.Second URL_CHECK_HEALTH = "url.check.health" NET_PORT_LISTEN = "net.port.listen" DU_BS = "du.bs" PROC_NUM = "proc.num" )
changelog: 3.1.3: code refactor 3.1.4: bugfix ignore configuration 5.0.0: 支持通过配置控制是否开启/run接口;收集udp流量数据;du某个目录的大小 5.1.0: 同步插件的时候不再使用checksum机制 5.1.3: Fix config syntax error when deploying 5.1.4: Only trustable ip could access the webpage 5.1.5: New policy and plugin mechanism 5.1.6: Update cfg.json in release package. Program file is same as 5.1.5. 5.1.7: Fix failure of plugin updating. 5.1.8: Fix failure of plugin updating. 5.1.9: Fix command syntax error when collecting port status. 5.1.10: Fix and modify builtin metrics. 5.2.0: Fix agent orphan processes problem and add /v1/tail API 6.0.0: Use new plugin/git repo updating mechanism. 6.1.0: Add timeout mechanism on 'git fetch', 'git clone', 'git ls-remote' command
Variables ¶
var ( TransferLock *sync.RWMutex = new(sync.RWMutex) TransferClients map[string]*SingleConnRpcClient = map[string]*SingleConnRpcClient{} )
var (
ConfigFile string
)
var LocalIps []string
var PublicIps []string
var Root string
Functions ¶
func InitLocalIps ¶
func InitLocalIps()
func InitPublicIps ¶
func InitPublicIps()
func InitRootDir ¶
func InitRootDir()
func InitRpcClients ¶
func InitRpcClients()
func IsTrustable ¶
func ParseConfig ¶
func ParseConfig(cfg string)
func ReportPorts ¶
func ReportPorts() []int64
func ReportProcs ¶
func ReportUrls ¶
func SendMetrics ¶
func SendMetrics(metrics []*model.MetricValue, resp *model.TransferResponse)
func SendToTransfer ¶
func SendToTransfer(metrics []*model.MetricValue)
func SetDuPaths ¶
func SetDuPaths(paths []string)
func SetReportPorts ¶
func SetReportPorts(ports []int64)
func SetReportProcs ¶
func SetReportUrls ¶
func SetTrustableIps ¶
func SetTrustableIps(ipStr string)
func TrustableIps ¶
func TrustableIps() []string
Types ¶
type CollectorConfig ¶
type GlobalConfig ¶
type GlobalConfig struct { Debug bool `json:"debug"` Hostname string `json:"hostname"` IP string `json:"ip"` Plugin *PluginConfig `json:"plugin"` Heartbeat *HeartbeatConfig `json:"heartbeat"` Transfer *TransferConfig `json:"transfer"` Http *HttpConfig `json:"http"` Collector *CollectorConfig `json:"collector"` IgnoreMetrics map[string]bool `json:"ignore"` }
func Config ¶
func Config() *GlobalConfig
type HeartbeatConfig ¶
type HttpConfig ¶
type PluginConfig ¶
type SingleConnRpcClient ¶
type SingleConnRpcClient struct { sync.Mutex RpcServer string Timeout time.Duration // contains filtered or unexported fields }
var (
HbsClient *SingleConnRpcClient
)
func (*SingleConnRpcClient) Call ¶
func (this *SingleConnRpcClient) Call(method string, args interface{}, reply interface{}) error