5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
18 for host in $(cat ${hosts_names_file}); do
19 if [ "${host}" != "$(hostname)" ]; then
21 if [ -e /etc/infra_internal_addresses ]; then
22 internal_ip=$(grep ${host} /etc/infra_internal_addresses | cut -d ' ' -f 2)
23 if [ -n "$internal_ip" ]; then
24 address=${internal_ip}
27 ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ServerAliveInterval=60 ${address} "sudo journalctl" > /tmp/journal_${host}.log
28 ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ServerAliveInterval=60 ${address} "sudo journalctl -o json" > /tmp/journal_${host}_json.log
30 sudo journalctl > /tmp/journal_${host}.log
31 sudo journalctl -o json > /tmp/journal_${host}_json.log
36 tar czf node_journals.tgz journal_*.log