Created
November 10, 2018 14:28
-
-
Save alibo/37c3bdaef78ba85b54df1d68c4b1f269 to your computer and use it in GitHub Desktop.
Getting Health information from FUCKING old ilo3 on g7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# issue: https://github.com/seveas/python-hpilo/issues/189 | |
# thanks to @Shados: https://github.com/seveas/python-hpilo/issues/189#issuecomment-430893230 | |
import re | |
import ssl | |
import json | |
import hpilo | |
ilo3_context = ssl.create_default_context() | |
# Start with the default cipher set | |
ciphers = ssl._DEFAULT_CIPHERS | |
# Remove any explit prohibition against 3DES | |
ciphers = re.sub(r":!3DES", "", ciphers) | |
# Add on DES-CBC3-SHA, as that apears to be the 'best' cipher suite supported | |
# by iLO3 v1.89 | |
ciphers = ciphers + ":DES-CBC3-SHA" | |
# Use the modified cipher suite list | |
ilo3_context.set_ciphers(ciphers) | |
# Allow SSLv3 | |
ilo3_context.options &= ~ssl.OP_NO_SSLv3 | |
# Disable any attempt at verifying the cert | |
ilo3_context.check_hostname = False | |
ilo3_context.verify_mode = ssl.CERT_NONE | |
iloc = hpilo.Ilo( | |
"host", "user", "pass", timeout=5, ssl_context=ilo3_context | |
) | |
health = iloc.get_embedded_health() | |
print json.dumps(health, sort_keys=True, | |
indent=4, separators=(',', ': ')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment