url = reverse('report-view', kwargs=kwargs)
    line = '<li><a href="%s" target="_blank">%s</a></li>' % (url, r.title)
    lines.append(line)

html = """
<ul>
%s
</ul>
""" % '\n'.join(lines)

table = StaticHTMLTable.create('Report Links', html)
raw.TableWidget.create(section, table, 'report table', width=6)


# Define a map and table, group by location
table = GroupByTable.create('maploc', 'host_group', duration=60, resolution='auto')

Column.create(table, 'group_name',    label='Group Name', iskey=True)
Column.create(table, 'response_time', label='Resp Time',  datatype='metric')
Column.create(table, 'network_rtt',   label='Net RTT',    datatype='metric')
Column.create(table, 'server_delay',  label='Srv Delay',  datatype='metric')

maps.MapWidget.create(section, table, "Response Time", width=5, height=300)


# Define a Sharepoint Table
table = SharepointTable.create('sp-documents', '/', 'Shared Documents')

create_sharepoint_column(table, 'BaseName', issortcol=True)
create_sharepoint_column(table, 'Created', datatype='time')
create_sharepoint_column(table, 'Modified', datatype='time')
              'out_avg_bytes',
              'Avg Outbound Bytes/s',
              datatype='bytes',
              units='B/s')

yui3.TimeSeriesWidget.create(section,
                             table,
                             "Overall Average In/Out Bandwidth",
                             width=6)

###
# QOS Summary Tables
for direction in ['inbound', 'outbound']:
    table = GroupByTable.create('qos-%s-totals' % direction,
                                groupby='qos',
                                duration=15,
                                resolution=60,
                                interface=True)
    table.fields.add(interface_field)
    TableField.create(keyword='%s_filterexpr' % direction,
                      obj=table,
                      hidden=True,
                      post_process_template='%s interface {interface}' %
                      direction)
    profiler.fields_add_filterexprs_field(table, '%s_filterexpr' % direction)

    Column.create(table, 'qos', 'QoS', iskey=True)
    Column.create(table, 'qos_name', 'QoS Name', iskey=True)
    Column.create(table,
                  'avg_bytes',
                  'Avg Bytes/s',
Exemple #3
0
from rvbd_portal.apps.datasource.modules.analysis import AnalysisTable

# helper libraries
from rvbd_portal.apps.plugins.builtin.whois.libs.whois import whois

#
# Profiler report
#

report = Report(title="Whois", position=5)
report.save()

section = Section.create(report)

# Define a Table that gets external hosts by avg bytes
table = GroupByTable.create('5-hosts', 'host', duration='1 hour',
                            filterexpr='not srv host 10/8 and not srv host 192.168/16')

Column.create(table, 'host_ip', 'IP Addr', iskey=True)
Column.create(table, 'avg_bytes', 'Avg Bytes', units='s', issortcol=True)


# Create an Analysis table that calls the 'whois' function to craete a link to 'whois'
whoistable = AnalysisTable.create('5-whois-hosts',
                                  tables={'t': table.id},
                                  func=whois)

Column.create(whoistable, 'host_ip', label="IP Addr", iskey=True)
Column.create(whoistable, 'avg_bytes', 'Avg Bytes', datatype='bytes', issortcol=True)
Column.create(whoistable, 'whois', label="Whois link", datatype='html')

yui3.TableWidget.create(section, whoistable, "Link table", width=12)
from rvbd_portal_shark.datasources.shark import SharkTable, create_shark_column

#
# Overall report
#

report = Report(title="Overall", position=1,
                field_order=['endtime', 'profiler_filterexpr', 'shark_filterexpr'],
                hidden_fields=['resolution', 'duration'])
report.save()

section = Section.create(report, title='Locations',
                         section_keywords=['resolution', 'duration'])
                         
# Define a map and table, group by location
table = GroupByTable.create('maploc', 'host_group', duration=60, resolution='auto')

Column.create(table, 'group_name',    label='Group Name', iskey=True)
Column.create(table, 'response_time', label='Resp Time',  datatype='metric')
Column.create(table, 'network_rtt',   label='Net RTT',    datatype='metric')
Column.create(table, 'server_delay',  label='Srv Delay',  datatype='metric')

maps.MapWidget.create(section, table, "Response Time", width=6, height=300)
yui3.TableWidget.create(section, table, "Locations by Avg Bytes", width=6)

# Define a Overall TimeSeries showing Avg Bytes/s
section = Section.create(report, title='Profiler Overall',
                         section_keywords=['resolution', 'duration'])

table = TimeSeriesTable.create('ts1', duration=1440, resolution='15min')
report = Report(title="Business Hour Reporting - Profiler Interfaces", position=9,
                field_order=['endtime', 'duration', 'profiler_filterexpr',
                             'business_hours_start', 'business_hours_end',
                             'business_hours_tzname', 'business_hours_weekends'],
                hidden_fields=['resolution'])
report.save()

section = Section.create(report)

bizhours.fields_add_business_hour_fields(section)

#
# Define by-interface table from Profiler
#
basetable = GroupByTable.create('bh-basetable', 'interface', duration=60,
                                resolution=3600, interface=True)

# Define all of your columns here associated with basetable
# For each data column (iskey=False), you must specify the aggreation method
# in the bizhours.create below.
Column.create(basetable, 'interface_dns', 'Interface', iskey=True, isnumeric=False)
Column.create(basetable, 'interface_alias', 'Ifalias', iskey=True, isnumeric=False)
Column.create(basetable, 'avg_util', '% Utilization', datatype='pct', issortcol=True)
Column.create(basetable, 'in_avg_util', '% Utilization In', datatype='pct', issortcol=False)
Column.create(basetable, 'out_avg_util', '% Utilization Out', datatype='pct', issortcol=False)

# The 'aggregate' parameter describes how similar rows on different business days
# should be combined.  For example:
#
#     Day    Total Bytes   Avg Bytes/s
# ---------  ------------  -----------
Exemple #6
0
# Define a TimeSeries showing Avg Bytes/s for tcp/443
table = TimeSeriesTable.create('ts-tcp443', duration=60, filterexpr='tcp/443')

Column.create(table, 'time', 'Time', datatype='time', iskey=True)
Column.create(table, 'avg_bytes', 'Avg Bytes/s', datatype='bytes', units='B/s')
Column.create(table,
              'avg_bytes_rtx',
              'Avg Retrans Bytes/s',
              datatype='bytes',
              units='B/s')

yui3.TimeSeriesWidget.create(section, table, "Bandwidth for tcp/443")

# Define a Pie Chart for locations
table = GroupByTable.create('location-bytes', 'host_group', duration=60)

Column.create(table, 'group_name', 'Group Name', iskey=True)
Column.create(table,
              'avg_bytes',
              'Avg Bytes/s',
              datatype='bytes',
              units='B/s',
              issortcol=True)

yui3.PieWidget.create(section, table, "Locations by Bytes")

# Define a Table
table = GroupByTable.create('location-resptime', 'host_group', duration=60)

Column.create(table, 'group_name', 'Group Name', iskey=True)
Exemple #7
0
                    'business_hours_start', 'business_hours_end',
                    'business_hours_tzname', 'business_hours_weekends'
                ],
                hidden_fields=['resolution'])
report.save()

section = Section.create(report)

bizhours.fields_add_business_hour_fields(section)

#
# Define by-interface table from Profiler
#
basetable = GroupByTable.create('bh-basetable',
                                'interface',
                                duration=60,
                                resolution=3600,
                                interface=True)

# Define all of your columns here associated with basetable
# For each data column (iskey=False), you must specify the aggreation method
# in the bizhours.create below.
Column.create(basetable,
              'interface_dns',
              'Interface',
              iskey=True,
              isnumeric=False)
Column.create(basetable,
              'interface_alias',
              'Ifalias',
              iskey=True,
                               duration=15, resolution=60,
                               interface=True)
table.fields.add(interface_field)
table.fields.add(datafilter_field)

Column.create(table, 'time', 'Time', datatype='time', iskey=True)
Column.create(table, 'in_avg_bytes', 'Avg Inbound Bytes/s', datatype='bytes', units='B/s')
Column.create(table, 'out_avg_bytes', 'Avg Outbound Bytes/s', datatype='bytes', units='B/s')

yui3.TimeSeriesWidget.create(section, table, "Overall Average In/Out Bandwidth", width=6)

###
# QOS Summary Tables
for direction in ['inbound', 'outbound']:
    table = GroupByTable.create('qos-%s-totals' % direction, groupby='qos', 
                                duration=15, resolution=60,
                                interface=True)
    table.fields.add(interface_field)
    TableField.create(keyword='%s_filterexpr' % direction, obj=table, hidden=True, 
                      post_process_template='%s interface {interface}' % direction)
    profiler.fields_add_filterexprs_field(table, '%s_filterexpr' % direction)

    Column.create(table, 'qos', 'QoS', iskey=True)
    Column.create(table, 'qos_name', 'QoS Name', iskey=True)
    Column.create(table, 'avg_bytes', 'Avg Bytes/s', datatype='bytes', units='B/s')
    Column.create(table, 'total_bytes', 'Total Bytes/s', datatype='bytes', units='B/s')
    Column.create(table, 'avg_util', 'Avg Util', datatype='metric')
    Column.create(table, 'peak_util', 'Peak Util', datatype='metric')

    yui3.TableWidget.create(section, table, "%s Traffic by QoS" % direction.capitalize(), width=6)
Exemple #9
0
import rvbd_portal.apps.report.modules.yui3 as yui3

from rvbd_portal_profiler.datasources.profiler import GroupByTable

#
# Google Map example
#

# Google Map example
report = Report(title="Response Time Map", position=4)
report.save()

section = Section.create(report)

# Define a map and table, group by location
table = GroupByTable.create('maploc2', 'host_group', duration=60)

Column.create(table, 'group_name', iskey=True, label='Group Name')
Column.create(table, 'response_time', label='Resp Time', datatype='metric')
Column.create(table, 'network_rtt', label='Net RTT', datatype='metric')
Column.create(table, 'server_delay', label='Srv Delay', datatype='metric')
Column.create(table, 'avg_bytes', label='Response Time', datatype='metric')
Column.create(table, 'peak_bytes', 'Peak Bytes/s', datatype='bytes', units='B/s')
Column.create(table, 'avg_bytes_rtx', 'Avg Retrans Bytes/s', datatype='bytes', units='B/s')
Column.create(table, 'peak_bytes_rtx', 'Peak Retrans Bytes/s', datatype='bytes', units='B/s')

# Create a Map widget
maps.MapWidget.create(section, table, "Response Time Map", width=12, height=500)

# Create a Table showing the same data as the map
yui3.TableWidget.create(section, table, "Locations", width=12)
Column.create(table, 'avg_bytes_rtx', 'Avg Retrans Bytes/s', datatype='bytes', units = 'B/s')

yui3.TimeSeriesWidget.create(section, table, "Bandwidth for tcp/80",
                             altaxis=['avg_bytes_rtx'])

# Define a TimeSeries showing Avg Bytes/s for tcp/443
table = TimeSeriesTable.create('ts-tcp443', duration=60,
                               filterexpr = 'tcp/443')

Column.create(table, 'time', 'Time', datatype='time', iskey=True)
Column.create(table, 'avg_bytes', 'Avg Bytes/s', datatype='bytes', units = 'B/s')
Column.create(table, 'avg_bytes_rtx', 'Avg Retrans Bytes/s', datatype='bytes', units = 'B/s')

yui3.TimeSeriesWidget.create(section, table, "Bandwidth for tcp/443")

# Define a Pie Chart for locations
table = GroupByTable.create('location-bytes', 'host_group', duration=60)

Column.create(table, 'group_name', 'Group Name', iskey=True)
Column.create(table, 'avg_bytes', 'Avg Bytes/s', datatype='bytes', units = 'B/s', issortcol=True) 

yui3.PieWidget.create(section, table, "Locations by Bytes")

# Define a Table
table = GroupByTable.create('location-resptime', 'host_group', duration=60)

Column.create(table, 'group_name', 'Group Name', iskey=True)
Column.create(table, 'response_time', 'Response Time', units='s', issortcol=True)

yui3.BarWidget.create(section, table, "Locations by Response Time")