1 Star 0 Fork 0

zhangjungang/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
system.go 770 Bytes
一键复制 编辑 原始数据 按行查看 历史
Andrew Kroh 提交于 2017-06-23 13:29 . Simplify the system.Round arguments
package system
import (
"flag"
"sync"
"github.com/elastic/beats/metricbeat/mb"
)
var (
HostFS = flag.String("system.hostfs", "", "mountpoint of the host's filesystem for use in monitoring a host from within a container")
)
var once sync.Once
func init() {
// Register the ModuleFactory function for the "system" module.
if err := mb.Registry.AddModule("system", NewModule); err != nil {
panic(err)
}
}
type Module struct {
mb.BaseModule
HostFS string // Mountpoint of the host's filesystem for use in monitoring inside a container.
}
func NewModule(base mb.BaseModule) (mb.Module, error) {
// This only needs to be configured once for all system modules.
once.Do(func() {
initModule()
})
return &Module{BaseModule: base, HostFS: *HostFS}, nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangjungang/beats.git
git@gitee.com:zhangjungang/beats.git
zhangjungang
beats
beats
v6.0.0-beta2

搜索帮助