centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
310 stars 273 forks source link

storage::dell::me4::restapi::plugin MD5 encoding is no longer supported #3872

Closed dbongert closed 2 years ago

dbongert commented 2 years ago

We upgraded the firmware on our Dell ME4084 to version GT280R010-01 and Centreon is having issues logging in via the REST API.

From https://www.dell.com/support/home/en-us/drivers/driversdetails?driverid=97g7r&oscode=wst14&productcode=powervault-me4084

FMW-50101 MC Disabled the MD5 feature

I used this Python script from the initial Dell ME feature request: https://github.com/centreon/centreon-plugins/issues/1429#issuecomment-475189475

and changing

authstring = hashlib.md5("{}{}".format(args.username, args.password).encode("utf-8")).hexdigest()

to

authstring = hashlib.sha256("{}{}".format(args.username, args.password).encode("utf-8")).hexdigest()

Makes it work.

dbongert commented 2 years ago

centreon-diff.txt

Swapping use Digest::MD5 qw(md5_hex) to use Digest::SHA qw(sha256_hex), and the md5_hex to sha256_hex fixes the issue.

However, IIRC the old firmware doesn't support SHA256, and the new firmware doesn't support MD5, so I'm not sure how to make that distinction.

garnier-quentin commented 2 years ago

It's a problem if old firmware doesn't support sha256. What error do you have if you use md5 ?

TokenRing commented 2 years ago

We get

UNKNOWN: Login endpoint returns an error: 'Authentication Unsuccessful'

garnier-quentin commented 2 years ago

I can add the option: --digest-sha256 (otherwise it will break for all format). Seems ok for you ?

garnier-quentin commented 2 years ago

Option --digest-sha256 is added in last git version

Hbitvof commented 1 year ago

Recently we updated our Powervault to firmware version GT280R011-01 and have the same issue. I added the option --digest-sha256 to the command, but this is not solving the problem. Is there a way to debug this further to see what the issue is this time?