コード例 #1
0
#
# 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 
コード例 #2
0
ファイル: map.py プロジェクト: riverbed/steelscript-appfwk
#
# 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")
コード例 #3
0
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')
コード例 #4
0
<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.
コード例 #5
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)
コード例 #6
0
# 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',
コード例 #7
0
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')
コード例 #8
0
    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,
コード例 #9
0
# 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)
コード例 #10
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
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)
コード例 #11
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
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',
コード例 #12
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.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')
コード例 #13
0
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
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
)
コード例 #15
0
# 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.c3 as c3
from steelscript.appresponse.appfwk.datasources.appresponse import \
    AppResponseTable, AppResponseTimeSeriesTable

report = Report.create("AppResponse SQL TimeSeries")

report.add_section()

t = AppResponseTable.create('SQL-overall', source='sql_summaries')
t.add_column('start_time',
             'Time',
             datatype='time',
             iskey=True,
             extractor='start_time')
t.add_column('db_process',
             'Client Process Name',
             datatype='string',
             iskey=True,
             extractor='db.process_name')
t.add_column('sql_duration',
             'Transaction Time',
             datatype='float',
             extractor='avg_sql.duration')
t.add_column('sql_packets',
コード例 #16
0
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')
コード例 #17
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.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")
コード例 #18
0
    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
コード例 #19
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.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 Summary",
                       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',
コード例 #20
0
    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.yui3 as yui3

# 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(yui3.TableWidget,
                  table,
                  "Appliance List",
                  height=300,
                  width=12)
コード例 #21
0
# 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.

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')
コード例 #22
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
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',
コード例 #23
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.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 DNS', position=10)

report.add_section()

# DNS Queries Over time
name = 'DNS Queries and Response Time Over Time'
s = NetSharkTable.create(name,
                         duration=15,
                         resolution='1min',
                         aggregated=False)

s.add_column('time',
             label='Time',
             iskey=True,
             datatype='time',
             extractor='sample_time')
コード例 #24
0
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')
# 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.c3 as c3
from steelscript.appresponse.appfwk.datasources.appresponse import \
    AppResponseTable, AppResponseTimeSeriesTable

report = Report.create("AppResponse DB Sessions TimeSeries")

report.add_section()

t = AppResponseTable.create('db-session-overall', source='dbsession_summaries')
t.add_column('start_time',
             'Time',
             datatype='time',
             iskey=True,
             extractor='start_time')
t.add_column('db_instance',
             'DB Instance',
             datatype='string',
             iskey=True,
             extractor='db.instance')
t.add_column('active_sessions',
             'Concurrent Active DB Sessions',
             datatype='float',
             extractor='avg_db.active_sessions')
t.add_column('active_time',
コード例 #26
0
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
# because at the time this is calculated, all the remaining reports
コード例 #27
0
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.yui3 as yui3
import steelscript.appfwk.apps.report.modules.maps as maps

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')
コード例 #28
0
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')
コード例 #29
0
# 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.yui3 as yui3

from steelscript.appresponse.appfwk.datasources.appresponse import \
    AppResponseTable, AppResponseTimeSeriesTable

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

report.add_section()

t = AppResponseTable.create('wta-base', source='aggregates')
t.add_column('start_time',
             'Time',
             datatype='time',
             iskey=True,
             extractor='start_time')
t.add_column('page_family_id',
             'Web Page Family ID',
             datatype='string',
             iskey=True,
             extractor='web.page.family.id')
t.add_column('page_family_name',
             'Web Page Family Name',
             datatype='string',
             extractor='web.page.family.name')
コード例 #30
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,
コード例 #31
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.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) 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.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')
コード例 #33
0
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
コード例 #34
0
from steelscript.steelhead.appfwk.datasources.steelhead import \
    BatchSteelHeadTable

description = """
<div style="width:500px">
<p>This example report runs a command against a group of steelheads with
same tag. Command examples include:

<p style="margin-left: 40px"><strong>show version</strong>
<p style="margin-left: 40px"><strong>show interfaces</strong>
<p style="margin-left: 40px"><strong>show flows</strong>
<p style="margin-left: 40px"><strong>show stats bandwidth all
bi-directional 5min</strong>

</div>
"""

report = Report.create("SteelHead Batch Report", description=description)

report.add_section()

t = BatchSteelHeadTable.create('batch-steelhead', cacheable=False)

report.add_widget(tables.TableWidget,
                  t,
                  'batch-sh',
                  width=12,
                  height=0,
                  searching=True)
コード例 #35
0
from django import forms

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 Pre Process')

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

TableField.create('choices',
                  'Choices',
                  section,
                  field_cls=forms.ChoiceField,
                  pre_process_func=Function(funcs.preprocess_field_choices))

TableField.create('choices_with_params',
                  'Choices with params',
                  section,
                  field_cls=forms.ChoiceField,
                  pre_process_func=Function(
                      funcs.preprocess_field_choices_with_params,
                      params={
                          'start': 1,
                          'end': 3,
                          'prefix': 'pre'
                      }))
コード例 #36
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)
コード例 #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.datasource.models import TableField
from steelscript.appfwk.apps.report.models import Report
import steelscript.appfwk.apps.report.modules.yui3 as yui3

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'])
コード例 #38
0
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')
# 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.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 UC Overall")

report.add_section()

# t1 is used to derive the overall metrics over the duration
t1 = AppResponseTable.create('uc-overall', source='aggregates')
t1.add_column('media_type', 'Media Type ID', datatype='string', iskey=True,
              extractor='rtp.media_type')
t1.add_column('media_type_name', 'Media Type Name', datatype='string',
              extractor='rtp.media_type_name')
t1.add_column('packets', 'Number of RTP Packets', datatype='integer',
              extractor='sum_rtp.packets')
t1.add_column('bytes', 'Number of RTP Bytes',
              datatype='integer', extractor='sum_rtp.traffic_bytes')

# t2 is used to derive the time series metrics values over the duration
コード例 #40
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 \
    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')
コード例 #41
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)
コード例 #42
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)
コード例 #43
0
    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)
コード例 #44
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.tables as tables
from steelscript.appresponse.appfwk.datasources.appresponse import \
    AppResponseTable, AppResponseScannerTable

report = Report.create("AppResponse Packets - Search Capture Jobs",
                       hidden_fields=[
                           'appresponse_device', 'appresponse_source',
                           'entire_pcap', 'granularity'
                       ],
                       field_order=['endtime', 'duration'])

report.add_section()

# Create base table
base = AppResponseTable.create(name='ar_bytes', include_filter=True)
base.add_column('total_bytes',
                label='Bytes',
                iskey=False,
                extractor='sum_traffic.total_bytes')

# Make
table = AppResponseScannerTable.create(name='ars', basetable=base)
table.add_column('name', "Name", datatype='string')
table.add_column('host', "Host", datatype='string')
コード例 #45
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.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'])
コード例 #46
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.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)
コード例 #47
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

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)
コード例 #48
0
    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)
# Copyright (c) 2018 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

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

report.add_section()

# TCP Errors
p = AppResponseTable.create('TCPErrors',
                            duration='1 min',
                            granularity='1s',
                            include_files=True)

p.add_column('error_type',
             label='TCP Error Type',
             iskey=True,
             datatype='string',
             extractor='tcp.error_type',
コード例 #50
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 SQL Overall")

report.add_section()

# t1 is used to derive the overall metrics over the duration
t1 = AppResponseTable.create('sql-overall', source='sql_summaries')
t1.add_column('db_process',
              'Client Process Name',
              datatype='string',
              iskey=True,
              extractor='db.process_name')
t1.add_column('sql_duration',
              'Average Transaction Time',
              datatype='float',
              extractor='avg_sql.duration')
t1.add_column('sql_packets',
コード例 #51
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

#
# 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)
コード例 #52
0
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)
コード例 #53
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.c3 as c3
import steelscript.appfwk.apps.report.modules.tables as tables
from steelscript.appfwk.apps.datasource.modules import alerting

report = Report.create('App Framework Alerts', position=11)

report.add_section()

atable = alerting.AlertHyperlinkedTable.create('Appfwk Alerts')
atable.add_column('timestamp',
                  'Timestamp',
                  datatype='time',
                  iskey=True,
                  sortdesc=True)
atable.add_column('id', 'ID', datatype='html')
atable.add_column('eventid', 'Event ID', datatype='html')
atable.add_column('level', 'Level', datatype='string')
atable.add_column('severity', 'Severity', datatype='integer')
atable.add_column('sender', 'Sender', datatype='string')
atable.add_column('options', 'Dest Options', datatype='html')
atable.add_column('message', 'Message', datatype='string')

report.add_widget(tables.TableWidget, atable, 'App Framework Alerts', width=12)
コード例 #54
0
<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
# 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

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

report = Report.create("Business Hour Reporting - By Application",
                       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-byapp',
                                                       groupby='application',
                                                       duration=60,
                                                       resolution=3600,
                                                       interface=True)