Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enumerate functionality - possible contribution #30

Open
smanross opened this issue Jun 11, 2022 · 2 comments
Open

enumerate functionality - possible contribution #30

smanross opened this issue Jun 11, 2022 · 2 comments

Comments

@smanross
Copy link

smanross commented Jun 11, 2022

Howdy,

I wanted to learn a bit more about the SOAP protocol, and possibly contribute to the project.

I've been working with Intel vPro PCs (AMT V12), not the NUCs.

I've been able to get an "enumerate request" working, and just wanted to know if it's worth putting in the pull request to the project or not.

Similar to runnung this winrm code on a windows command line:

winrm enumerate http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RedirectionService -remote:https://mypc:16993/wsman -u:admin -p:password -a:Digest -encoding:utf-8 -skipCNCheck -skipRevocationCheck -skipCACheck

I've been hacking a lot of the code in this project:

  • moving some stuff around
  • making it more customizable,
  • making it more usable to different AMT Classes (CIM_, IPS_ and AMT_* -- matching the different namespace to the appropriate classes),
  • using requests.session instead of requests.post all over the place,
  • and making the requests code allow you to ignore certificate warnings, etc in SSL Mode (if you need to)

Lastly, I wondered if we want to keep the code Python 2 compatible or not (hopefully not considering its not really supported anymore).

A lot of the changes I've made likely aren't Python 2 compatible, but I wonder if Python2 compatability should really be a thing anymore or not.... However, I don't even have a test system with Python 2 anymore.

P.S. Thanks for showing me the auth and get methods, as that got me started on the "Enumeration"s.

Here's an example of the code reduced to a simple python script:

import getpass
import amt.client
import amt.wsman

if 'mypass' not in locals().keys() or not mypass:
    # I rerun this a lot and likely have set my password in a previous running
    mypass = getpass.getpass()

client = amt.client.Client('somepc.somedomain.local', mypass, vncpasswd=mypass, protocol="https", verify_ssl=False, disable_ssl_warnings=True)

class_name = 'CIM_ComputerSystem'
rows = client.enumerate(class_name)

output:

[{'CreationClassName': 'CIM_ComputerSystem',
  'Dedicated': '32',
  'ElementName': 'Managed System',
  'EnabledDefault': '5',
  'EnabledState': '2',
  'HealthState': '5',
  'IdentifyingDescriptions': 'CIM:GUID',
  'Name': 'ManagedSystem',
  'NameFormat': 'Other',
  'OperationalStatus': '0',
  'OtherIdentifyingInfo': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'RequestedState': '12'},
 {'CreationClassName': 'CIM_ComputerSystem',
  'Dedicated': '14',
  'ElementName': 'Intel(r) AMT Subsystem',
  'EnabledDefault': '5',
  'EnabledState': '5',
  'HealthState': '5',
  'Name': 'Intel(r) AMT',
  'NameFormat': 'Other',
  'OperationalStatus': '0',
  'RequestedState': '12'}]

Please and Thank You,
Steven

@rgl
Copy link

rgl commented Jun 20, 2022

@smanross, just to let you known there's a more-up-to-date fork of this project at https://github.com/nomis/intel-amt (but at this point I'm afraid that both are more-or-less inactive).

@smanross
Copy link
Author

Thanks @rgl,

I'll likely post my changes to yet another project so I dont break either project with my updates, and people can see what I've changed.

I'll also check out what changes have been made in the new project in case there's stuff I want to incorporate there too.

Steven

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants