cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Reliable Contributor
Reliable Contributor
Report Inappropriate Content
Message 1 of 2

ESM API

I'm trying to pull a list of devices per receiver from the API (v2).

I'm using /dsGetDataSourceList, however that only gives me the top level list of devices.  I can do a dsGetDataSourceDetail and determine if it is a parent with chidren, but I don't have a way to pull the details on those children.  Has anyone found a way to get those?

I can use devGetDeviceList, but that pulls for the entire environment, and we have a fairly large setup so it's far from ideal.  I have used accounts with limited permissions to work around this, but it's clumsy and getting to be a bit of a maintenance issue, with accounts and groups to setup.

 

1 Reply
Highlighted

Re: ESM API

Hello,

 

Have you tried to use the API Python wrapper (https://github.com/mfesiem/msiempy) ? More specifically the DevTree object.

Once instanciated, you can iterate through all Datasources, parents, clients, sort by receiver etc.

Here is a code snippet :

import pandas
from msiempy.device import DevTree

devtree = DevTree()
print("All Datasources")
print(devtree.get_text(fields=['parent_name', 'name']))

df = pandas.DataFrame(devtree)
print("Datasources grouped by parent")
print(df.groupby("parent_name")['name'].apply(lambda x: ', '.join(x)).reset_index().to_string(index=False))

See datasource documentation here: https://mfesiem.github.io/docs/msiempy/device.html#msiempy.device.DataSource

The code generates the following output:

All Datasources
|     parent_name      |                                   name                                  |
|         n/a          |                                Local ESM                                |
|      Local ESM       |                           ePolicy Orchestrator                          |
| ePolicy Orchestrator | ePolicy Orchestrator_Endpoint Security Adaptive Threat Protection (ePO) |
| ePolicy Orchestrator |          ePolicy Orchestrator_Endpoint Security Firewall (ePO)          |
| ePolicy Orchestrator |          ePolicy Orchestrator_Endpoint Security Platform (ePO)          |
| ePolicy Orchestrator |      ePolicy Orchestrator_Endpoint Security Threat Prevention (ePO)     |
| ePolicy Orchestrator |         ePolicy Orchestrator_Endpoint Security Web Control (ePO)        |
| ePolicy Orchestrator |                 ePolicy Orchestrator_ePO Audit Log (ePO)                |
| ePolicy Orchestrator |          ePolicy Orchestrator_ePolicy Orchestrator Agent (ePO)          |
| ePolicy Orchestrator |                         ePolicy Orchestrator_TIE                        |
|      Local ESM       |                            Local Receiver-ELM                           |
|  Local Receiver-ELM  |                                  CS CEF                                 |
|  Local Receiver-ELM  |                             Test Datasource                             |
Datasources grouped by parent
          parent_name                                                                                                                                                                                                                                                                                                                                                                                                                                        name
            Local ESM                                                                                                                                                                                                                                                                                                                                                                                                    ePolicy Orchestrator, Local Receiver-ELM
   Local Receiver-ELM                                                                                                                                                                                                                                                                                                                                                                                                                     CS CEF, Test Datasource
 ePolicy Orchestrator  ePolicy Orchestrator_Endpoint Security Adaptive Threat Protection (ePO), ePolicy Orchestrator_Endpoint Security Firewall (ePO), ePolicy Orchestrator_Endpoint Security Platform (ePO), ePolicy Orchestrator_Endpoint Security Threat Prevention (ePO), ePolicy Orchestrator_Endpoint Security Web Control (ePO), ePolicy Orchestrator_ePO Audit Log (ePO), ePolicy Orchestrator_ePolicy Orchestrator Agent (ePO), ePolicy Orchestrator_TIE
                  n/a                                                                                                                                                                                                                                                                                                                                                                                                                                   Local ESM

 

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community