I was working with Oracle API Gateway version 11.1.2 and we got to a point where our customer needed a report from what’s going through the API Gateway. This is where Analytics comes into play.
Oracle API Gateway Analytics monitors, records, and reports on the history of message traffic between API Gateway instances and various services, remote hosts, and clients running in a managed domain. You can use API Gateway Analytics to monitor traffic and perform root cause analysis at the level of the domain, API Gateway instance, service, remote host, and client.
For more information, please refer to the Oracle Documentation.
OAG Analytics was installed and configured. Apparently everything was ready to just open the console and generate the report needed, but we were facing a problem: The pdf file was not generating:
On the trace file, we found the following message:
INFO 05/Sep/2017:15:23:07.978 [1a5f:000000000000000000000000] Running scheduled report: null clients-id-1504642987963.pdf ERROR 05/Sep/2017:15:23:07.978 [1a5f:000000000000000000000000] Error generating report - wkhtmltopdf is not installed
After hours and hours of research, found this document on Oracle Support that explains OAG uses a specific version of an external utility to convert html content to a pdf file (wkhtmltopdf). Oracle refers to this as “a problem related to the tool wkhtmltopdf itself” The needed version for this to work is the 0.10.0_rc2, and can be found here.
OAG needs this script to be installed on the following path:
Once you’ve done this, restart your oaganalytics instance and try again. You should be able to get your generated report and download the file on your local computer.
You can even schedule a report generation (on pdf or csv format) on a particular time of the day.
All these reports are saved on the OAG server’s filesystem under <OAG_HOME>/analyticsReports folder by default.
-rw-r--r--. 1 oracle oinstall 96 Oct 3 18:00 remote-hosts-1day-20170913.csv -rw-r--r--. 1 oracle oinstall 173 Oct 3 18:00 system-resources-1day-20170913.csv -rw-r--r--. 1 oracle oinstall 145K Oct 3 17:59 system-resources-id-1507071566911.pdf -rw-r--r--. 1 oracle oinstall 124 Oct 3 18:00 systems-1day-20170913.csv -rw-r--r--. 1 oracle oinstall 139K Sep 13 18:24 systems-id-1505345052319.pdf