Pre-Build Reports
While it is anticipated that most analytics of N2EDRA data will be performed through tools such as Tableau, a number of pre-built reports are also available through the N-Squared Customer Care (N2C5) GUI.
Available Reports
Two pre-built reports are available:
-
Activation Breakdown. The activation breakdown report provides a summary of the number of account activations that have occurred by Product Type per day. A date range filter allows this report to be limited to a specific date range.
-
Account Summary. The account summary report generates a summary of the last state change for accounts. A date range filter allows this report to be limited to a specific date range.
Configuration
To access these pre-built reports you will need to configure N2C5 in the following manner.
- Edit the appropriate N2C5 configuration file
/etc/jarvis/n2c5-<environment>.xml, replacing<environment>withprod,modelordevas appropriate:
vi /etc/jarvis/n2c5-prod.xml
or
vi /etc/jarvis/n2c5-model.xml
or
vi /etc/jarvis/n2c5-dev.xml
- Add a connection to the
edradatabase to the N2C5 configuration. Add this alongside other<database>connection details, updating the host and password as required.
<database name="edra" connect="dbi:Pg:dbname=n2edra;host=127.0.0.1" username="n2edra_readonly" password="n2edra_readonly"/>
- Add the N2C5 pre-built reports to the Jarvis configuration by adding the path to bottom of the
<default_libs>list:
<default_libs>
...
<lib path="/usr/share/n2edra/n2c5/jarvis/plugin"/>
</default_libs>
- Grant relevant users access to the reports. In the
n2c5-<environment>.xmlJarvis configuration file add reports to the<reports>element and refer to each of the reports using a<plugin>:
<plugin dataset="activation-breakdown" access="*" module="Report::ActivationBreakdown" add_headers="no" mime_type="application/xlsx">
<!--<parameter name="img_path" value="/usr/share/n2c5/htdocs/img/logo.jpg"/>-->
</plugin>
<plugin dataset="account-summary" access="*" module="Report::AccountSummary" add_headers="no" mime_type="application/xlsx">
<!--<parameter name="img_path" value="/usr/share/n2c5/htdocs/img/logo.jpg"/>-->
</plugin>
...
<reports output_path="/tmp">
...
<report access="*" folder="EDR Analytics" name="Activation Breakdown" js="edra/activation-breakdown.js"/>
<report access="*" folder="EDR Analytics" name="Account Summary" js="edra/account-summary.js"/>
</reports>
Note that the logo image to have at the top of the report is optional. A good size is around 201x137 pixels. Note that the image path may require adjustment depending on the installation of N2C5. The parameter is commented out by default.
-
Configure appropriate security. In the configuration added to
n2c5-<environment>.xml, update theaccessattributes to list the security groups that may access each report. -
Edit the Apache2 site configuration for the N2C5 application you wish to make the reports available in.
The file can be found in/etc/apache2/conf.d/and is likely calledn2c5-<environment>.conf, with the appropriate replacement for<environment>. Add the following configuration to the top of the file before the other entries to ensure that the alias works before the normal N2C5 alias:
# Redirect requests for N2EDRA reports to the appropriate place:
Alias /n2c5/js/report/edra/ "/usr/share/n2edra/n2c5/htdocs/js/report/"
<Directory /usr/share/n2edra/n2c5/htdocs/js/report/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
For additional details on configuring reports in N2C5 please see the Configuration - Reports documentation which is supplied with N2C5.
With this configuration in place, users with the appropriate security will now see these reports in the N2C5 reports screen.
Automated Report Execution
Reports may be executed automatically and emailed by use of the EmailReport tool in the N2C5 Package. Can be found in the bin directory of your N2C5 installation, e.g. /usr/share/n2c5/bin.
For more information on report configuration please see your N2C5 Configuration - Reports documentation.
May also be found on the NSquared website. Configuration - Reports.
Activation Report Parameters
- start_date : The start date to use. Should be in the format of YYYY-MM-DD. Defaults to the start of the current month if not specified. (Optional)
- end_date : Should be in the format of YYYY-MM-DD. If not specified then the end of the month start_date resides in will be used. (Optional)
For example, to generate an Activation Breakdown report for last month's statistics:
/usr/share/n2c5-<environment>/EmailReport.pl -to='you@domain' -kind='EDR Analytics Report' Report::ActivationBreakdown start_date=`date --date="$(date +%Y-%m-15) -1 month" +'%Y-%m-01'`
This may be executed via cron for fully automated report execution.
Account Summary Parameters
- start_date : The start date to use. Should be in the format of YYYY-MM-DD. Defaults to the start of the current month if not specified. (Optional)
- end_date : Should be in the format of YYYY-MM-DD. If not specified then the end of the month start_date resides in will be used. (Optional)
For example, to generate an Account Summary report for last month's statistics:
/usr/share/n2c5-<environment>/EmailReport.pl -to='you@domain' -kind='EDR Analytics Report' Report::AccountSummary start_date=`date --date="$(date +%Y-%m-15) -1 month" +'%Y-%m-01'`
Use the appropriate replacement for <environment> in the cron commands.