05-06-2011 08:00 AM
Running IronPort M660 / v7.2.0-390
Trying to use Reporting API as per this document (It was the most recent I could find): http://www.cisco.com/en/US/docs/security/security_management/sma/api/ESA_6.4.0_MR_Reporting_API.pdf
My goal is to be able to download the "Incoming Mail Summary" as a .csv from a Java program for additioanal processing. I started as suggested by working with the URLs in a browser (FireFox, Chrome).
We are using SSL. If I login manually and proceed to the Email Overview page, I am able to download the .csv for the "Incoming Mail Summary", although I am unable to see the URL by hovering over the "Export" link.
Ref Page 3 of the document, using the format http://username:password@example.com/monitor/reportspassword@example.com/monitor/reports works with the same username and login. When the program attempts to make the same call, the login succeeds, but the call to get the .csv using the same URL (below) fails even though the sid= cookie returned from the login is included. It returns the login page. I get the same result when omitting the username:password@ prefix to the same URL.
Perhaps I have the wrong URL entirely? I would expect an error page rather than the Login page again.
URL Used:
- Can you provide any suggestions? I'm open to any way to get the data in the .csv or .xml
- If you have example code that works with this "API", that would be hugely helpful.
-Terry
05-06-2011 01:20 PM
Terry,
I may need to go over this with you in a bit more detail. I believe what your trying to do will work. Some time ago I worked a case with a very similar issue. I am looking for the case notes now to see if I can find a solution for you. Eventually I would recommend we open a service request for this as it may get a bit involved. We can still post the findings back to the forums for those interested. If you prefer you can open the SR directly from the forum thread, or I can open a ticket for you if need be.
Christopher C Smith
CSE
CIsco IronPort Customer Support
05-09-2011 08:01 AM
Christopher-
Thanks very much - just let me know what you need. If at all possible, can you contact me via my email directly and then if / when we resolve it, we can post it here?
Thanks,
Terry
05-11-2011 05:12 PM
HI Terry,
I can email you directly however we will still need to open an SR.
You can also do that here.
Christopher C Smith
CSE
Cisco IronPort Customer Support
05-14-2011 08:00 AM
For some of the pages, you need to set the realm - the realm for the username and password to work with the ESA is "IronPort Web Interface". I am not sure how you do that in Java.
In python, you would do something like:
handler = urllib2.HTTPBasicAuthHandler()
handler.add_password("IronPort Web Interface", host, username, passwd)
opener = urllib2.build_opener(handler)
urllib2.install_opener(opener)
webpage = urllib2.urlopen("https://host/xml/status") <- example to get the xml status pages.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide