Exemple #1
0
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.


from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.maps as maps
import steelscript.appfwk.apps.report.modules.yui3 as yui3
from steelscript.netprofiler.appfwk.datasources.netprofiler import NetProfilerGroupbyTable

#
# Google Map example
#

report = Report.create("Response Time Map", position=10)

report.add_section()

# Define a map and table, group by location
p = NetProfilerGroupbyTable.create("maploc2", groupby="host_group", duration=60)

p.add_column("group_name", iskey=True, label="Group Name", datatype="string")
p.add_column("response_time", label="Resp Time", units="ms")
p.add_column("network_rtt", label="Net RTT", units="ms")
p.add_column("server_delay", label="Srv Delay", units="ms")
p.add_column("avg_bytes", label="Response Time", units="B/s")
p.add_column("peak_bytes", "Peak Bytes/s", units="B/s")
p.add_column("avg_bytes_rtx", "Avg Retrans Bytes/s", units="B/s")
p.add_column("peak_bytes_rtx", "Peak Retrans Bytes/s", units="B/s")
    table = SomeTable.create(name, table_options...)
    table.add_column(name, column_options...)
    table.add_column(name, column_options...)
    table.add_column(name, column_options...)

    report.add_widget(yui3.TimeSeriesWidget, table, name, width=12)

See the documeantion or sample plugin for more details
"""
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.c3 as c3

# Import the datasource module for this plugin (if needed)
import steelscript.scc.appfwk.datasources.scc as scc


report = Report.create("SCC Device Throughput", position=10)

report.add_section()

table = scc.SCCThroughputTable.create(name='throughputtable')

table.add_column('timestamp', 'Time', datatype='time', iskey=True)
table.add_column('wan_in', 'inbound wan traffic', units='B/s')
table.add_column('wan_out', 'outbound wan traffic', units='B/s')
table.add_column('lan_in', 'inbound lan traffic', units='B/s')
table.add_column('lan_out', 'outbound lan traffic', units='B/s')

report.add_widget(c3.TimeSeriesWidget, table, "SCC Device Throughput",
                  height=300, width=12)
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.


import steelscript.appfwk.apps.report.modules.c3 as c3
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.tables as tables
from steelscript.netshark.appfwk.datasources.netshark import \
    NetSharkTable

#
# Define a NetShark Report and Table
#
report = Report.create('NetShark TCP Errors', position=10)
report.add_section()

tcp = NetSharkTable.create(name='TCPErrors', aggregated=True)

tcp.add_column('error_type', label='TCP Error Type', iskey=True,
               extractor='tcp.error_type', datatype='string')
tcp.add_column('errors', label='TCP Errors', sortdesc=True,
               extractor='tcp.errors', datatype='integer', operation='sum',
               default_value=0)

report.add_widget(c3.BarWidget, tcp,
                  'TCP Errors', width=6, height=400)
report.add_widget(tables.TableWidget, tcp,
                  'TCP Errors Table', width=6, height=400)
from steelscript.appfwk.apps.datasource.modules.analysis import CriteriaTable
from steelscript.appfwk.apps.datasource.models import TableField

from steelscript.appfwk.apps.report.models import Report
from steelscript.appfwk.apps.report.modules import raw

from steelscript.appfwk.apps.report.tests.reports import criteria_functions as funcs

report = Report.create(title='Criteria Parents',
                       hidden_fields=['report_computed',
                                      'section_computed',
                                      'table_computed'])

# Report-level independent
TableField.create('report_independent', 'Report Independent', obj=report)

# Report-level computed
TableField.create('report_computed', 'Reprot computed', obj=report,
                  post_process_template='report_computed:{report_independent}',
                  hidden=False)

# Section
section = report.add_section(title='Section 0')

# Section-level computed
TableField.create(keyword='section_computed', obj=section,
                  post_process_template='section_computed:{report_computed}',
                  hidden=False)

# Table
a = CriteriaTable.create('test-criteria-parents')
from steelscript.appfwk.apps.datasource.modules.html import HTMLTable
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.raw as raw
import steelscript.appfwk.apps.report.modules.maps as maps
import steelscript.appfwk.apps.report.modules.yui3 as yui3
from steelscript.netprofiler.appfwk.datasources.netprofiler import NetProfilerGroupbyTable
from steelscript.appfwk.apps.plugins.builtin.sharepoint.datasources.sharepoint import SharepointTable


logger = logging.getLogger(__name__)

#
# HTML Example Report
#

report = Report.create("Landing Page Example", position=9.1,
                       hide_criteria=True, reload_minutes=5)

report.add_section('Raw HTML')


# Define an image
imgurl = 'http://radar.weather.gov/Conus/Loop/NatLoop_Small.gif'
markup = '<img src="%s" alt="Doppler Radar National Mosaic Loop">' % imgurl

table = HTMLTable.create('Weather Image', html=markup)
report.add_widget(raw.TableWidget, table, 'weather image', width=6)


# Define an html table of links
# As an example of how the module loading works, this table
# may end up being shorter than the actual total number of reports
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.raw as raw
from steelscript.appfwk.apps.datasource.forms import fields_add_time_selection
from steelscript.appfwk.apps.datasource.modules.analysis import CriteriaTable

report = Report.create(title='Criteria Time Selection')
report.add_section()

a = CriteriaTable.create('test-criteria-timeselection')
fields_add_time_selection(a, initial_duration='1 day')

report.add_widget(raw.TableWidget, a, 'Table')
# as set forth in the License.


import steelscript.appfwk.apps.report.modules.c3 as c3
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.tables as tables

from steelscript.netshark.appfwk.datasources.netshark import \
    NetSharkTable
from steelscript.appfwk.apps.datasource.modules.analysis import \
    FocusedAnalysisTable

#
# Define a NetShark Report and Table
#
report = Report.create('NetShark Microburst Summary', position=10)
report.add_section()

# Summary Microbursts Graph for NetShark
t = NetSharkTable.create(name='MicroburstsTime', duration=1,
                         resolution='1sec', aggregated=False)

t.add_column('time', label='Time', iskey=True,
             extractor='sample_time', datatype='time')

t.add_column('max_microburst_1ms_bits', label='uBurst 1ms',
             extractor='generic.max_microburst_1ms.bits',
             operation='max', units='B')

t.add_column('max_microburst_10ms_bits', label='uBurst 10ms',
             extractor='generic.max_microburst_10ms.bits',
from steelscript.appfwk.apps.datasource.modules.analysis import CriteriaTable
from steelscript.appfwk.apps.datasource.models import TableField
from steelscript.appfwk.libs.fields import Function

from steelscript.appfwk.apps.report.models import Report
from steelscript.appfwk.apps.report.modules import raw

from steelscript.appfwk.apps.report.tests.reports \
    import criteria_functions as funcs

report = Report.create(title='Criteria Shared Fields')

x = TableField.create('x', 'X Value')
for i in range(2):

    section = report.add_section(title='Section %d' % i)

    a = CriteriaTable.create('test-criteria-sharedfields-%d' % i)

    a.fields.add(x)
    y = TableField.create('y',
                          'Y Value',
                          a,
                          hidden=True,
                          parent_keywords=['x'],
                          post_process_func=Function(
                              funcs.sharedfields_compute,
                              params={'factor': 10 * (i + 1)}))

    report.add_widget(raw.TableWidget, a, 'Table %d' % i)
Exemple #9
0
from steelscript.appfwk.apps.report.models import Report
from steelscript.appfwk.apps.report.modules import raw

# Report
from steelscript.appfwk.apps.report.tests.reports.synthetic_functions \
    import SyntheticGenerateTable

report = Report.create(title='Widget token test')

# Section
report.add_section(title='Section 0')

# Table
a = SyntheticGenerateTable.create('test-widget-token')

report.add_widget(raw.TableWidget, a, 'Table')
Exemple #10
0
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.

import steelscript.appfwk.apps.report.modules.c3 as c3
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.tables as tables
from steelscript.netshark.appfwk.datasources.netshark import \
    NetSharkTable
from steelscript.appfwk.apps.datasource.modules.analysis import \
    FocusedAnalysisTable

#
# Define a NetShark Report and Table
#
report = Report.create('NetShark Microburst and TCP Errors', position=10)
report.add_section()

# Summary Microbursts Graph for NetShark
t = NetSharkTable.create(name='MicroburstsTime',
                         duration=1,
                         resolution='1sec',
                         aggregated=False)

t.add_column('time',
             label='Time',
             iskey=True,
             extractor='sample_time',
             datatype='time')

t.add_column('max_microburst_1ms_bits',
Exemple #11
0
# Copyright (c) 2019 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.

import steelscript.appfwk.apps.report.modules.c3 as c3
import steelscript.appfwk.apps.report.modules.tables as tables
from steelscript.appfwk.apps.report.models import Report
from steelscript.netprofiler.appfwk.datasources.netprofiler import (
    NetProfilerTimeSeriesTable, NetProfilerGroupbyTable)
#
# NetProfiler report
#

report = Report.create("NetProfiler Utilization", position=10)

report.add_section()

# Define a Overall TimeSeries showing Avg Bytes/s
p = NetProfilerTimeSeriesTable.create('opt-overall',
                                      duration=60,
                                      interface=True,
                                      resolution="1min")

p.add_column('time', 'Time', datatype='time', iskey=True)
p.add_column('in_avg_util', 'In Avg Util %', units='pct')
p.add_column('out_avg_util', 'Out Avg Util %', units='pct')
p.add_column('50-line', '50% Util', synthetic=True, compute_expression='50')
p.add_column('70-line', '70% Util', synthetic=True, compute_expression='70')
Exemple #12
0
# Copyright (c) 2019 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.

from steelscript.appfwk.apps.report.models import Report

from steelscript.netprofiler.appfwk.datasources.netprofiler_live import \
    NetProfilerLiveConfigTable

import steelscript.appfwk.apps.report.modules.tables as tables

report = Report.create("NetProfiler Live Templates")
report.add_section()

p = NetProfilerLiveConfigTable.create('live-templates')

report.add_widget(tables.TableWidget,
                  p,
                  'Widgets Configuration',
                  width=12,
                  height=0,
                  searching=True)
Exemple #13
0
# Copyright (c) 2016 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.

from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.yui3 as yui3
from steelscript.appfwk.apps.datasource.modules.metrics import MetricsTable

#
# Metrics Report
#

report = Report.create("Metrics Example", position=12)
report.add_section()

# ServicesMetrics
s = MetricsTable.create('services-metrics', schema='services', cacheable=False)
s.add_column('name', 'Service', datatype='string')
s.add_column('status_text',
             'Status',
             datatype='string',
             formatter='rvbd.formatHealthWithHover')

report.add_widget(yui3.TableWidget, s, "Services Metrics", width=6)

# NetworkMetrics
m = MetricsTable.create('network-metrics', schema='network', cacheable=False)
m.add_column('location', 'Location', datatype='string')
m.add_column('Infrastructure',
Exemple #14
0
from steelscript.appfwk.apps.report.models import Report
from steelscript.appfwk.apps.report.modules import raw

# Reports
from steelscript.appfwk.apps.report.tests.reports.synthetic_functions \
    import SyntheticGenerateTable

report = Report.create(title='Synthetic No Resampling')

# Section
report.add_section(title='Section 0')

# Table
a = SyntheticGenerateTable.create('test-synthetic-noresampling',
                                  source_resolution=60)

report.add_widget(raw.TableWidget, a, 'Table')
import steelscript.appfwk.apps.report.modules.c3 as c3
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.tables as tables
import steelscript.appfwk.libs.profiler_tools as protools

import steelscript.appfwk.business_hours.datasource.business_hours_source as bizhours
from steelscript.netprofiler.appfwk.datasources import netprofiler
from steelscript.netprofiler.appfwk.datasources import netprofiler_devices

report = Report.create(
    "Business Hour Reporting - NetProfiler Interfaces",
    position=10,
    field_order=[
        "starttime",
        "endtime",
        "netprofiler_filterexpr",
        "business_hours_start",
        "business_hours_end",
        "business_hours_tzname",
        "business_hours_weekends",
    ],
    hidden_fields=["duration", "resolution"],
)

report.add_section()

#
# Define by-interface table from NetProfiler
#
basetable = netprofiler.NetProfilerGroupbyTable.create(
    "bh-basetable", groupby="interface", duration=60, resolution=3600, interface=True
)
from django import forms

from steelscript.appfwk.apps.datasource.modules.analysis import CriteriaTable
from steelscript.appfwk.apps.datasource.models import TableField

from steelscript.appfwk.apps.report.models import Report
from steelscript.appfwk.apps.report.modules import raw

report = Report.create(title='Criteria Bool')

# Section
section = report.add_section(title='Section 0')

# Table
a = CriteriaTable.create('test-criteria-bool')

# Table-level criteria
TableField.create('b1',
                  'Bool True',
                  obj=a,
                  field_cls=forms.BooleanField,
                  initial=True)
TableField.create('b2',
                  'Bool False',
                  obj=a,
                  field_cls=forms.BooleanField,
                  initial=False)

report.add_widget(raw.TableWidget, a, 'Table')
# Copyright (c) 2019 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.


from steelscript.appfwk.apps.report.models import Report

from steelscript.netprofiler.appfwk.datasources.netprofiler_live import \
    NetProfilerLiveConfigTable

import steelscript.appfwk.apps.report.modules.tables as tables

report = Report.create("NetProfiler Live Templates")
report.add_section()

p = NetProfilerLiveConfigTable.create('live-templates')

report.add_widget(tables.TableWidget, p, 'Widgets Configuration', width=12,
                  height=0, searching=True)
from steelscript.appfwk.apps.datasource.modules.analysis import CriteriaTable
from steelscript.appfwk.apps.datasource.models import TableField
from steelscript.appfwk.libs.fields import Function

from steelscript.appfwk.apps.report.models import Report
from steelscript.appfwk.apps.report.modules import raw

from steelscript.appfwk.apps.report.tests.reports \
    import criteria_functions as funcs

report = Report.create(title='Criteria Post Process Errors')

section = report.add_section(title='Section 0')

a = CriteriaTable.create('test-criteria-postprocess-errors')

TableField.create('error', 'Error type', a)
TableField.create('x',
                  'X Value',
                  a,
                  hidden=True,
                  post_process_func=Function(funcs.postprocesserrors_compute))

report.add_widget(raw.TableWidget, a, 'Table')
Exemple #19
0
# Copyright (c) 2015 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.

import steelscript.appfwk.apps.report.modules.tables as tables
from steelscript.appfwk.apps.report.models import Report

from steelscript.netprofiler.appfwk.datasources.netprofiler import \
    NetProfilerServiceByLocTable

#
# NetProfiler report
#

report = Report.create("NetProfiler Services", position=10)

report.add_section()

# Define a Overall TimeSeries showing Avg Bytes/s
p = NetProfilerServiceByLocTable.create('services-by-loc')

report.add_widget(tables.TableWidget, p, "Services by location", width=6)
Exemple #20
0
# Copyright (c) 2019 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.

from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.c3 as c3
from steelscript.appresponse.appfwk.datasources.appresponse import \
    AppResponseTable, AppResponseTimeSeriesTable

report = Report.create("AppResponse ASA Time Series")

report.add_section()

t = AppResponseTable.create('timeseries-base', source='aggregates')
t.add_column('start_time', 'Time', datatype='time', iskey=True,
             extractor='start_time')
t.add_column('app_id', 'App ID', datatype='string', iskey=True,
             extractor='app.id')
t.add_column('app_name', 'App Name', datatype='string',
             extractor='app.name')
t.add_column('srv_response_time', 'Average Server Response Time (seconds)',
             datatype='float', extractor='avg_tcp.srv_response_time')
t.add_column('usr_response_time', 'Average User Response Time (seconds)',
             datatype='float', extractor='avg_tcp.user_response_time')
t.add_column('total_bytes', 'Average Bytes per Second', datatype='float',
             extractor='avg_traffic.total_bytes_ps')

t1 = AppResponseTimeSeriesTable.create('application-srv-response-time',
from steelscript.appfwk.apps.datasource.modules.analysis import CriteriaTable

from steelscript.appfwk.apps.report.models import Report, TableField
from steelscript.appfwk.apps.report.modules import raw

report = Report.create(title='Criteria Circular Dependency')
report.add_section()

a = CriteriaTable.create('test-criteria-circulardependency')

TableField.create(keyword='t1', obj=a,
                  post_process_template='table_computed:{t2}',
                  hidden=False)

TableField.create(keyword='t2', obj=a,
                  post_process_template='table_computed:{t3}',
                  hidden=False)

TableField.create(keyword='t3', obj=a,
                  post_process_template='table_computed:{t1}',
                  hidden=False)

report.add_widget(raw.TableWidget, a, 'Table')
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.

from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.c3 as c3
import steelscript.appfwk.apps.report.modules.tables as tables
from steelscript.appresponse.appfwk.datasources.appresponse import \
    AppResponseTable
from steelscript.appfwk.apps.datasource.modules.analysis import \
    FocusedAnalysisTable

report = Report.create("AppResponse Packets - Microburst and TCP Errors",
                       field_order=[
                           'endtime', 'duration', 'appresponse_device',
                           'appresponse_source', 'entire_pcap', 'granularity'
                       ])

report.add_section()

# summary microbursts
p = AppResponseTable.create('MicroburstsTime',
                            duration='1 min',
                            granularity='1s',
                            include_files=True)

p.add_column('time',
             label='Time',
             iskey=True,
             datatype='time',
"""

from steelscript.appfwk.apps.report.models import Report, Section
from steelscript.appfwk.apps.datasource.models import Column
import steelscript.appfwk.apps.report.modules.c3 as c3
import steelscript.appfwk.apps.report.modules.tables as tables

from steelscript.wireshark.appfwk.datasources.wireshark_source \
    import WiresharkColumn, WiresharkTable, WiresharkInfoTable

######################################################################
#
# PCAP analysis
#

report = Report(title="PCAP Analysis", position=10)
report.save()

report.add_section()

#
# Table: Pcap info
#

table = WiresharkInfoTable.create('pcap-info')

table.add_column('Attribute', datatype='string', iskey=True)
table.add_column('Value', datatype='string')

report.add_widget(tables.TableWidget, table, 'PCAP Info', width=12, height=200)
Exemple #24
0
# Copyright (c) 2019 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.

from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.c3 as c3
import steelscript.appfwk.apps.report.modules.tables as tables
from steelscript.appresponse.appfwk.datasources.appresponse import \
    AppResponseTable, AppResponseTimeSeriesTable, \
    AppResponseTopNTimeSeriesTable, AppResponseLinkTable

topn = 10

report = Report.create("AppResponse ASA Overall")

report.add_section()

# t1 is used to derive the overall metrics over the duration
t1 = AppResponseTable.create('applications-overall', source='aggregates')
t1.add_column('app_id', 'App ID', datatype='string', iskey=True,
              extractor='app.id')
t1.add_column('app_name', 'App Name', datatype='string',
              extractor='app.name')
t1.add_column('total_bytes', 'Average Bytes per Second', datatype='float',
              extractor='avg_traffic.total_bytes_ps')
t1.add_column('srv_response_time', 'Average Server Response Time (seconds)',
              datatype='float', extractor='avg_tcp.srv_response_time')
t1.add_column('usr_response_time', 'Average User Response Time (seconds)',
              datatype='float', extractor='avg_tcp.user_response_time')
Exemple #25
0
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.


import steelscript.appfwk.apps.report.modules.c3 as c3
from steelscript.appfwk.apps.report.models import Report
from steelscript.netprofiler.appfwk.datasources.netprofiler import \
    NetProfilerTimeSeriesTable, NetProfilerGroupbyTable, \
    add_netprofiler_hostgroup_field
#
# NetProfiler report
#

report = Report.create("NetProfiler HostGroup Report - ByLocation",
                       position=10,
                       field_order=['netprofiler_device', 'endtime',
                                    'duration', 'resolution', 'hostgroup',
                                    'netprofiler_filterexpr'])

section = report.add_section()

add_netprofiler_hostgroup_field(report, section, 'ByLocation')

# Define a Overall TimeSeries showing Avg Bytes/s
p = NetProfilerTimeSeriesTable.create('ts-overall',
                                      duration=60, resolution="1min")

p.add_column('time', 'Time', datatype='time', iskey=True)
p.add_column('avg_bytes', 'Avg Bytes/s', units='B/s')

report.add_widget(c3.TimeSeriesWidget, p, "Overall Traffic", width=12)
Exemple #26
0
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.

import steelscript.appfwk.apps.report.modules.c3 as c3
from steelscript.appfwk.apps.report.models import Report

from steelscript.netprofiler.appfwk.datasources.netprofiler import \
    NetProfilerTable, NetProfilerTrafficTimeSeriesTable

#
# NetProfiler report
#

report = Report.create("NetProfiler Top Ports/Apps over Time", position=10)
report.add_section()

# Need a "base" column for the top-n report that defines the metric
# to be queried for.  This table is never actually run, only the column
# parameters are used.
base = NetProfilerTable.create('ports-time-base')
base.add_column('avg_bytes', 'Avg Bytes/s', units='B/s')

# Create a top 5 report, groupby port
p = NetProfilerTrafficTimeSeriesTable.create('ports-time',
                                             base=base,
                                             groupby='port',
                                             top_n=5)
p.add_column('time', 'Time', datatype='time', iskey=True)
# Copyright (c) 2015 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.


from steelscript.appfwk.apps.datasource.models import TableField
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.c3 as c3
import steelscript.appfwk.apps.report.modules.tables as tables

from steelscript.netprofiler.appfwk.datasources.netprofiler import \
    NetProfilerTimeSeriesTable, NetProfilerGroupbyTable, NetProfilerTable

report = Report.create("DSCP Report", position=10,
                       hidden_fields=['netprofiler_filterexpr'])

netprofiler_filterexpr = TableField.create(
    keyword='netprofiler_filterexpr')

interface_field = TableField.create(
    keyword='interface', label='Interface', required=True)

#
# Overall section
#  - netprofiler_filterexpr = "interface {interface}"
#
section = report.add_section("Overall",
                             section_keywords=['netprofiler_filterexpr',
                                               'interface_expr'])
Exemple #28
0
import logging

from django.core.urlresolvers import reverse

from steelscript.appfwk.apps.datasource.modules.html import HTMLTable
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.raw as raw


logger = logging.getLogger(__name__)

#
# HTML Example Report
#

report = Report.create("HTML Example", position=11)

report.add_section('Raw HTML')


# Define an image
imgurl = 'http://radar.weather.gov/Conus/Loop/NatLoop_Small.gif'
markup = '<img src="%s" alt="Doppler Radar National Mosaic Loop">' % imgurl

table = HTMLTable.create('Weather Image', html=markup)
report.add_widget(raw.TableWidget, table, 'weather image')


# Define an html table of links
# As an example of how the module loading works, this table
# may end up being shorter than the actual total number of reports
from steelscript.appfwk.apps.datasource.models import TableField

from steelscript.appfwk.apps.report.models import Report
from steelscript.appfwk.apps.report.modules import raw

from steelscript.appfwk.apps.report.tests.reports.criteria_functions \
    import CriteriaFieldMapTable

report = Report.create(title='Criteria Defaults')
report.add_section(title='Section 0')

# The table defines two fields 'k1' and 'k2', leave k2 alone, but
# map k1
a = CriteriaFieldMapTable.create('test-criteria-fieldmap-1',
                                 field_map={'k1': 'k1-1'})
report.add_widget(raw.TableWidget, a, 'Table 1')

a = CriteriaFieldMapTable.create('test-criteria-fieldmap-2',
                                 field_map={'k1': {'keyword': 'k1-2',
                                                   'initial': 'K12'}})
report.add_widget(raw.TableWidget, a, 'Table 2')
#
# Changelog:
# 20160507 Gwen : add MailboxUsageTable - office365 mailbox usage report

# Copyright (c) 2015 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.


import logging
logger = logging.getLogger(__name__)

from steelscript.appfwk.apps.report.models import Report
report = Report.create("Office365 MailBox Usage Report")
report.add_section("Main")

from steelscript.appfwk.apps.datasource.models import Column, TableField
import steelscript.appfwk.apps.report.modules.yui3 as yui3

# Import the datasource module for this plugin
import steelscript.o365.appfwk.datasources.o365_source as o365

table = o365.O365MailboxUsageTable.create(name='O365MailboxUsage')
# OUTPUT example
# [...
# {'Date': '2016-05-03T00:00:00','TotalInactiveMailboxCount': '7','TotalMailboxCount': '12'}
# ... ]

# Report 
Exemple #31
0
<div style="width:500px">
<p>This example report demonstrates usage of the alerting functionality.

<p>The report gets defined as usual, with tables for datasources and widgets
for display of the data.  Separately, we define a set of trigger functions
that will analyze the results of the table before it gets displayed.  These
triggers are attachd to the table using the ``create_trigger`` function.

<p>If the trigger evaluates to True, the results can be forwarded to a variety
of ``Destinations`` using a ``Sender`` class.  Multiple ``Destinations``
can be added to a single trigger.
</div>
"""

report = Report.create("NetProfiler - Alert Example",
                       description=description,
                       position=10)
report.add_section()

# Define a Overall TimeSeries showing Avg Bytes/s
p = NetProfilerTimeSeriesTable.create('ts-overall', duration=60,
                                      resolution="1min")

p.add_column('time', 'Time', datatype='time', iskey=True)
p.add_column('avg_bytes', 'Avg Bytes/s', units='B/s')

report.add_widget(c3.TimeSeriesWidget, p, "Overall Traffic", width=6)

# Add a trigger to evaluate if traffic exceeds a certain threshold
a = create_trigger(source=p,
                   trigger_func=netprofiler_triggers.local_spike,
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.maps as maps
import steelscript.appfwk.apps.report.modules.c3 as c3
import steelscript.appfwk.apps.report.modules.tables as tables

from steelscript.netprofiler.appfwk.datasources.netprofiler import (NetProfilerGroupbyTable,
                                                                    NetProfilerTimeSeriesTable)
from steelscript.netshark.appfwk.datasources.netshark import NetSharkTable

#
# Overall report
#

report = Report.create("Overall",
                       position=9,
                       field_order=['endtime', 'netprofiler_filterexpr',
                                    'netshark_filterexpr'],
                       hidden_fields=['resolution', 'duration'])

report.add_section('Locations', section_keywords=['resolution', 'duration'])

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

p.add_column('group_name', label='Group Name', iskey=True, datatype="string")
p.add_column('response_time', label='Resp Time',  units='ms', sortdesc=True)
p.add_column('network_rtt', label='Net RTT',    units='ms')
p.add_column('server_delay', label='Srv Delay',  units='ms')

# Adding a widget using the Report object will apply them
from steelscript.appfwk.apps.datasource.modules.analysis import CriteriaTable
from steelscript.appfwk.apps.datasource.models import TableField
from steelscript.appfwk.libs.fields import Function

from steelscript.appfwk.apps.report.models import Report
from steelscript.appfwk.apps.report.modules import raw
from . import criteria_functions as funcs

report = Report.create(title='Criteria Post Process')

section = report.add_section(title='Section 0')

a = CriteriaTable.create('test-criteria-postprocess')

TableField.create('w', 'W Value', a)
TableField.create('x', 'X Value', a)
TableField.create('y', 'Y Value', a)

for (f1, f2) in [('w', 'x'), ('w', 'y'), ('x', 'y')]:
    (TableField.create
     ('%s%s' % (f1, f2), '%s+%s Value' % (f1, f2), a,
      hidden=True, parent_keywords=[f1, f2],
      post_process_func=Function(funcs.postprocess_field_compute,
                                 params={'fields': [f1, f2]})))


report.add_widget(raw.TableWidget, a, 'Table')
# Copyright (c) 2015 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.

from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.tables as tables

from steelscript.netshark.appfwk.datasources.netshark import \
    NetSharkJobsTable

report = Report.create('NetShark Capture Jobs', position=10)

report.add_section()

# Table for NetShark
t = NetSharkJobsTable.create(name='Netshark Capture Jobs', cacheable=False)

t.add_column('netshark', label='NetShark', datatype='string', iskey=True)
t.add_column('job_name', label='Job Name', datatype='string')
t.add_column('job_id', label='Job ID', datatype='string', iskey=True)

t.add_column('interface', label='Interface', datatype='string')
t.add_column('bpf_filter', label='BPF Filter', datatype='string')
t.add_column('dpi_enabled', label='Enable DPI', datatype='string')
t.add_column('index_enabled', label='Enable Indexing', datatype='string')
t.add_column('state', label='Status', datatype='string')

t.add_column('start_time', label='Start Time', datatype='string')
t.add_column('end_time', label='End Time', datatype='string')
    table.add_column(name, column_options...)
    table.add_column(name, column_options...)
    table.add_column(name, column_options...)

    report.add_widget(yui3.TimeSeriesWidget, table, name, width=12)

See the documeantion or sample plugin for more details
"""

from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.c3 as c3

# Import the datasource module for this plugin (if needed)
import steelscript.stock.appfwk.datasources.stock_source as stock

report = Report.create("Stock Report-Multiple Stocks", position=11)

report.add_section()

#
# Define a stock table with current prices with a list of stocks
#

table = stock.MultiStockPriceTable.create(name='multi-stock-price',
                                          duration='52w', resolution='day',
                                          stock_symbol=None)

# Add columns for time and 3 stock columns
table.add_column('date', 'Date', datatype='date', iskey=True)

# Bind the table to a widget for display
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.


import steelscript.appfwk.apps.report.modules.c3 as c3
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.tables as tables
from steelscript.netshark.appfwk.datasources.netshark import \
    NetSharkTable
from steelscript.appfwk.apps.datasource.modules.analysis import \
    FocusedAnalysisTable

#
# Define a NetShark Report and Table
#
report = Report.create('NetShark Microburst and TCP Errors', position=10)
report.add_section()

# Summary Microbursts Graph for NetShark
t = NetSharkTable.create(name='MicroburstsTime', duration=1,
                         resolution='1sec', aggregated=False)

t.add_column('time', label='Time', iskey=True,
             extractor='sample_time', datatype='time')

t.add_column('max_microburst_1ms_bits', label='uBurst 1ms',
             extractor='generic.max_microburst_1ms.bits',
             operation='max', units='B')

t.add_column('max_microburst_10ms_bits', label='uBurst 10ms',
             extractor='generic.max_microburst_10ms.bits',
Exemple #37
0
# Copyright (c) 2015 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.


from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.tables as tables
from steelscript.netprofiler.appfwk.datasources.netprofiler_devices import \
    NetProfilerDeviceTable

report = Report.create("NetProfiler Device List", position=10)

report.add_section()

#
# Device Table

p = NetProfilerDeviceTable.create('devtable')
p.add_column('ipaddr', 'Device IP', iskey=True, datatype="string")
p.add_column('name', 'Device Name', datatype="string", sortasc=True)
p.add_column('type', 'Flow Type', datatype="string")
p.add_column('version', 'Flow Version', datatype="string")

report.add_widget(tables.TableWidget, p, "Device List", height=300, width=12)
# Copyright (c) 2017 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.

from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.raw as raw

from steelscript.netshark.appfwk.datasources.netshark_msa import \
    MSADownloadTable

#
# Download PCAPs from two NetSharks and upload to a third for MSA analysis
#

report = Report.create('NetShark MSA Download', position=10)

report.add_section()

t = MSADownloadTable.create(name='MultiSegment Table')
t.add_column('results', label='Results', iskey=True)

report.add_widget(raw.TableWidget, t, 'MSA Results', width=12, height=400)
Exemple #39
0
"""

from steelscript.appfwk.apps.report.models import Report, Section
from steelscript.appfwk.apps.datasource.models import Column
import steelscript.appfwk.apps.report.modules.c3 as c3
import steelscript.appfwk.apps.report.modules.tables as tables

from steelscript.wireshark.appfwk.datasources.wireshark_source \
    import WiresharkColumn, WiresharkTable, WiresharkInfoTable

######################################################################
#
# PCAP analysis
#

report = Report(title="PCAP Analysis", position=10)
report.save()

report.add_section()

#
# Table: Pcap info
#

table = WiresharkInfoTable.create('pcap-info')

table.add_column('Attribute', datatype='string', iskey=True)
table.add_column('Value', datatype='string')

report.add_widget(tables.TableWidget, table, 'PCAP Info', width=12, height=200)
# Copyright (c) 2019 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.

import steelscript.appfwk.apps.report.modules.c3 as c3
from steelscript.appfwk.apps.report.models import Report
from steelscript.netprofiler.appfwk.datasources.netprofiler import (
    NetProfilerTimeSeriesTable,
    NetProfilerGroupbyTable)
#
# NetProfiler report
#

report = Report.create("NetProfiler", position=10)

report.add_section()

# Define a Overall TimeSeries showing Avg Bytes/s
p = NetProfilerTimeSeriesTable.create('ts-overall', duration=60,
                                      resolution="1min")

p.add_column('time', 'Time', datatype='time', iskey=True)
p.add_column('avg_bytes', 'Avg Bytes/s', units='B/s')

report.add_widget(c3.TimeSeriesWidget, p, "Overall Traffic", width=12)

# Define a TimeSeries showing Avg Bytes/s for tcp/80
p = NetProfilerTimeSeriesTable.create('ts-tcp80', duration=60,
                                      filterexpr='tcp/80', cacheable=False)
# Copyright (c) 2015 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.

import steelscript.appfwk.apps.report.modules.c3 as c3
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.tables as tables

from steelscript.netshark.appfwk.datasources.netshark import NetSharkTable
#
# Define a NetShark Report and Table
#

report = Report.create('NetShark', position=10)

report.add_section()

# NetShark Time Series
t = NetSharkTable.create(name='Total Traffic Bits',
                         duration=1, resolution='1sec', aggregated=False)

t.add_column('time', label='Time', iskey=True,
             extractor='sample_time', datatype='time')
t.add_column('generic_bits', label='Bits', iskey=False,
             extractor='generic.bits', operation='sum')

report.add_widget(c3.TimeSeriesWidget, t, 'Overall Bandwidth (Bits)',
                  width=12)
from steelscript.appfwk.apps.datasource.modules.analysis import CriteriaTable

from steelscript.appfwk.apps.report.models import Report, TableField
from steelscript.appfwk.apps.report.modules import raw

report = Report.create(title='Criteria Two Reports - 2')

TableField.create(keyword='k2', label='Key 2', obj=report, initial='r2')

# Section
report.add_section(title='Section')

# Table
a = CriteriaTable.create('test-criteria-tworeports-2')
TableField.create(keyword='k1', label='Key 1', obj=a, initial='r1')

report.add_widget(raw.TableWidget, a, 'Table 2')
    table = SomeTable.create(name, table_options...)
    table.add_column(name, column_options...)
    table.add_column(name, column_options...)
    table.add_column(name, column_options...)

    report.add_widget(yui3.TimeSeriesWidget, table, name, width=12)

See the documeantion or sample plugin for more details
"""
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.tables as tables

# Import the datasource module for this plugin (if needed)
import steelscript.scc.appfwk.datasources.scc as scc


report = Report.create("SCC Appliance List", position=10)

report.add_section()

table = scc.SCCAppliancesTable.create(name='appltable')

table.add_column('address', 'Appliance IP', iskey=True, datatype="string")
table.add_column('hostname', 'Appliance Host Name', datatype="string")
table.add_column('serial', 'Appliance Serial Number', datatype="string")
table.add_column('time_zone', 'Appliance Time Zone', datatype="string")

report.add_widget(tables.TableWidget, table, "Appliance List",
                  height=300, width=12)
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.

import steelscript.appfwk.apps.report.modules.tables as tables
import steelscript.netshark.appfwk.datasources.netshark_scanner_source as \
    scanner

from steelscript.appfwk.apps.report.models import Report
from steelscript.netshark.appfwk.datasources.netshark import NetSharkTable

# Import the datasource module for this plugin (if needed)


report = Report.create("NetShark Scanner", field_order=['endtime', 'duration'],
                       hidden_fields=['netshark_device',
                                      'netshark_source_name', 'resolution'])
report.add_section()

# Create base table
shark_bytes_table = NetSharkTable.create(name='shark_bytes', aggregated=True)
shark_bytes_table.add_column('generic_bytes', label='Bytes', iskey=False,
                             extractor='generic.bytes', operation='sum')

# Make
table = scanner.SharksTable.create(name='sharks',
                                   basetable=shark_bytes_table)
table.add_column('name', "Name", datatype='string')
table.add_column('host', "Host", datatype='string')
table.add_column('capjob', "Capture Job", datatype='string')
table.add_column('bytes', "Bytes")
<p>The first table uses the extensible <strong>custom table definition</strong>
approach where two new classes are defined to perform the initial table
definition and data processing.

<p>The second table looks much like the first, but uses a <strong>single
function</strong> to perform the post-processing.

<p>Both approaches have benefits, the custom definitions allow far more
flexibility in how things get defined, while the function approach can
be simpler for a quick report.  See the <a href="edit/">report definition</a>
for details on how this was written.
</div>
"""

report = Report.create("Whois Example Report",
                       description=description, position=11)

report.add_section()

# Define a Table that gets external hosts by avg bytes
# This will be used as the base table for both analysis approaches
table = NetProfilerGroupbyTable.create(
    '5-hosts', groupby='host', duration='1 hour',
    filterexpr='not srv host 10/8 and not srv host 192.168/16'
)
table.add_column('host_ip', 'IP Addr', iskey=True, datatype='string')
table.add_column('avg_bytes', 'Avg Bytes', units='B/s', sortdesc=True)


# Using the custom analysis classes, this will create a new analysis table
# and also add the extra column of interest.
    table = SomeTable.create(name, table_options...)
    table.add_column(name, column_options...)
    table.add_column(name, column_options...)
    table.add_column(name, column_options...)

    report.add_widget(yui3.TimeSeriesWidget, table, name, width=12)

See the documeantion or sample plugin for more details
"""
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.tables as tables

# Import the datasource module for this plugin (if needed)
import steelscript.scc.appfwk.datasources.scc as scc


report = Report.create("SCC Appliance List", position=10)

report.add_section()

table = scc.SCCAppliancesTable.create(name='appltable')

table.add_column('address', 'Appliance IP', iskey=True, datatype="string")
table.add_column('hostname', 'Appliance Host Name', datatype="string")
table.add_column('serial', 'Appliance Serial Number', datatype="string")
table.add_column('time_zone', 'Appliance Time Zone', datatype="string")

report.add_widget(tables.TableWidget, table, "Appliance List",
                  height=300, width=12)