cancel
Showing results for 
Search instead for 
Did you mean: 

Wake Up Agent Python 2.7 script

Jump to solution

So using the McAfee book "epo_510_rg_Web API_0-00_en-us" I have attemped to implement the Example 2 script for waking up agents on page 22...  Anyway I receive the below error:

C:\Users\Administrator\PycharmProjects\test\venv\Scripts\python.exe C:/Users/Administrator/PycharmProjects/test/autoAgentWakeUp.py
Traceback (most recent call last):
File "C:/Users/Administrator/PycharmProjects/test/autoAgentWakeUp.py", line 14, in <module>
result = mc.system.wakeupAgent(id)
File "C:\Python27\Lib\mcafee.py", line 446, in __call__
return self.invoker.invoke(self.prefix + '.' + self.name, argmap)
File "C:\Python27\Lib\mcafee.py", line 271, in invoke
if arg[:8] == 'file:///':
TypeError: 'int' object has no attribute '__getitem__'

 

Anyway below is my code, I suspect the error is probably due to using ePO 5.3 over ePO 5.1:

 

import mcafee
import ssl
ssl.match_hostname= lambda cert, hostname: True
mc = mcafee.client("localhost", "8443","admin","password")


#code specific to this task
input = "mytag" #

systems = mc.system.find(input)#Search text can be IP address, MAC address, user name, agent GUID or tag
#The above uses the System Tree for searching
for system in systems:
id = system['EPOComputerProperties.ParentID']
result = mc.system.wakeupAgent(id)

 

Anyway I will continue looking into this error and  see if I can find an answer.

1 Solution

Accepted Solutions

Re: Wake Up Agent Python 2.7 script

Jump to solution

Okay, so I have managed to solve my own problem just after posting here. Anyway for some reason or another:

    EPOComputerProperties.ParentID

Will not work, so instead I called on the devices IP address, yes it was really stupid but it works so I'm happy:

    id = system['EPOComputerProperties.ParentID']

So replace the above line with the below line

    id = system['EPOComputerProperties.IPAddress']
2 Replies

Re: Wake Up Agent Python 2.7 script

Jump to solution

Okay, so I have managed to solve my own problem just after posting here. Anyway for some reason or another:

    EPOComputerProperties.ParentID

Will not work, so instead I called on the devices IP address, yes it was really stupid but it works so I'm happy:

    id = system['EPOComputerProperties.ParentID']

So replace the above line with the below line

    id = system['EPOComputerProperties.IPAddress']
McAfee Employee Hawkmoon
McAfee Employee
Report Inappropriate Content
Message 3 of 3

Re: Wake Up Agent Python 2.7 script

Jump to solution
Thanks for the update, appreciated!

Was my reply helpful?

If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

More McAfee Tools to Help You
  • Subscription Service Notification (SNS)
  • How-to: Endpoint Removal Tool
  • Support: Endpoint Security
  • eSupport: Policy Orchestrator