openbmc / bmcweb

A do everything Redfish, KVM, GUI, and DBus webserver for OpenBMC
Apache License 2.0
166 stars 135 forks source link

SNMP - Unable to configure SNMP manager with FQDN/Hostname #228

Closed prkatti1 closed 1 year ago

prkatti1 commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

Unable to configure SNMP manager with FQDN/Hostname.

Both GUI interface and Redfish does not allow user to configure SNMP managers with fully qualified domain name or hostname of the system.

Steps: Run curl command to configure snmp manager on BMC. Give hostname instead of IP address in the destination part. It throws 500 internal error and does not configure snmp manager

curl -k -H "X-Auth-Token: $bmc_token" -D post.txt -X POST https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination": "snmp://snmp.prashanth.com:162", "SubscriptionType": "SNMPTrap", "Protocol": "SNMPv2c"}' { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The request failed due to an internal service error. The service is still operational.", "MessageArgs": [], "MessageId": "Base.1.8.1.InternalError", "MessageSeverity": "Critical", "Resolution": "Resubmit the request. If the problem persists, consider resetting the service." } ], "code": "Base.1.8.1.InternalError", "message": "The request failed due to an internal service error. The service is still operational." } }bash-4.2$ cat post.txt HTTP/1.1 500 Internal Server Error Strict-Transport-Security: max-age=31536000; includeSubdomains; preload X-Frame-Options: DENY Pragma: no-cache Cache-Control: no-Store,no-Cache X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Content-Security-Policy: default-src 'none'; img-src 'self' data:; font-src 'self'; style-src 'self'; script-src 'self'; connect-src 'self' wss:; form-action 'none'; frame-ancestors 'none'; plugin-types 'none'; base-uri 'none' Content-Type: application/json Date: Mon, 22 Nov 2021 08:01:48 GMT Content-Length: 598

edtanous commented 2 years ago

That does look like a bug. We should be returning something more helpful there; This is an error message only, for something we don't yet support on master (SNMP), so it's not high on my priority list to fix. Feel free to submit patches to resolve this and they will be reviewed.

lxwinspur commented 2 years ago

That does look like a bug. We should be returning something more helpful there; This is an error message only, for something we don't yet support on master (SNMP), so it's not high on my priority list to fix. Feel free to submit patches to resolve this and they will be reviewed.

Yeah, @ChicagoDuan has fixed this in a new patch submitted, not merged yet. And there are still some minor changes that have not been completed. https://gerrit.openbmc.org/c/openbmc/bmcweb/+/38599

gtmills commented 1 year ago

https://gerrit.openbmc.org/c/openbmc/bmcweb/+/38599 merged, so I assume we can close ?

edtanous commented 1 year ago

Yep. Closing.

prkatti1 commented 1 year ago

Agreed.