Index: html/images/apps/speedtest.png =================================================================== Kann nicht anzeigen: Dateityp ist als binär angegeben. svn:mime-type = application/octet-stream Property changes on: html/images/apps/speedtest.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: html/images/apps/speedtest_x2.png =================================================================== Kann nicht anzeigen: Dateityp ist als binär angegeben. svn:mime-type = application/octet-stream Property changes on: html/images/apps/speedtest_x2.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: html/includes/graphs/application/speedtest_download.inc.php =================================================================== --- html/includes/graphs/application/speedtest_download.inc.php (nicht existent) +++ html/includes/graphs/application/speedtest_download.inc.php (Arbeitskopie) @@ -0,0 +1,39 @@ +<?php + +/** + * Observium + * + * This file is part of Observium. + * + * @package observium + * @subpackage graphs + * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited + * + */ + +$scale_min = 0; + +include_once($config['html_dir']."/includes/graphs/common.inc.php"); + +$speedtest_rrd = get_rrd_path($device, "app-speedtest-".$app['app_id'].".rrd"); + +if (is_file($speedtest_rrd)) +{ + $rrd_filename = $speedtest_rrd; +} + +$ds = "download"; + +$colour_area = "CDEB8B"; +$colour_line = "006600"; + +$colour_area_max = "FFEE99"; + +$graph_max = 1; +$multiplier = 0; + +$unit_text = "bps"; + +include($config['html_dir']."/includes/graphs/generic_simplex.inc.php"); + +// EOF Index: html/includes/graphs/application/speedtest_jitter.inc.php =================================================================== --- html/includes/graphs/application/speedtest_jitter.inc.php (nicht existent) +++ html/includes/graphs/application/speedtest_jitter.inc.php (Arbeitskopie) @@ -0,0 +1,39 @@ +<?php + +/** + * Observium + * + * This file is part of Observium. + * + * @package observium + * @subpackage graphs + * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited + * + */ + +$scale_min = 0; + +include_once($config['html_dir']."/includes/graphs/common.inc.php"); + +$speedtest_rrd = get_rrd_path($device, "app-speedtest-".$app['app_id'].".rrd"); + +if (is_file($speedtest_rrd)) +{ + $rrd_filename = $speedtest_rrd; +} + +$ds = "jitter"; + +$colour_area = "CDEB8B"; +$colour_line = "006600"; + +$colour_area_max = "FFEE99"; + +$graph_max = 1; +$multiplier = 0; + +$unit_text = "ms"; + +include($config['html_dir']."/includes/graphs/generic_simplex.inc.php"); + +// EOF Index: html/includes/graphs/application/speedtest_latency.inc.php =================================================================== --- html/includes/graphs/application/speedtest_latency.inc.php (nicht existent) +++ html/includes/graphs/application/speedtest_latency.inc.php (Arbeitskopie) @@ -0,0 +1,39 @@ +<?php + +/** + * Observium + * + * This file is part of Observium. + * + * @package observium + * @subpackage graphs + * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited + * + */ + +$scale_min = 0; + +include_once($config['html_dir']."/includes/graphs/common.inc.php"); + +$speedtest_rrd = get_rrd_path($device, "app-speedtest-".$app['app_id'].".rrd"); + +if (is_file($speedtest_rrd)) +{ + $rrd_filename = $speedtest_rrd; +} + +$ds = "latency"; + +$colour_area = "CDEB8B"; +$colour_line = "006600"; + +$colour_area_max = "FFEE99"; + +$graph_max = 1; +$multiplier = 0; + +$unit_text = "ms"; + +include($config['html_dir']."/includes/graphs/generic_simplex.inc.php"); + +// EOF Index: html/includes/graphs/application/speedtest_upload.inc.php =================================================================== --- html/includes/graphs/application/speedtest_upload.inc.php (nicht existent) +++ html/includes/graphs/application/speedtest_upload.inc.php (Arbeitskopie) @@ -0,0 +1,39 @@ +<?php + +/** + * Observium + * + * This file is part of Observium. + * + * @package observium + * @subpackage graphs + * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited + * + */ + +$scale_min = 0; + +include_once($config['html_dir']."/includes/graphs/common.inc.php"); + +$speedtest_rrd = get_rrd_path($device, "app-speedtest-".$app['app_id'].".rrd"); + +if (is_file($speedtest_rrd)) +{ + $rrd_filename = $speedtest_rrd; +} + +$ds = "upload"; + +$colour_area = "CDEB8B"; +$colour_line = "006600"; + +$colour_area_max = "FFEE99"; + +$graph_max = 1; +$multiplier = 0; + +$unit_text = "bps"; + +include($config['html_dir']."/includes/graphs/generic_simplex.inc.php"); + +// EOF Index: html/pages/device/apps/speedtest.inc.php =================================================================== --- html/pages/device/apps/speedtest.inc.php (nicht existent) +++ html/pages/device/apps/speedtest.inc.php (Arbeitskopie) @@ -0,0 +1,21 @@ +<?php + +/** + * Observium Network Management and Monitoring System + * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org + * + * @package observium + * @subpackage applications + * @author Adam Armstrong <adama@observium.org> + * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited + * + */ + +$app_graphs['default'] = array( + 'speedtest_download' => 'Download Bandwidth', + 'speedtest_upload' => 'Upload Bandwidth', + 'speedtest_jitter' => 'Jitter', + 'speedtest_latency' => 'Latency', + ); + +// EOF Index: includes/definitions/apps.inc.php =================================================================== --- includes/definitions/apps.inc.php (Revision 10344) +++ includes/definitions/apps.inc.php (Arbeitskopie) @@ -50,4 +50,5 @@ $config['app']['mongodb']['top'] = array('commands', 'queue', 'mem', 'network'); $config['app']['ceph']['top'] = array('osd', 'iops', 'speed'); $config['app']['icecast']['top'] = array('current', 'max'); +$config['app']['speedtest']['top'] = array('download', 'upload', 'jitter', 'latency'); // EOF Index: includes/definitions/rrdtypes.inc.php =================================================================== --- includes/definitions/rrdtypes.inc.php (Revision 10344) +++ includes/definitions/rrdtypes.inc.php (Arbeitskopie) @@ -2150,4 +2150,15 @@ ), ); +// Speedtest +$config['rrd_types']['speedtest'] = array( + 'file' => 'app-speedtest-%index%.rrd', + 'ds' => array( + 'download' => array('type' => 'GAUGE', 'min' => 0), + 'upload' => array('type' => 'GAUGE', 'min' => 0), + 'jitter' => array('type' => 'GAUGE', 'min' => 0), + 'latency' => array('type' => 'GAUGE', 'min' => 0), + ), +); + // EOF Index: includes/polling/applications/speedtest.inc.php =================================================================== --- includes/polling/applications/speedtest.inc.php (nicht existent) +++ includes/polling/applications/speedtest.inc.php (Arbeitskopie) @@ -0,0 +1,37 @@ +<?php + +/** + * Observium + * + * This file is part of Observium. + * + * @package observium + * @subpackage poller + * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited + * + */ + +if (!empty($agent_data['app']['speedtest'])) +{ + $app_id = discover_app($device, 'speedtest'); + + list ($download, $upload, $jitter, $latency) = explode("\n", $agent_data['app']['speedtest']); + + update_application($app_id, array( + 'download' => $download, + 'upload' => $upload, + 'jitter' => $jitter, + 'latency' => $latency, + )); + + rrdtool_update_ng($device, 'speedtest', array( + 'download' => $download, + 'upload' => $upload, + 'jitter' => $jitter, + 'latency' => $latency, + ), $app_id); + + unset($app_id, $download, $upload, $jitter, $latency); +} + +// EOF Index: scripts/agent-local/speedtest =================================================================== --- scripts/agent-local/speedtest (nicht existent) +++ scripts/agent-local/speedtest (Arbeitskopie) @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +print('<<<app-speedtest>>>') + +import json + +with open('/tmp/speedtest.json') as f: + data = json.load(f) + +#print download +print(str(data['download']['bandwidth']*8)); + +#print upload +print(str(data['upload']['bandwidth']*8)); + +#print jitter +print(str(data['ping']['jitter'])); + +#print latency +print(str(data['ping']['latency'])); Property changes on: scripts/agent-local/speedtest ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property