mirror of
https://github.com/moexe/FFFGateway-Monitoring.git
synced 2026-02-05 22:55:11 +01:00
* Speedtest raus genommen
* Anzahl der Clients in has und has-sued als Gnuplot !!!! gnuplot installieren !!!! * Anzahl und Auflisten der fastd und l2tp Router
This commit is contained in:
24
sensors/clients.pl
Executable file
24
sensors/clients.pl
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/gnuplot
|
||||
reset
|
||||
#set terminal png
|
||||
set terminal png size 800,400 font ",10"
|
||||
set output '/var/www/html/has-mon/img/clients.png'
|
||||
set xdata time
|
||||
set timefmt "%Y:%m:%d:%H:%M:%S"
|
||||
set format x "%H:%M"
|
||||
#set xlabel "time"
|
||||
|
||||
set ylabel "Clients"
|
||||
set yrange [0:670]
|
||||
|
||||
#set title "Clients "
|
||||
#set key center bmargin font ",10"
|
||||
set key horizontal reverse samplen 1 width -1 maxrows 1
|
||||
set grid
|
||||
|
||||
set style data lines
|
||||
|
||||
plot "/var/www/html/has-mon/data/clients.dat" using 1:2 title "ges", \
|
||||
"" using 1:3 title "Hassberge", \
|
||||
"" using 1:4 title "Hassberge Sued", \
|
||||
#
|
||||
17
sensors/clients.sh
Executable file
17
sensors/clients.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
#get the file from has2
|
||||
wget -O /tmp/clients http://5.189.166.50/test.html
|
||||
|
||||
date=$(date +%Y:%m:%d:%H:%M:%S)
|
||||
|
||||
all=$(grep Clients /tmp/clients | cut -f 2 -d" " | cut -f1 -d"<")
|
||||
has=$(grep Hassberge: /tmp/clients | cut -f 2 -d" " | cut -f1 -d"<")
|
||||
sued=$(grep Sued /tmp/clients | cut -f 3 -d" " | cut -f1 -d"<")
|
||||
|
||||
echo "$date $all $has $sued" >> /var/www/html/has-mon/data/clients.dat
|
||||
# dat länge begrenzen
|
||||
tail -450 /var/www/html/has-mon/data/clients.dat > /tmp/clients.dat
|
||||
grep -v ^$ /tmp/clients.dat > /var/www/html/has-mon/data/clients.dat
|
||||
|
||||
/var/www/html/has-mon/sensors/clients.pl
|
||||
8
sensors/fastd-routers.sh
Executable file
8
sensors/fastd-routers.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
port=10001
|
||||
hood=hbergsued
|
||||
|
||||
for ip in $(tcpdump -n -i eth0 udp port $port -c 500 2>/dev/null | cut -f 3 -d " " | sort -n | uniq | grep -v 1000 | cut -f 1-4 -d .); do
|
||||
grep -3 $ip /etc/fastd/fff.$hood/peers/* | grep name | cut -f2 -d\"
|
||||
done | grep -v netmon
|
||||
@@ -4,9 +4,11 @@
|
||||
|
||||
|
||||
ips=$(ip l2 s tunnel | awk '/From/ {print $4}')
|
||||
journalctl -u tunneldigger-broker-sued.service > /tmp/td.log
|
||||
#journalctl -u tunneldigger-broker-sued.service > /tmp/td.log
|
||||
cat /var/log/syslog /var/log/syslog.1 | grep tunneldigger | grep Creating > /tmp/td.log
|
||||
zcat /var/log/syslog.?.gz | grep tunneldigger | grep Creating >> /tmp/td.log
|
||||
for ip in $ips; do
|
||||
rname="$rname$(grep $ip /tmp/td.log | awk '/Creating/ {gsub ("\\(","");gsub ("\\)",""); print $10"\\n"}')"
|
||||
done
|
||||
|
||||
echo -e $rname | grep -v ^" " | uniq | sort -f
|
||||
echo -e $rname | grep -v ^" " | uniq | sort -f | uniq
|
||||
|
||||
Reference in New Issue
Block a user