diff --git a/cmd/agent/subcommands/snmp/command.go b/cmd/agent/subcommands/snmp/command.go index 8d50363e58014..ef112132959fe 100644 --- a/cmd/agent/subcommands/snmp/command.go +++ b/cmd/agent/subcommands/snmp/command.go @@ -425,7 +425,7 @@ func scanDevice(connParams *snmpConnectionParams, args argsType, snmpScanner snm err = snmpScanner.RunDeviceScan(snmp, namespace) if err != nil { - fmt.Fprintf(os.Stderr, "Unable to perform device scan: %v\n", err) + return fmt.Errorf("Unable to perform device scan: %v\n", err) } return nil }