-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph-onboarding
executable file
·33 lines (32 loc) · 1.17 KB
/
graph-onboarding
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#
# graph-onboarding <process-tcp> <process-report> <process-notification-log> "title"
#
# - process-tcp time,date,SYN,SYNACK,FIN
# - process-report
# - process-notification time,date,conn,disconn,decrypt_fail,other,200,400,408
#
traffic_file=$1
recording=$2
service=$3
title=$4
(
echo "set terminal png size 1000,600"
echo "set multiplot layout 2,1"
echo "set datafile separator \",\""
echo "set xlabel \"Time Elapsed\""
echo "set ylabel \"Connections\""
# echo "set boxwidth 1.0"
echo "set xdata time"
echo "set timefmt \"%s\""
echo "set format x \"%H:%M\"" # or anything else
echo "set title \"$title\""
echo "plot \"$traffic_file\" using 1:3 t \"SYN/s\" w boxes fill solid 1.0, \\"
echo " '' using 1:4 t \"SYN-ACK/s\" w boxes fill solid 1.0, \\"
echo " '' using 1:5 t \"FIN/s\" w boxes, \\"
echo " \"$recording\" using 1:16 t \"ESTABLISHED\" w linespoint, \\"
echo " \"$service\" using 1:3 t \"Connections\" w boxes fill solid 1.0, \\"
echo " '' using 1:4 t \"Disconnects/s\" w boxes fill solid 1.0"
echo "set ylabel \"MB\""
echo "plot \"$recording\" using 1:(\$13 / 1024) t \"RSS\" w linespoint"
) | gnuplot > combi-${traffic_file}.png