Thanks for replying..
So i had installed python on IIS server and I am successfully able to connect the Mcafee EPO via webservice.
but as earlier I stated that I have to use the webservice for "Importing new devices via external sources"
I am following the Mcafee EPO python webservice guide but it is giving me error;
Traceback (most recent call last): File "C:\PythonApp\addsystem.py", line 20, in systemId = mc.detectedsystem.add(sourceId,sourceType,sysProps,sysProps,dnsName=sysPr ops,domainName=sysProps) File "C:\PythonApp\mcafee.py", line 454, in __call__ raise emcafee.CommandInvokerError: Error setting parameters for command: detectedsystem.add
Python Version :2.7
Please let me know what I am exactly missing.
Thanks in advance!!
There's a handy tool (ePO.API.Explorer) that's available from this site that give insite into the contructs and parameters for all the ePO API commands.
From you sample data it looks like your IP address is invalid (but that might be the fact that you copied into your post incorrectly)
-- From API.Explorer
detectedsystem.add sourceID sourceType MAC IPAddress [IPSubnet] [IPSubnetMask] [dnsName] [OSPlatform] [OSFamily] [OSVersion] [domain][netbiosName] [netbiosComment] [users] [agentGUID] [detectedTime] [externalID]
Adds a single interface of a Detected System into the list of known Detected Systems. In addition to the source ID and source type, both a MAC address and an IP address (v4 or v6) must be provided. The combination of source ID and source type, arbitrarily defined by whoever is adding this system, denotes the source of detection for this Detected System.
Requires permission to create and edit rogue system information.
As for .NET/C# compatibility for the ePO technically it is possible you just have to code it yourself.
The API is basically a URL interface to the ePO database, you could do everything by typing the commands into a browser address bar (or use WGET if your L33T). So in theory if you could construct the URL in C# you can then just submit it as a web request to the ePO server.
Even I was trying the same issue so right now I am stucked on some other place.
You are right it was a just a syntactical mistake I was doing.
By the way right now I am trying to execute the same command but it is giving me the error on last line of code:
I am trying this example:
import mcafee, sys
mc = mcafee.client('localhost','8443','ga','ga','https','json')
file = open('C:/path/to/myfile.txt', 'r')
for line in file:
#determine the ID of the group to add it to
groups = mc.system.findGroups('Lost&Found')
groupId = -1
for group in groups:
if group['groupPath'] == 'My Organization\\Lost&Found']:
groupId = group['groupId']
if groupId == -1:
error = 'Error finding the specified group.'
#now that we have the group id, pull in the systems from file
sourceId = "12"
sourceType = "CLI"
file = open('C:/path/to/systemsToAdd.txt', 'r')
for line in file:
sysProps = line.split(',')
systemId = mc.detectedsystem.add(sourceId,sourceType,sysProps,sysProps,
and the above bold line is giving me the below error
Traceback (most recent call last): File "C:\PythonApp\addsystem.py", line 24, in mc.detectedsystem.addToTree(systemId,groupId) File "C:\PythonApp\mcafee.py", line 448, in __call__ return self.invoker.invoke(self.prefix + '.' + self.name, argmap) File "C:\PythonApp\mcafee.py", line 272, in invoke if arg[:8] == 'file:///':TypeError: 'int' object is not subscriptable
Wow,that great if I can use it by only constructing the URL only.
1) So do that URL would be submitted via Curl?? as wget is a unix command or so?
2) Will you please refer me or give me a single complete URL format for the same and what guide will list the URL's type and syntax,
Thanks for support!!
I got it ..web URL is working perfectly..
But i had few concerns:
1) Are these system which are added will be in the rouge only ??? we cannot add them in direct system tree ?
2) And when we use the URL then we have to give a username and password?So what are the addition in parameter I have to do in remote login.
Thanks again for your help...
I would guess the line
is at fault. What ever it's returning as a resulting value to systemid is not a valid variable for the addToTree command.
The explorer tool will also help you build the URLs and allow you to test/submit to your epo server and i think Curl will work as well
A rough example of a constructed URL to do what your attempting would be something like :-
From the web API script guide provided by McAfee it shows how to pass username and passwords using WGET
wget -q -O - --no-check-certificate --user=ga --password=ga "https://localhost:8443/remote/core.help"
I assume that CURL has the same functionality
To do it in a browser appears to be a little tricky
It would appear that Microsoft has disabled the sending of usernames and passwords in http and https URLs since IE6
However there is a way to disable it in the MS KB entry but it's a bit messy in my opinion...shame.