From 206e0389e10269cfd62dde0b9cb9183755e70093 Mon Sep 17 00:00:00 2001 From: NouhaManai Date: Thu, 10 Oct 2024 21:54:06 +0200 Subject: [PATCH] Enable device scan command (#29553) --- cmd/agent/subcommands/snmp/command.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/agent/subcommands/snmp/command.go b/cmd/agent/subcommands/snmp/command.go index 4aa75df6821fb..1b5dbf6beedec 100644 --- a/cmd/agent/subcommands/snmp/command.go +++ b/cmd/agent/subcommands/snmp/command.go @@ -11,14 +11,13 @@ import ( "encoding/json" "errors" "fmt" + "github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl" "net" "os" "strconv" "strings" "time" - "github.com/DataDog/datadog-agent/comp/serializer/compression/compressionimpl" - "github.com/gosnmp/gosnmp" "github.com/spf13/cobra" "go.uber.org/fx" @@ -177,8 +176,9 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { snmpCmd.AddCommand(snmpWalkCmd) snmpScanCmd := &cobra.Command{ - Use: "scan [:port]", - Short: "Scan a device for the profile editor.", + Hidden: true, + Use: "scan [:port]", + Short: "Scan a device for the profile editor.", Long: `Walk the SNMP tree for a device, collecting available OIDs. Flags that aren't specified will be pulled from the agent SNMP config if possible.`, RunE: func(cmd *cobra.Command, args []string) error { @@ -229,7 +229,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { snmpScanCmd.Flags().BoolVar(&connParams.UseUnconnectedUDPSocket, "use-unconnected-udp-socket", defaultUseUnconnectedUDPSocket, "If specified, changes net connection to be unconnected UDP socket") // This command does nothing until the backend supports it, so it isn't enabled yet. - // snmpCmd.AddCommand(snmpScanCmd) + snmpCmd.AddCommand(snmpScanCmd) return []*cobra.Command{snmpCmd} }