Header Only - DO NOT REMOVE - Extreme Networks

Custom Report / XML & MySQL


Userlevel 5
In the process of creating a custom report that aggregates multiple reports into one, namely the ability to produce the results of the average availability of all switches over a custom period of time.

Have managed to formulate the MySQL query below:
SELECT rpt_target.objectIDName AS Switch_IP, from_unixtime(rpt_default_day.time_stamp / 1000) AS 'Date', rpt_default_day.average
FROM rpt_default_day
INNER JOIN rpt_target on rpt_target.targetID=rpt_default_day.targetID
AND statisticID = 11
AND time_stamp >= 1491174000000
AND time_stamp <= 1493766000000
ORDER BY average ASC LIMIT 1000[/code]This does the job, and all I need to do is change the dates to get the schedule I want. But what I would like to be able to do is create a 'MyReport', similar to the one shown in this post:

https://community.extremenetworks.com/extreme/topics/oneview-top-interfaces-reports

The problem is I don't understand how the XML code is formatted, and wondered if anyone could help or point me in the right direction?

Many thanks in advance

3 replies

Userlevel 5
Hello Martin,

in my opinion, the easiest way to start is to look at existing reports.
The reports are stored in "/usr/local/Extreme_Networks/NetSight/appdata/OneView/Reports".

For example the report "IdentityAndAccessOverviewDailyReport.xml" contains an SQL query. Search in the report for "". The SQL query starts there.

Your own reports need to be stored in the directory "/usr/local/Extreme_Networks/NetSight/appdata/OneView/MyReports".

Create a own report via the web gui to see what happens in this folder to adapt this for your hand made report.

Hop this helps for your next step.

Regards
Stephan
Userlevel 5
Hi Stephan,

Thanks for the info. Managed to create the XML, which is great, but there is a couple of things extra I would like to do.

First would be to add an icon that allows me to download it as an Excel, and the other is be able to dynamically add a date range in rather than use what's fixed in the query?

Any ideas how to do that?

As one example there is a report under Device -> Port Usage. If you load that you get a Excel icon in the top right corner. I couldn't find that report, but if I could, I could probably work it out?

There is also examples of where you can dynamically add a date range, like Devices -> Device Availability Summary, which I found but can't workout how to make use of utilising the same code?

Many thanks,

Martin
Userlevel 5
With a bit of support, I got the answer:

To create a table that is searchable, filterable and allows CSV exporting:



[i]

Test Report
true
true
true
Help for what fields are searchable


To get multiple forms within one report you could use tabs for example.:


none
[i]

[b]
pdf


-->
[i]


Overview

vbox
[i]

hbox
[i]


Look at this report to get an idea:
/usr/local/Extreme_Networks/NetSight/appdata/OneView/Reports/DataCenterManagerAllHypervisors_IA.xml

To display a date-time picker you can use this:


All Calls

All Calls
false
fit

[i]

Start:
End:

startDate
[i]startDate
[i]1
60


endDate
[i]endDate
[i]1
60



[b]
refresh



[i]

Reply