Skip to content

Commit

Permalink
Enable device scan command (#29553)
Browse files Browse the repository at this point in the history
  • Loading branch information
NouhaManai96 authored Oct 10, 2024
1 parent 967da85 commit 206e038
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/agent/subcommands/snmp/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -177,8 +176,9 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
snmpCmd.AddCommand(snmpWalkCmd)

snmpScanCmd := &cobra.Command{
Use: "scan <ipaddress>[:port]",
Short: "Scan a device for the profile editor.",
Hidden: true,
Use: "scan <ipaddress>[: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 {
Expand Down Expand Up @@ -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}
}
Expand Down

0 comments on commit 206e038

Please sign in to comment.