Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: release.NAME, Short: "Circonus Host Agent", Long: `The Circonus host agent daemon provides a simple mechanism to expose systems and application metrics to Circonus. It inventories all executable programs in its plugin directory and executes them upon external request, returning results in JSON format.`, PersistentPreRunE: initLogging, Run: func(cmd *cobra.Command, args []string) { if viper.GetBool(config.KeyShowVersion) { fmt.Printf("%s v%s - commit: %s, date: %s, tag: %s\n", release.NAME, release.VERSION, release.COMMIT, release.DATE, release.TAG) return } if viper.GetString(config.KeyShowConfig) != "" { if err := config.ShowConfig(os.Stdout); err != nil { log.Fatal().Err(err).Msg("show-config") } return } log.Info(). Int("pid", os.Getpid()). Str("name", release.NAME). Str("ver", release.VERSION).Msg("Starting") a, err := agent.New() if err != nil { log.Fatal().Err(err).Msg("initializing") } config.StatConfig() if err := a.Start(); err != nil { log.Fatal().Err(err).Msg("starting agent") } }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.