Commit 40a7ccf3 authored by Olav Kvittem's avatar Olav Kvittem

added scripts to check open ports for https/iperf and make mp_list_iperf.json

parent 7e9cf340
......@@ -6,7 +6,7 @@ a purely web-based performace tool called yt.
# Install
cd /var/www # or equivalent web root
Just clone the directory into a web-server
git@scm.uninett.no:olav.kvittem/mp-web.git
git clone https://scm.uninett.no/olav.kvittem/mp-web.git
You need the stylesheet boostrap from the root of the web : /uninett-bootstrap-theme
git clone https://github.com/andreassolberg/uninett-bootstrap-theme.git
......@@ -28,5 +28,5 @@ Components of this software like Highsofts HighChart is
not free for commercial use.
http://shop.highsoft.com/faq/non-commercial.
Jquery licence can be found at https://jquery.org/license/.
DataTabless license is at http://www.datatables.net/license/bsd
DataTables license is at http://www.datatables.net/license/bsd
var mp_url="../mp_list.json";
// webinterface to run iperf sessions and present graphical results
var mp_url="../mp_list_iperf.json";
var graf_no=0;
var x_name=[]; // the name of hops in tooltip
......
......@@ -5,3 +5,4 @@ wget -q -O mp_list.new https://kind.uninett.no/autoregister/utstyr_mp.json
if test -s mp_list.new ; then
mv mp_list.new mp_list.json
fi
#!/bin/sh
# get list om measurement beacons
# to be run i n the directory where the data is
perl mp_list_name.pl $1 | xargs nmap -sT -p 80,443,5001 > mp_list_nmap.log
perl mp_list_nmap_rep.pl -json mp_list_nmap.log > mp_list_iperf.new
if test -s mp_list_iperf.new ; then
mv mp_list_iperf.new mp_list_iperf.json
fi
#! /usr/bin/perl
#
use JSON;
my $mp_file=shift;
open(MP, "<$mp_file") || die "Could not open $mp_file";
my $mp_lines=<MP>;
my $mp_list=from_json($mp_lines);
foreach $mp(@$mp_list){
printf "%s\n", $mp->{navn};
}
#!/usr/bin/perl
$usage = "What: read nmap log and produce on option
usage: $0 <options>..
-report list status for all port
-json file name - list host-names in json format.";
use JSON;
use Getopt::Long;
my %portstate=();
my $name='';
my @names=();
my $opt_report;
my $opt_json;
GetOptions( "report" => \$opt_report, "json=s" => \$opt_json) || die $usage;
while(<>){
if (/report for ([^ ]+)/){
$name=$1;
push (@report, sprintf "\n%-25s ", $name);
} elsif (/^(\d+)\/[^\s]+\s+([^\s]+)\s+/){
push (@report, sprintf "%10s ", $2);
$portstate{$1}=$2;
} elsif (/^$/){ # empty line before and after each host entry
if ( $portstate{'443'} eq "open" && $portstate{'5001'} eq "open" ){
push( @names, {navn=>$name} );
}
%portstate=();
}
}
if ( $opt_report ){
printf "\n%-25s %10s %10s %10s\n", "maskin", "80", "443", "5001" ;
print @report;
printf "\n";
}
if ( $opt_json && $#names >= 0 ){
open JF, ">", $opt_json || die "could not open $opt_json";
print JF encode_json \@names;
close JF;
}
#! /usr/bin/perl
#
# Deliver an amount of data for perfomance testing
# Deliver an amount of data for performance testing
# Olav Kvittem ( Olav.Kvittem@uninett.no )
#
# use CGI;
use Time::HiRes qw(tv_interval gettimeofday);
use CGI qw/:standard -debug/;
my $q = CGI->new;
......@@ -35,14 +38,14 @@ if ( 0 && $q->http('HTTP_X_TOKEN') ne "virre-virre-vapp" ){
open DATA, "<", $testfile || error("Could not open test file : $testfile : $!");
my $data=<DATA>;
my $datasent=0;
my $start=time;
my $start=[gettimeofday];
syswrite STDOUT, $q->header('application/binary');
printf STDERR "bytes %d duration %d sec\n", $bytes, $duration;
# printf STDERR "bytes %d duration %d sec\n", $bytes, $duration;
while ( $datasent < $bytes && ( (time-$start) < $duration ) ){
syswrite STDOUT, $data;
$datasent+=length($data);
printf STDERR "data sent %d time %d sec\n", $datasent, time-$start;
printf STDERR "data sent %d time %d sec\n", $datasent, tv_interval ($start);
}
......
......@@ -4,7 +4,7 @@
var opera=navigator.userAgent.match(/^Opera/) != null;
var firefox=navigator.userAgent.match(/Firefox/) != null;
var min_test_length= 0.5; // minimum testing period seconds
var min_test_length= 5; // minimum testing period seconds
var min_progress_interval = 20; // min interval to be used for estimates
var test_period=10000; // interrup test after ms
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment