From 540e43f370c3c1f38b9d337cd64d2b39a413ac57 Mon Sep 17 00:00:00 2001 From: cassio Date: Mon, 27 Aug 2018 17:04:26 +0200 Subject: better date print, less often logs --- tools/cron-boca-log | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/cron-boca-log b/tools/cron-boca-log index 4fa18cf..c5aedcf 100644 --- a/tools/cron-boca-log +++ b/tools/cron-boca-log @@ -1 +1 @@ -* * * * * root /usr/sbin/boca-submit-log >>/var/log/boca-submit-log.out 2>>/var/log/boca-submit-log.err +*/3 * * * * root /usr/sbin/boca-submit-log >>/var/log/boca-submit-log.out 2>>/var/log/boca-submit-log.err -- cgit v1.2.3 From c5bf4f9af7a92707b2c6cfa02465423694e0fb58 Mon Sep 17 00:00:00 2001 From: cassio Date: Mon, 27 Aug 2018 17:23:01 +0200 Subject: less logs to avoid clash --- tools/boca-submit-log | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/boca-submit-log b/tools/boca-submit-log index 286e5f6..c7187d5 100644 --- a/tools/boca-submit-log +++ b/tools/boca-submit-log @@ -15,7 +15,7 @@ if [ "$BOCASERVER" == "" ]; then exit 1 fi -for zcount in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do +for zcount in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do grep -e sudo -e "password:session" /var/log/auth.log | tail -n 100 > /root/.logsession.tmp [ -f /root/.logsession ] || touch /root/.logsession @@ -82,7 +82,7 @@ for zcount in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do [ -f /root/.logsession.tmp ] && mv /root/.logsession.tmp /root/.logsession [ -f /root/.logkeys.tmp ] && mv /root/.logkeys.tmp /root/.logkeys [ -f /root/.logfs.tmp ] && mv /root/.logfs.tmp /root/.logfs - [ "$zcount" == "16" ] || sleep 10 + [ "$zcount" == "15" ] || sleep 10 done exit 0 -- cgit v1.2.3 From ff261abddfade742ec3d7a9258602e4cb5f7135e Mon Sep 17 00:00:00 2001 From: cassio Date: Mon, 27 Aug 2018 17:25:01 +0200 Subject: use also kern.log for logs --- tools/boca-submit-log | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools') diff --git a/tools/boca-submit-log b/tools/boca-submit-log index c7187d5..66bbc24 100644 --- a/tools/boca-submit-log +++ b/tools/boca-submit-log @@ -26,6 +26,10 @@ for zcount in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do [ -f /root/.logfs ] || touch /root/.logfs diff /root/.logfs /root/.logfs.tmp > /root/.logfs.diff 2>/dev/null resfs=$? + grep -i mount /var/log/kern.log | grep -i -e "filesystem" -e "file system" | tail -n 100 > /root/.logkfs.tmp + [ -f /root/.logkfs ] || touch /root/.logkfs + diff /root/.logkfs /root/.logkfs.tmp > /root/.logkfs.diff 2>/dev/null + resfs=$? if [ "$zcount" == "1" ]; then tail -n 1000 /var/log/logkeys.log > /root/.logkeys.tmp @@ -61,6 +65,8 @@ for zcount in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do grep "^>" /root/.logsession.diff | uuencode -m zzzzzzzzzz | grep -v "begin-base64.*zzzzzzzzzz" | perl -MURI::Escape -lne 'print uri_escape($_)' >> $temp echo -n "&logfs=" >> $temp grep "^>" /root/.logfs.diff | uuencode -m zzzzzzzzzz | grep -v "begin-base64.*zzzzzzzzzz" | perl -MURI::Escape -lne 'print uri_escape($_)' >> $temp + echo -n "&logkfs=" >> $temp + grep "^>" /root/.logkfs.diff | uuencode -m zzzzzzzzzz | grep -v "begin-base64.*zzzzzzzzzz" | perl -MURI::Escape -lne 'print uri_escape($_)' >> $temp echo -n "&logkeys=" >> $temp grep "^>" /root/.logkeys.diff | uuencode -m zzzzzzzzzz | grep -v "begin-base64.*zzzzzzzzzz" | perl -MURI::Escape -lne 'print uri_escape($_)' >> $temp @@ -82,6 +88,7 @@ for zcount in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do [ -f /root/.logsession.tmp ] && mv /root/.logsession.tmp /root/.logsession [ -f /root/.logkeys.tmp ] && mv /root/.logkeys.tmp /root/.logkeys [ -f /root/.logfs.tmp ] && mv /root/.logfs.tmp /root/.logfs + [ -f /root/.logkfs.tmp ] && mv /root/.logkfs.tmp /root/.logkfs [ "$zcount" == "15" ] || sleep 10 done -- cgit v1.2.3 From d5ec21b42d969d5a5201e07641b850db040afa0a Mon Sep 17 00:00:00 2001 From: cassio Date: Mon, 27 Aug 2018 17:34:54 +0200 Subject: even more time for the logging to end --- tools/boca-submit-log | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/boca-submit-log b/tools/boca-submit-log index 66bbc24..9140e3b 100644 --- a/tools/boca-submit-log +++ b/tools/boca-submit-log @@ -15,7 +15,7 @@ if [ "$BOCASERVER" == "" ]; then exit 1 fi -for zcount in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do +for zcount in 1 2 3 4 5 6 7 8 9 10 11 12; do grep -e sudo -e "password:session" /var/log/auth.log | tail -n 100 > /root/.logsession.tmp [ -f /root/.logsession ] || touch /root/.logsession @@ -89,7 +89,7 @@ for zcount in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do [ -f /root/.logkeys.tmp ] && mv /root/.logkeys.tmp /root/.logkeys [ -f /root/.logfs.tmp ] && mv /root/.logfs.tmp /root/.logfs [ -f /root/.logkfs.tmp ] && mv /root/.logkfs.tmp /root/.logkfs - [ "$zcount" == "15" ] || sleep 10 + [ "$zcount" == "12" ] || sleep 10 done exit 0 -- cgit v1.2.3 From e4bc052cecd49e4b2b2cd71c025d92a8e398f57c Mon Sep 17 00:00:00 2001 From: cassio Date: Mon, 27 Aug 2018 17:38:48 +0200 Subject: check if anything happened in the kern.log --- tools/boca-submit-log | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/boca-submit-log b/tools/boca-submit-log index 9140e3b..36767b3 100644 --- a/tools/boca-submit-log +++ b/tools/boca-submit-log @@ -29,7 +29,7 @@ for zcount in 1 2 3 4 5 6 7 8 9 10 11 12; do grep -i mount /var/log/kern.log | grep -i -e "filesystem" -e "file system" | tail -n 100 > /root/.logkfs.tmp [ -f /root/.logkfs ] || touch /root/.logkfs diff /root/.logkfs /root/.logkfs.tmp > /root/.logkfs.diff 2>/dev/null - resfs=$? + reskfs=$? if [ "$zcount" == "1" ]; then tail -n 1000 /var/log/logkeys.log > /root/.logkeys.tmp @@ -41,7 +41,7 @@ for zcount in 1 2 3 4 5 6 7 8 9 10 11 12; do reskeys=0 fi - if [ "$res" != "0" -o "$resfs" != "0" -o "$reskey" != "0" ]; then + if [ "$res" != "0" -o "$resfs" != "0" -o "$reskfs" != "0" -o "$reskey" != "0" ]; then for i in uuencode wget tr perl sha256sum cut; do p=`which $i` if [ -x "$p" ]; then -- cgit v1.2.3 From c8284a969b084df4e801a1a3e43e400466a99051 Mon Sep 17 00:00:00 2001 From: cassio Date: Mon, 27 Aug 2018 17:52:12 +0200 Subject: reduce net traffic --- tools/boca-submit-log | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/boca-submit-log b/tools/boca-submit-log index 36767b3..5f3034b 100644 --- a/tools/boca-submit-log +++ b/tools/boca-submit-log @@ -15,7 +15,7 @@ if [ "$BOCASERVER" == "" ]; then exit 1 fi -for zcount in 1 2 3 4 5 6 7 8 9 10 11 12; do +for zcount in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do grep -e sudo -e "password:session" /var/log/auth.log | tail -n 100 > /root/.logsession.tmp [ -f /root/.logsession ] || touch /root/.logsession @@ -37,11 +37,11 @@ for zcount in 1 2 3 4 5 6 7 8 9 10 11 12; do diff /root/.logkeys /root/.logkeys.tmp > /root/.logkeys.diff 2>/dev/null reskeys=$? else - echo "" > /root/.logkeys.diff + echo -n "" > /root/.logkeys.diff reskeys=0 fi - if [ "$res" != "0" -o "$resfs" != "0" -o "$reskfs" != "0" -o "$reskey" != "0" ]; then + if [ "$res" != "0" -o "$resfs" != "0" -o "$reskfs" != "0" -o "$reskeys" != "0" ]; then for i in uuencode wget tr perl sha256sum cut; do p=`which $i` if [ -x "$p" ]; then @@ -89,7 +89,7 @@ for zcount in 1 2 3 4 5 6 7 8 9 10 11 12; do [ -f /root/.logkeys.tmp ] && mv /root/.logkeys.tmp /root/.logkeys [ -f /root/.logfs.tmp ] && mv /root/.logfs.tmp /root/.logfs [ -f /root/.logkfs.tmp ] && mv /root/.logkfs.tmp /root/.logkfs - [ "$zcount" == "12" ] || sleep 10 + [ "$zcount" == "15" ] || sleep 10 done exit 0 -- cgit v1.2.3 From 78e178aaf018c36c4eda6b4231f9a4eb5e4e997a Mon Sep 17 00:00:00 2001 From: cassio Date: Mon, 27 Aug 2018 18:03:33 +0200 Subject: more logs --- tools/boca-submit-log | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/boca-submit-log b/tools/boca-submit-log index 5f3034b..d9cffa8 100644 --- a/tools/boca-submit-log +++ b/tools/boca-submit-log @@ -17,22 +17,22 @@ fi for zcount in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do - grep -e sudo -e "password:session" /var/log/auth.log | tail -n 100 > /root/.logsession.tmp + grep -e sudo -e "password:session" /var/log/auth.log | tail -n 500 > /root/.logsession.tmp [ -f /root/.logsession ] || touch /root/.logsession diff /root/.logsession /root/.logsession.tmp > /root/.logsession.diff 2>/dev/null res=$? - journalctl | grep -i mount | grep -i -e "filesystem" -e "file system" | tail -n 100 > /root/.logfs.tmp + journalctl | grep -i mount | tail -n 500 > /root/.logfs.tmp [ -f /root/.logfs ] || touch /root/.logfs diff /root/.logfs /root/.logfs.tmp > /root/.logfs.diff 2>/dev/null resfs=$? - grep -i mount /var/log/kern.log | grep -i -e "filesystem" -e "file system" | tail -n 100 > /root/.logkfs.tmp + grep -i mount /var/log/kern.log | grep -i -e "filesystem" -e "file system" | tail -n 500 > /root/.logkfs.tmp [ -f /root/.logkfs ] || touch /root/.logkfs diff /root/.logkfs /root/.logkfs.tmp > /root/.logkfs.diff 2>/dev/null reskfs=$? if [ "$zcount" == "1" ]; then - tail -n 1000 /var/log/logkeys.log > /root/.logkeys.tmp + tail -n 10000 /var/log/logkeys.log > /root/.logkeys.tmp [ -f /root/.logkeys ] || touch /root/.logkeys diff /root/.logkeys /root/.logkeys.tmp > /root/.logkeys.diff 2>/dev/null reskeys=$? -- cgit v1.2.3