mirror of
https://github.com/Icinga/icingabeat.git
synced 2025-08-20 17:28:08 +02:00
30 lines
715 B
Go
30 lines
715 B
Go
package cmd
|
|
|
|
import (
|
|
"flag"
|
|
|
|
"github.com/spf13/pflag"
|
|
|
|
cmd "github.com/elastic/beats/libbeat/cmd"
|
|
"github.com/elastic/beats/metricbeat/beater"
|
|
"github.com/elastic/beats/metricbeat/cmd/test"
|
|
|
|
// import modules
|
|
_ "github.com/elastic/beats/metricbeat/include"
|
|
)
|
|
|
|
// Name of this beat
|
|
var Name = "metricbeat"
|
|
|
|
// RootCmd to handle beats cli
|
|
var RootCmd *cmd.BeatsRootCmd
|
|
|
|
func init() {
|
|
var runFlags = pflag.NewFlagSet(Name, pflag.ExitOnError)
|
|
runFlags.AddGoFlag(flag.CommandLine.Lookup("system.hostfs"))
|
|
|
|
RootCmd = cmd.GenRootCmdWithRunFlags(Name, "", beater.New, runFlags)
|
|
RootCmd.AddCommand(cmd.GenModulesCmd(Name, "", buildModulesManager))
|
|
RootCmd.TestCmd.AddCommand(test.GenTestModulesCmd(Name, ""))
|
|
}
|