Documentation ¶
Index ¶
- Constants
- Variables
- func Hostname() (string, error)
- func IP() string
- func InitLocalIps()
- func InitRootDir()
- func InitRpcClients()
- func IsTrustable(remoteAddr string) bool
- func ParseConfig(cfg string)
- func ReportPorts() []int64
- func ReportProcs() map[string]map[int]string
- func SendToTransfer(metrics []*model.MetricValue)
- func SetReportPorts(ports []int64)
- func SetReportProcs(procs map[string]map[int]string)
- func SetTrustableIps(ipStr string)
- func TrustableIps() []string
- type GlobalConfig
- type HeartbeatConfig
- type HttpConfig
- type SingleConnRpcClient
- type SwitchConfig
- type TransferConfig
Constants ¶
View Source
const ( VERSION = "3.1.6" COLLECT_INTERVAL = time.Second )
changelog: 3.1.3: code refactor 3.1.4: bugfix ignore configuration 3.1.5: more sw support, DisplayByBit cfg 3.1.6
Variables ¶
View Source
var (
ConfigFile string
)
View Source
var LocalIps []string
View Source
var Root string
Functions ¶
func InitLocalIps ¶
func InitLocalIps()
func InitRootDir ¶
func InitRootDir()
func InitRpcClients ¶
func InitRpcClients()
func IsTrustable ¶
func ParseConfig ¶
func ParseConfig(cfg string)
func ReportPorts ¶
func ReportPorts() []int64
func ReportProcs ¶
func SendToTransfer ¶
func SendToTransfer(metrics []*model.MetricValue)
func SetReportPorts ¶
func SetReportPorts(ports []int64)
func SetReportProcs ¶
func SetTrustableIps ¶
func SetTrustableIps(ipStr string)
func TrustableIps ¶
func TrustableIps() []string
Types ¶
type GlobalConfig ¶
type GlobalConfig struct { Debug bool `json:"debug"` IP string `json:"ip"` Hostname string `json:"hostname"` Switch *SwitchConfig `json:"switch"` Heartbeat *HeartbeatConfig `json:"heartbeat"` Transfer *TransferConfig `json:"transfer"` Http *HttpConfig `json:"http"` }
func Config ¶
func Config() *GlobalConfig
type HeartbeatConfig ¶
type HttpConfig ¶
type SingleConnRpcClient ¶
type SingleConnRpcClient struct { sync.Mutex RpcServer string Timeout time.Duration // contains filtered or unexported fields }
var ( HbsClient *SingleConnRpcClient TransferClient *SingleConnRpcClient )
func (*SingleConnRpcClient) Call ¶
func (this *SingleConnRpcClient) Call(method string, args interface{}, reply interface{}) error
type SwitchConfig ¶
type SwitchConfig struct { Enabled bool `json:"enabled"` IpRange []string `json:"ipRange"` Interval int `json:"interval"` PingTimeout int `json:"pingTimeout"` PingRetry int `json:"pingRetry"` Community string `json:"community"` SnmpTimeout int `json:"snmpTimeout"` SnmpRetry int `json:"snmpRetry"` IgnoreIface []string `json:"ignoreIface"` IgnorePkt bool `json:"ignorePkt"` DisplayByBit bool `json:"displayByBit"` LimitConcur int `json:"limitConcur"` }
Click to show internal directories.
Click to hide internal directories.