cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1260
Views
0
Helpful
4
Replies

Reporting API Help

thealy
Level 1
Level 1

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:

https://xxx.yyy.zzz:8000/monitor_email/overview?date_range=current_day&report_def_id=sma_overview&report_query_id=sma_overview_incoming_mail_over_time&format=csv

- 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

4 Replies 4

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

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

shannon.hagan
Level 1
Level 1

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.