-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a2de12f
commit 8e7fff7
Showing
9 changed files
with
510 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2016-present Datadog, Inc. | ||
|
||
//nolint:revive // TODO(AML) Fix revive linter | ||
package command | ||
|
||
import ( | ||
//nolint:revive // TODO(AML) Fix revive linter | ||
_ "expvar" | ||
_ "net/http/pprof" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/DataDog/datadog-agent/cmd/checks-agent/subcommands/start" | ||
"github.com/DataDog/datadog-agent/cmd/checks-agent/subcommands/version" | ||
) | ||
|
||
func MakeRootCommand() *cobra.Command { | ||
// checksAgentCmd is the root command | ||
checksAgentCmd := &cobra.Command{ | ||
Use: "checks-agent [command]", | ||
Short: "Checks Agent at your service.", | ||
} | ||
|
||
for _, cmd := range makeCommands() { | ||
checksAgentCmd.AddCommand(cmd) | ||
} | ||
|
||
return checksAgentCmd | ||
} | ||
|
||
func makeCommands() []*cobra.Command { | ||
return []*cobra.Command{start.MakeCommand(), version.MakeCommand("Checks Agent")} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2016-present Datadog, Inc. | ||
|
||
//go:build !windows | ||
|
||
package main | ||
|
||
import ( | ||
_ "net/http/pprof" | ||
"os" | ||
|
||
"log" | ||
|
||
"github.com/DataDog/datadog-agent/cmd/checks-agent/command" | ||
"github.com/DataDog/datadog-agent/pkg/util/flavor" | ||
) | ||
|
||
func main() { | ||
flavor.SetFlavor(flavor.ChecksAgent) | ||
|
||
if err := command.MakeRootCommand().Execute(); err != nil { | ||
log.Println(err) | ||
os.Exit(-1) | ||
} | ||
} |
Oops, something went wrong.