コード例 #1
0
#

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)

# Define a Pie Chart for top ports
p = NetProfilerGroupbyTable.create('ports-bytes',
                                   groupby='port_group',
                                   duration=60)

p.add_column('portgroup', 'Port Group', iskey=True)
p.add_column('avg_bytes', 'Avg Bytes/s', units='B/s', sortdesc=True)
コード例 #2
0
# Overall section
#  - netprofiler_filterexpr = "interface {interface}"
#
section = report.add_section("Overall",
                             section_keywords=['netprofiler_filterexpr',
                                               'interface_expr'])

section.fields.add(netprofiler_filterexpr)
section.fields.add(interface_field)

NetProfilerTable.extend_filterexpr(section, keyword='interface_filterexpr',
                                   template='interface {interface}')

# Define a Overall TimeSeries showing In/Out Utilization
p = NetProfilerTimeSeriesTable.create('qos-overall-util',
                                      duration=15, resolution=60,
                                      interface=True)

p.add_column('time', 'Time', datatype='time', iskey=True)
p.add_column('in_avg_util', 'Avg Inbound Util %', units='B/s')
p.add_column('out_avg_util', 'Avg Outbound Util %', units='B/s')

report.add_widget(c3.TimeSeriesWidget, p, "{interface} - Overall Utilization",
                  width=12)

# Define a Overall TimeSeries showing In/Out Totals
p = NetProfilerTimeSeriesTable.create('qos-overall-total',
                                      duration=15, resolution=15 * 60,
                                      interface=True)

p.add_column('time', 'Time', datatype='time', iskey=True)
コード例 #3
0
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,
                   params={'column': 'avg_bytes',
                           'std': 2})
a.add_destination(
    'LoggingSender',
    options={'level': 'info'},
    template='Logging Local Spike: time - {time}, value - {avg_bytes}'
コード例 #4
0
# Overall section
#  - netprofiler_filterexpr = "interface {interface}"
#
section = report.add_section("Overall",
                             section_keywords=['netprofiler_filterexpr',
                                               'interface_expr'])

section.fields.add(netprofiler_filterexpr)
section.fields.add(interface_field)

NetProfilerTable.extend_filterexpr(section, keyword='interface_filterexpr',
                                   template='interface {interface}')

# Define a Overall TimeSeries showing In/Out Utilization
p = NetProfilerTimeSeriesTable.create('qos-overall-util',
                                      duration=15, resolution=60,
                                      interface=True)

p.add_column('time', 'Time', datatype='time', iskey=True)
p.add_column('in_avg_util', 'Avg Inbound Util %', units='B/s')
p.add_column('out_avg_util', 'Avg Outbound Util %', units='B/s')

report.add_widget(yui3.TimeSeriesWidget, p, "{interface} - Overall Utilization", width=12)

# Define a Overall TimeSeries showing In/Out Totals
p = NetProfilerTimeSeriesTable.create('qos-overall-total',
                                      duration=15, resolution=15 * 60,
                                      interface=True)

p.add_column('time', 'Time', datatype='time', iskey=True)
p.add_column('in_total_bytes', 'Total Inbound Bytes', units='B/s')
コード例 #5
0
#
# 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)

# Define a Pie Chart for top ports
p = NetProfilerGroupbyTable.create('ports-bytes',
                                   groupby='port_group', duration=60)

p.add_column('portgroup', 'Port Group', iskey=True)
p.add_column('avg_bytes', 'Avg Bytes/s', units='B/s', sortdesc=True)

report.add_widget(c3.PieWidget, p, "Port Groups by Avg Bytes")
コード例 #6
0
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
# to the last defined Section, here that will be 'Locations'
report.add_widget(maps.MapWidget, p, "Response Time", width=6, height=300)
report.add_widget(yui3.TableWidget, p, "Locations by Response Time", width=6)

# Define a Overall TimeSeries showing Avg Bytes/s
report.add_section('NetProfiler Overall',
                   section_keywords=['resolution', 'duration'])

p = NetProfilerTimeSeriesTable.create('ts1', duration=1440, resolution='15min')

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

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

# NetShark Time Series
section = report.add_section('NetShark Traffic',
                             section_keywords=['resolution', 'duration'])

shark = NetSharkTable.create('Total Traffic Bits',
                             duration=15,
コード例 #7
0
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')

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

# Define a Pie Chart for locations
p = NetProfilerGroupbyTable.create('util-table',
                                   groupby='interface',
                                   duration=60)
コード例 #8
0
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,
                   params={
                       'column': 'avg_bytes',
                       'std': 2
                   })
a.add_destination(
コード例 #9
0
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
# to the last defined Section, here that will be 'Locations'
report.add_widget(c3.BarWidget, p, "Response Time", width=6, height=300)
report.add_widget(tables.TableWidget, p, "Locations by Response Time", width=6,
                  info=False, paging=False, searching=False)

# Define a Overall TimeSeries showing Avg Bytes/s
report.add_section('NetProfiler Overall',
                   section_keywords=['resolution', 'duration'])

p = NetProfilerTimeSeriesTable.create('ts1', duration=1440, resolution='15min')

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

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

# NetShark Time Series
section = report.add_section('NetShark Traffic',
                             section_keywords=['resolution', 'duration'])

shark = NetSharkTable.create('Total Traffic Bits', duration=15,
                             resolution='1sec', aggregated=False)

shark.add_column('time', extractor='sample_time', iskey=True,
コード例 #10
0
# 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)

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

report.add_widget(c3.TimeSeriesWidget, p, "Bandwidth for tcp/80", altaxis=["avg_bytes_rtx"])