cancel
Showing results for 
Search instead for 
Did you mean: 

API to add system to system tree in ePO

Hi,

I am trying to get the script to add machines into the system tree in epo. I have done one to delete machines from system tree and another to check if a machine exist in ePO and return all the properties from the machine from ePO

I have found the following in the epo api scripting guide but it doesnt work

#Example 4

import mcafee, sys,inspect

mc=mcafee.client('localhost','8443','admin','password')

file = open('C:/myfile.txt', 'r')

for line in file:

#determine the ID of the group to add it to

groups = mc.system.findGroups(line.rstrip('\n'))

groupId = -1

for group in groups:

  if group['groupPath'] == 'My Organization\TEST':

   groupId = group['groupId']

if groupId == -1:

  error = 'Error finding the specified group.'

  sys.exit(error)

#now that we have the group id, pull in the systems from file

sourceId = "12"

sourceType = "CLI"

file = open('C:/systemsToAdd.txt', 'r')

for line in file:

sysProps = line.rstrip('\n').split(',')

# Contains line break at "\"

systemId = mc.detectedsystem.add(sourceId,sourceType,sysProps[0],sysProps[1],dnsName=sysProps[2],domain=sysProps[3])

mc.detectedsystem.addToTree(str(systemId),str(groupId))

Any help???

Best regards,

Jose

10 Replies
exbrit
Level 21
Report Inappropriate Content
Message 2 of 11

Re: API to add system to system tree in ePO

Moved to ePO 4.6 Web API for better handling.

---

Peter

Moderator

Re: API to add system to system tree in ePO

Any update on this?

exbrit
Level 21
Report Inappropriate Content
Message 4 of 11

Re: API to add system to system tree in ePO

Do you want me to move this to the general ePO discussions Jose?

Re: API to add system to system tree in ePO

Hi Ex_Brit,

I think it would be nice as it will have more visibility

I need this script working and after opening a case with McAfee still not answer.

Thanks for your help Ex-Brit

Regards,

exbrit
Level 21
Report Inappropriate Content
Message 6 of 11

Re: API to add system to system tree in ePO

Moved, good luck ;-)

Re: API to add system to system tree in ePO

Thanks!

alby99
Level 7
Report Inappropriate Content
Message 8 of 11

Re: API to add system to system tree in ePO

Jose,

When you say you are "trying to get the script to add machines into the system tree in epo", do you mean there is nothing currently in your system tree, or have you used (in Server Settings) Active Directory Groups to initially populate your system tree, but are now trying to move devices elsewhere in the tree? Writing a script to do something which ePO can be easily configured to do sounds like hard work to me.

Regards,

Simon

Re: API to add system to system tree in ePO

Hi,

I need the script because we have a factory and we want that machines creates in factory automatically will be added in the ePO system tree and in a specific group depending of the clasification so we need this script.

I know we can use the ePO to added manually but we dont want as it is a job that need to be automatic

Regards,

Jose

c14us
Level 7
Report Inappropriate Content
Message 10 of 11

Re: API to add system to system tree in ePO

Are you sure you need a command for this?. If you in your factory have the local frameworkpackage MA installer with the local client communication keys, the system will be created automaticly just as well.

\Claus

NB.

You can then afterwards set one of the 4 custom fields, and then use tagging to sort by your needs.

ex:

FrmInst.exe /CustomProps3="IT Department"