Documentation ¶
Index ¶
- Constants
- Variables
- func CheckOSVersion() (version string)
- func CheckSwapMonitor()
- func CheckUrlTcpHealth(hostUrl string) bool
- func CheckVirtualMachine()
- func ChownPluginDir(dirString string) bool
- func CreateVersionFile(dir string, file string) bool
- func DuPaths() []string
- func ForceResetVersion(versionFile string) string
- func GenCronTime()
- func GetCurrPluginVersion() string
- func GetLocalIP() string
- func GetPidfilePath() string
- func GetPluginVersion() string
- func GetVersionFileInfo() string
- func Hostname() (string, error)
- func IP() string
- func InitLocalIp()
- func InitLog()
- func InitPoolAndVMTags()
- func InitRootDir()
- func InitRpcClients()
- func IsDir(path string) bool
- func IsExist(path string) bool
- func IsFile(path string) bool
- func IsNotConfigured(err error) bool
- func IsTrustable(remoteAddr string) bool
- func ParseConfig(cfg string)
- func ReadPid() (int, error)
- func ReportMetricCounts() int64
- 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 SetMetricCount(metricCount int64)
- func SetPidfilePath(p string)
- func SetReportPorts(ports []int64)
- func SetReportProcs(procs map[string]map[int]string)
- func SetReportUrls(urls map[string]string)
- func SetTrustableIps(ipStr string)
- func ShellOut(command string)
- func TrustableIps() []string
- func UpdatePluginVersion(versionString string) bool
- func WritePid() error
- type CollectorConfig
- type GlobalConfig
- type HeartbeatConfig
- type HttpConfig
- type PluginConfig
- type RsyncResponse
- type SingleConnRpcClient
- type TimeStruct
- type TransferConfig
- type VMconfig
Constants ¶
View Source
const ( VERSION = "5.3.1_20221130" COLLECT_INTERVAL = time.Second URL_CHECK_HEALTH = "url.check.health" NET_PORT_LISTEN = "net.port.listen" DU_BS = "du.bs" PROC_NUM = "proc.num" )
Variables ¶
View Source
var ( VersionDir string VersionFile string )
View Source
var ( TransferClientsLock *sync.RWMutex = new(sync.RWMutex) TransferClients map[string]*SingleConnRpcClient = map[string]*SingleConnRpcClient{} )
View Source
var ( POOLNAME = "None" VirtualMachine = false SkipSwapMonitor = false // default monitor swap usage -> skip = false )
View Source
var (
ConfigFile string
)
View Source
var LocalIp string
View Source
var Root string
Functions ¶
func CheckOSVersion ¶
func CheckOSVersion() (version string)
func CheckSwapMonitor ¶
func CheckSwapMonitor()
func CheckUrlTcpHealth ¶
func CheckVirtualMachine ¶
func CheckVirtualMachine()
func ChownPluginDir ¶
func CreateVersionFile ¶
func ForceResetVersion ¶
func GenCronTime ¶
func GenCronTime()
func GetCurrPluginVersion ¶
func GetCurrPluginVersion() string
func GetLocalIP ¶
func GetLocalIP() string
GetLocalIP returns the private & non loopback local IP of the host
func GetPidfilePath ¶
func GetPidfilePath() string
GetPidfilePath returns the configured pidfile path.
func GetPluginVersion ¶
func GetPluginVersion() string
func GetVersionFileInfo ¶
func GetVersionFileInfo() string
func InitLocalIp ¶
func InitLocalIp()
func InitPoolAndVMTags ¶
func InitPoolAndVMTags()
func InitRootDir ¶
func InitRootDir()
func InitRpcClients ¶
func InitRpcClients()
func IsNotConfigured ¶
IsNotConfigured returns true if the error indicates the pidfile location has not been configured.
func IsTrustable ¶
func ParseConfig ¶
func ParseConfig(cfg string)
func ReadPid ¶
Read the pid from the configured file. It is an error if the pidfile hasn't been configured.
func ReportMetricCounts ¶
func ReportMetricCounts() int64
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 SetMetricCount ¶
func SetMetricCount(metricCount int64)
func SetReportPorts ¶
func SetReportPorts(ports []int64)
func SetReportProcs ¶
func SetReportUrls ¶
func SetTrustableIps ¶
func SetTrustableIps(ipStr string)
func TrustableIps ¶
func TrustableIps() []string
func UpdatePluginVersion ¶
Types ¶
type CollectorConfig ¶
type GlobalConfig ¶
type GlobalConfig struct { Debug bool `json:"debug"` IllegalChar []string `json:"illegalchar"` LogFile string `json:"logfile"` RsyncUser string `json:"rsyncuser"` RsyncPwd string `json:"rsyncpwd"` Hostname string `json:"hostname"` IP string `json:"ip"` Plugin *PluginConfig `json:"plugin"` Heartbeat *HeartbeatConfig `json:"heartbeat"` Transfer *TransferConfig `json:"transfer"` RsyncAccess string `json:"rsyncaccess"` Http *HttpConfig `json:"http"` Collector *CollectorConfig `json:"collector"` DefaultTags map[string]string `json:"default_tags"` IgnoreMetrics map[string]bool `json:"ignore"` Pidfile string `json:"pidfile"` CmdbFile string `json:"cmdbfile"` VMConfig string `json:"vmconfig"` }
func Config ¶
func Config() *GlobalConfig
type HeartbeatConfig ¶
type HttpConfig ¶
type PluginConfig ¶
type RsyncResponse ¶
type RsyncResponse struct { Server []string `json:"server"` Source string `json:"source"` Sync bool `json:"sync"` SyncSrc string `json:"syncsrc"` SyncPort string `json:"port"` SyncDest string `json:"syncdest"` SyncDelete bool `json:"syncdelete"` Version string `json:"version"` RpmUpdate bool `json:"rpmupdate"` RpmVersion struct { El5 string `json:"el5"` El6 string `json:"el6"` El7 string `json:"el7"` El8 string `json:"el8"` } `json:"rpmversion"` }
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
type TransferConfig ¶
Click to show internal directories.
Click to hide internal directories.