To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit c2365475 authored by Reto Da Forno's avatar Reto Da Forno

config updated and new scripts added

parent 60119ff3
#flocklab-time.ethz.ch -> changed to time.ethz.ch
#server time.ethz.ch minpoll 5 maxpoll 6
#server 0.ch.pool.ntp.org minpoll 5 maxpoll 6
server 129.132.177.101 minpoll 5 maxpoll 6 server 129.132.177.101 minpoll 5 maxpoll 6
server 129.132.2.21 minpoll 5 maxpoll 6
server 129.132.2.22 minpoll 5 maxpoll 6
server time.ethz.ch minpoll 5 maxpoll 6
server time1.ethz.ch minpoll 5 maxpoll 6
server time2.ethz.ch minpoll 5 maxpoll 6
driftfile /media/card/log/chrony/chrony.drift driftfile /media/card/log/chrony/chrony.drift
fallbackdrift 16 19 fallbackdrift 16 19
keyfile /etc/chrony.keys keyfile /etc/chrony.keys
...@@ -11,11 +13,9 @@ dumpdir /media/card/log/chrony ...@@ -11,11 +13,9 @@ dumpdir /media/card/log/chrony
logdir /media/card/log/chrony logdir /media/card/log/chrony
log measurements statistics tracking rtc refclocks tempcomp log measurements statistics tracking rtc refclocks tempcomp
logchange 0.5 logchange 0.5
#initstepslew 2 time.ethz.ch
initstepslew 2 129.132.177.101 initstepslew 2 129.132.177.101
makestep 1000 10 makestep 1000 10
cmdallow 127.0.0.1 cmdallow 127.0.0.1
rtcfile /media/card/log/chrony/chrony.rtc rtcfile /media/card/log/chrony/chrony.rtc
#rtcsync
rtconutc rtconutc
#!/bin/sh
# Copyright (C) 2018 Jan Beutel
#
# rdaforno
#210 Number of sources = 3
#Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev
#==============================================================================
#PPS0 49 25 770 0.000 0.001 +0ns 672ns
#time1.ethz.ch 21 9 43m 0.004 0.017 -78us 16us
#time2.ethz.ch 24 15 49m -0.001 0.010 -87us 12us
sourcename=`chronyc sources | grep "\^\*" | awk '{ print $2 }'`
if [ $1 -eq 5 ]; then
# write current NTP source to log file
DATE=`date '+%Y-%m-%d %H:%M:%S'`
echo "$DATE $sourcename" >> /var/log/chronysource.log
fi
times=`chronyc sourcestats | tail -n +4 | grep $sourcename | sed 's/us/000/g' | sed 's/ms/000000/g' | sed 's/ns//g' | awk '{printf "%s\n", $'$1'}'`
# 6 = skew
# 7 = offset
# 8 = std/dev/dispersion
# for absolute offest: | sed s/^-//
# for dispersion use $8
echo "$times"
#!/bin/sh
#
# used to monitor the state of the Glossy Sync protocol used for Flocklab
#
# 2018, rdaforno
#
LOGFILE=/var/log/sync.log
LINECNT=60 # calculate average of x lines
if [ ! -f $LOGFILE ]; then
#echo "ERROR: file not found!"
printf "0\n0"
exit 1;
fi
LASTENTRY=$(date -r $LOGFILE +"%s")
NOW=$(date +"%s")
# older than 10 seconds?
if [ $(($NOW - $LASTENTRY)) -gt 10 ]; then
#echo "WARNING: timestamp is too old"
printf "0\n0"
exit 2;
fi
SYNCINFO=$(tail -n $LINECNT $LOGFILE | awk '{print $NF}')
# check provided argument
if [ $# -gt 0 ]; then
if [ $1 == "rssi" ]; then
RSSIVALUES=$(echo $SYNCINFO | awk -F"," '{print $7 " " $8}' | sed 's/\.//')
echo "$RSSIVALUES"
exit 0
elif [ $1 == "snr" ]; then
SNRVALUE=$(echo $SYNCINFO | awk -F"," '{printf "%d", $7 - $8}')
echo "$SNRVALUE"
exit 0
elif [ $1 == "nrxtx" ]; then
NRXTX=$(echo $SYNCINFO | awk -F"," '{printf "%u", $1 + $2}')
echo "$NRXTX"
exit 0
else
exit 1 # unknown parameter
fi
fi
# without any parameter, provide both SNR and N_RX_TX
#VALUES=$(echo $SYNCINFO | awk -F"," '{printf "%u\n%d", $1+$2, $7-$8}')
VALUES=$(echo $SYNCINFO | awk -F"," '{x+=$1+$2; y+=$7-$8; next} END{printf "%u\n%d", x/NR, y/NR}')
echo "$VALUES"
exit 0
...@@ -44,6 +44,11 @@ extend memoryfragmentation /bin/sh /etc/snmp/scripts/memoryfragmentation.sh ...@@ -44,6 +44,11 @@ extend memoryfragmentation /bin/sh /etc/snmp/scripts/memoryfragmentation.sh
extend daqsync /bin/sh /etc/snmp/scripts/daqsync.sh extend daqsync /bin/sh /etc/snmp/scripts/daqsync.sh
exec flocklabtemplatesmd5sum /bin/sh /etc/snmp/scripts/flocklab_templates_md5sum.sh exec flocklabtemplatesmd5sum /bin/sh /etc/snmp/scripts/flocklab_templates_md5sum.sh
exec glossysync /bin/sh /etc/snmp/scripts/flocklab_glossysync.sh
exec chronyskew /etc/snmp/scripts/chrony-stats.sh 5
exec chronyoffset /etc/snmp/scripts/chrony-stats.sh 7
exec chronystddev /etc/snmp/scripts/chrony-stats.sh 8
disk / 1000 disk / 1000
disk /var/volatile 5000 disk /var/volatile 5000
......
...@@ -76,6 +76,7 @@ include /etc/logrotate.d ...@@ -76,6 +76,7 @@ include /etc/logrotate.d
/var/log/syslog /var/log/syslog
/var/log/cron.log /var/log/cron.log
/var/log/daemon.log /var/log/daemon.log
/var/log/chronysource.log
/var/log/lpr.log /var/log/lpr.log
/var/log/uucp.log /var/log/uucp.log
/var/log/ppp.log /var/log/ppp.log
......
#!/bin/bash
dav_site='https://www.flocklab.ethz.ch/user/webdav'
dav_client=/usr/bin/cadaver
scratch=/tmp/flocklab_tmp
maxtime=3600
fail=0
if [ $# -eq 1 ]
then
if [ ! -d $scratch ]
then
mkdir $scratch
fi
if [ ! -d $scratch/$1 ]
then
mkdir $scratch/$1
fi
mkdir /tmp/$1
starttime=`date +%s`
duration=$((`date +%s` - $starttime))
while [ $duration -lt $maxtime ]
do
$dav_client 1> $scratch/$1/dav.log 2> $scratch/$1/dav.err <<EOF
open $dav_site
get $1/testconfiguration.xml /tmp/$1/testconfiguration.xml
get $1/results_nopower.tar.gz $scratch/$1/results.tar.gz
exit
EOF
cat $scratch/$1/dav.log
cat $scratch/$1/dav.err
if [ `sed '/^\(404\|500\)/!d' $scratch/$1/dav.log | wc -l` -gt 0 ]
then
echo "error occured while fetching data"
fail=1
sleep 120
duration=$((`date +%s` - $starttime))
else
fail=0
duration=$maxtime
fi
rm $scratch/$1/dav.log $scratch/$1/dav.err
done
if [ $fail -eq 1 ]
then
rm $scratch/$1/results.tar.gz
rmdir $scratch/$1
rmdir --ignore-fail-on-non-empty $scratch
echo "timeout when downloading test data"
exit 1
fi
path=`pwd`
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd /tmp/
tar --exclude='results_test_*_powerprofiling.csv' -xvzf $scratch/$1/results.tar.gz
echo "Downloaded data to $PWD/$1"
# clean up
rm $scratch/$1/results.tar.gz
rmdir $scratch/$1
rmdir --ignore-fail-on-non-empty $scratch
cd $path
else
echo "Please specify test id"
fi
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