From 41e6dc4b055a14dd29703432275b33764d0acafa Mon Sep 17 00:00:00 2001 From: fian Date: Wed, 25 Mar 2020 17:42:26 +0700 Subject: [PATCH 1/2] Adding log harvester script to collect log from all core/master/webApp hosts --- monitoring/log-harvester.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 monitoring/log-harvester.sh diff --git a/monitoring/log-harvester.sh b/monitoring/log-harvester.sh new file mode 100644 index 0000000..6970fe2 --- /dev/null +++ b/monitoring/log-harvester.sh @@ -0,0 +1,16 @@ +# Authour Alfian Tinangon +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +# add your array host address ex. 192.168.x.1 192.168.x.2 192.168.x.3 separate each address with space ! +HOSTS=(192.168.x.1 192.168.x.1 192.168.x.2 192.168.x.3) + +# ssh to each coreapp/master/webapp host, execute command to collect coreapp logs on the host +# make sure host who run this script can enstablish ssh connection to all your coreapp/master/webapp hosts +# change username, logname, --since value, --util value, local path, containername +for host in ${HOSTS[@]}; do + echo "SSH TO $host"; + ssh username@$host $cmd "docker logs containername --since=2020-03-20T17:40:00 --until=2020-03-20T18:40:00 >> $host.logname.log" + echo "SCP FILE FROM $host"; + scp username@$host:~/$host.logname.log ~/local/path/ +done \ No newline at end of file From 42c92e6fd8d8a98854e192c4a0b132700e8d82e3 Mon Sep 17 00:00:00 2001 From: fian Date: Wed, 25 Mar 2020 18:13:42 +0700 Subject: [PATCH 2/2] Changing Author --- monitoring/log-harvester.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitoring/log-harvester.sh b/monitoring/log-harvester.sh index 6970fe2..85ad7aa 100644 --- a/monitoring/log-harvester.sh +++ b/monitoring/log-harvester.sh @@ -1,4 +1,4 @@ -# Authour Alfian Tinangon +# Authour Damcorp # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree.