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_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_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_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_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_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_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_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
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_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_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_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_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 new(host, log_file): row = new_row(log_file['description']) set_weight(row, log_file['slug']) return row