Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions monitoring/log-harvester.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Authour Damcorp
# 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