forked from DataDog/datadog-agent
/
main.go
40 lines (30 loc) · 1.29 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//go:build !windows
// +build !windows
package main
import (
"os"
"github.com/spf13/cobra"
"github.com/StackVista/stackstate-agent/cmd/process-agent/flags"
)
func rootCmdRun(cmd *cobra.Command, args []string) {
exit := make(chan struct{})
// Invoke the Agent
runAgent(exit)
}
func main() {
ignore := ""
rootCmd.PersistentFlags().StringVar(&opts.configPath, "config", flags.DefaultConfPath, "Path to datadog.yaml config")
rootCmd.PersistentFlags().StringVar(&ignore, "ddconfig", "", "[deprecated] Path to dd-agent config")
if flags.DefaultSysProbeConfPath != "" {
rootCmd.PersistentFlags().StringVar(&opts.sysProbeConfigPath, "sysprobe-config", flags.DefaultSysProbeConfPath, "Path to system-probe.yaml config")
}
rootCmd.PersistentFlags().StringVarP(&opts.pidfilePath, "pid", "p", "", "Path to set pidfile for process")
rootCmd.PersistentFlags().BoolVarP(&opts.info, "info", "i", false, "Show info about running process agent and exit")
rootCmd.PersistentFlags().BoolVarP(&opts.version, "version", "v", false, "Print the version and exit")
rootCmd.PersistentFlags().StringVar(&opts.check, "check", "",
"Run a specific check and print the results. Choose from: process, connections, realtime, process_discovery")
fixDeprecatedFlags()
if err := rootCmd.Execute(); err != nil {
os.Exit(-1)
}
}