Commit 3aeba608 authored by Olav Kvittem's avatar Olav Kvittem

improved tcpdum-icmp, depend on touch file beeing present

parent 837af21d
......@@ -14,6 +14,9 @@ Scripts to run rude/crude, traceroute and collect results
ln -s ~/rude/rude/rude .
ln -s ~/rude/crude/crude .
add to /etc/sudoers.d/dragonlab
$USER ALL=(ALL) NOPASSWD: /usr/sbin/tcpdump
~~~~~
### Start polling when ready :
crontab dragonlab/etc/crontab.cfg
......
......@@ -43,3 +43,7 @@ if ! pgrep -u $USER -f $vmstat >/dev/null; then
$vmstat 2> /dev/null > /dev/null&
fi
if ! pgrep -u $USER -f /usr/sbin/tcpdump >/dev/null; then
$HOME/dragonlab/bin/start-icmp
fi
# add to /etc/sudoers.d/dragonlab
up ALL=(ALL) NOPASSWD: /usr/sbin/tcpdump
echo add to /etc/sudoers.d/dragonlab
echo $USER ALL=(ALL) NOPASSWD: /usr/sbin/tcpdump
......@@ -6,8 +6,8 @@
# pick interface with default route
IF=`ip route get 158.38.62.1 | perl -ne 'print $1 if / dev (\w+) /'`
if test "$IF" != ""; then
if test "$IF" != "" && -f $HOME/dragonlab/etc/tcpdump-imcp ; then
tomidnight=$((`date --date 'tomorrow 00:00' +%s`-`date +%s` - 1))
/usr/sbin/tcpdump -i $IF -G $tomidnight -W 1 -w ${logpath}/icmp-%F-%T.pcap icmp 2> ${logpath}/icmp.log
sudo /usr/sbin/tcpdump -i $IF -G $tomidnight -W 1 -w ${logpath}/icmp-%F-%T.pcap icmp 2>> ${logpath}/icmp.log
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