def row_load(host, cpu_count): title = 'Load' row = new_row(title) for kind in [1, 5, 15]: add_panel(row, panel_load_kind(host, kind, cpu_count)) return row
def row_memory(host): title = 'Memory' row = new_row(title) for metric in DEFAULT_METRICS: add_panel(row, panel_memory(host, [metric], width=3)) return row
def row_host_metadata(host, hostvars): title = 'Metadata' row = new_row(title) add_panel(row, panel_host_metadata_text(host, hostvars, width=3)) add_panel(row, panel_host_metadata_links(host, hostvars, width=9)) return row
def row_cpu(host): title = 'CPU' row = new_row(title) width = 3 for kind in KINDS: add_panel(row, panel_cpu(host, title=kind, kinds=[kind], width=width)) return row
def row_website_timing_per_status(host, engine, website, aspect): title = '%s %s timing per status' % (website, ' (' + aspect + ')' if aspect else '') row = new_row(title) width = 3 metric_base = web_metric_base(engine, website, aspect) for status in STATUSES: add_panel(row, panel_website_timing_per_status(host, metric_base, status[0], status[1], width=width)) return row
def row_website_timing_per_method(host, engine, website, aspect): title = '%s %s timing per method' % (website, ' (' + aspect + ')' if aspect else '') row = new_row(title) width = 3 metric_base = web_metric_base(engine, website, aspect) for method in METHODS: add_panel( row, panel_website_timing_per_method_detailed(host, metric_base, method, width=width)) return row
def row_website_ssl(host, engine, website, aspect): title = '%s %s SSL' % (website, ' (' + aspect + ')' if aspect else '') row = new_row(title) width = 4 metric_base = web_metric_base(engine, website, aspect) for aspect in [ 'Protocol', 'Ciphersuite', 'Client Serial', ]: add_panel(row, panel_website_ssl(host, aspect, metric_base, width=width)) return row
def row_hp_printer_overview(host): width = 3 row = new_row('Overview', collapsed=False) add_panel(row, panel_ready(host, width=width)) add_panel(row, panel_equivalent_a4_impressions(host, width=width)) add_panel(row, panel_impressions(host, width=width)) add_panel(row, panel_sources(host, width=width)) return row
def row_overview(host, cpu_count=False, collapsed=None, repeat=None): title = 'Performance Characteristics' row = new_row(title, collapsed=collapsed, repeat=repeat) width = 3 add_panel(row, panel_load(host, width=width, cpu_count=cpu_count)) add_panel(row, panel_cpu(host, width=width)) add_panel(row, panel_memory(host, width=width)) add_panel(row, panel_network_bytes(host, width=width, title='Network')) return row
def row_sensors(host): title = 'Hardware sensors' row = new_row(title) width = 3 add_panel(row, panel_bus(host, width=width)) add_panel(row, panel_sensor_group(host, title='Temperature', group='temp', unit='celsius', width=width)) add_panel(row, panel_sensor_group(host, title='Cooling', group='fan', unit='rotrpm', width=width)) add_panel(row, panel_sensor_group(host, title='Voltage', group='voltage', unit='volt', width=width)) return row
def row_website_status_details(host, engine, website, aspect): title = '%s %s status details' % (website, ' (' + aspect + ')' if aspect else '') row = new_row(title) width = 3 metric_base = web_metric_base(engine, website, aspect) for status in STATUSES + [ ('*', None), ]: add_panel( row, panel_website_requests_per_status(host, metric_base, status[0], status[1], width=width)) return row
def row_website_volume_kpi(host, engine, website, aspect): title = '%s %s volume KPI' % ( website, (' (' + aspect + ')') if aspect else '') row = new_row(title) width=3 metric_base = web_metric_base(engine, website, aspect) add_panel(row, panel_website_requests_total(host, metric_base, width=width)) add_panel(row, panel_website_requests_per_status_group(host, metric_base, width=width)) add_panel(row, panel_website_requests_per_method(host, metric_base, width=width)) add_panel(row, panel_website_requests_per_user(host, metric_base, width=width)) return row
def row_library(title, library): row = new_row(title) add_panel(row, panel_library_next_due_date(library)) add_panel(row, panel_library_lent_items_total(library)) add_panel(row, panel_library_lent_items_categories(library)) return row
def row_log_file_custom(host, log_file): row = new(host, log_file) base = metric_base(log_file) add_panel(row, panel_count(host, base, width=4)) add_panel(row, panel_count(host, base, kinds=['failword.*'], by='Failword', width=4)) add_panel(row, panel_length_average(host, base, width=4)) return row
def row_phone(title, phone): row = new_row(title) add_panel(row, panel_phone_credit_use(phone)) add_panel(row, panel_phone_credit_left(phone)) add_panel(row, panel_phone_days_until_deactivation(phone)) return row
def row_processes(host): title = 'Processes' row = new_row(title) width=4 add_panel(row, panel_processes(host, total=False, width=width)) add_panel(row, panel_processes(host, running=False, width=width)) add_panel(row, panel_processes(host, width=width)) return row
def row_graphite(host): title = 'Graphite' row = new_row(title) width = 4 add_panel(row, panel_graphite_cache(host, width=width)) add_panel(row, panel_graphite_updates(host, width=width)) add_panel(row, panel_graphite_monitors(host, width=width)) return row
def row_network(host): title = 'Network' row = new_row(title) width = 4 add_panel(row, panel_network_bytes(host, width=width)) add_panel(row, panel_network_packets(host, width=width)) add_panel(row, panel_network_drop_and_errors(host, width=width)) return row
def row_hp_printer_supply(host, title, supply=None, collapsed=None, percent=True, pages=True): alias = None if supply is None: supply = title.lower().replace(' ', '_') elif supply == '*': alias = [-2] metric_base = 'jetdirect.supply.%s' % (supply) width = 3 row = new_row('Supply: %s' % title, collapsed=collapsed) add_panel(row, panel_supply_ready(host, title, metric_base, width, alias)) if percent: add_panel(row, panel_supply_percent_remaining(host, title, metric_base, width, alias)) if pages: add_panel(row, panel_supply_pages_printed(host, title, metric_base, width, alias)) add_panel(row, panel_supply_pages_remaining(host, title, metric_base, width, alias)) return row
def row_log_file_python(host, log_file): row = new(host, log_file) base = metric_base(log_file) add_panel( row, panel_count(host, base, kinds=['level.CRITICAL', 'level.ERROR'], prefix='CRICITAL/ERROR', width=3)) add_panel(row, panel_count(host, base, kinds=['level.*'], by='Level', width=3)) add_panel( row, panel_count(host, base, kinds=['source.*'], by='Source', width=3)) add_panel( row, panel_count(host, base, kinds=['failword.*'], by='Failword', width=3)) return row
def row_website_timing_kpi(host, engine, website, aspect): title = '%s %s timing KPI' % (website, ' (' + aspect + ')' if aspect else '') row = new_row(title) width = 4 metric_base = web_metric_base(engine, website, aspect) add_panel(row, panel_website_timing_total(host, metric_base, width=width)) add_panel( row, panel_website_timing_per_status_group(host, metric_base, width=width)) add_panel(row, panel_website_timing_per_method(host, metric_base, width=width)) return row
def row_apache(host, websites): title = 'Apache' row = new_row(title) width = 4 add_panel(row, panel_apache_workers_basic(host, width=width)) add_panel(row, panel_apache_throughput(host, width=width)) add_panel(row, panel_apache_connections(host, width=width)) add_panel(row, panel_apache_scorecard(host, width=width)) add_panel(row, panel_website_total_requests(host, 'apache', width=width)) add_panel(row, panel_websites(host, websites, width=width)) return row
def row_disk(host): title = 'Disk I/O' row = new_row(title) width = 4 add_panel(row, panel_diskspace_bytes(host, width=width)) add_panel(row, panel_diskspace_percent(host, width=width)) add_panel(row, panel_iostat_queue_length(host, width=width)) add_panel(row, panel_iostat_iops(host, width=width)) add_panel(row, panel_iostat_throughput(host, width=width)) add_panel(row, panel_iostat_waiting(host, width=width)) return row