Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 3 additions & 5 deletions diagnosis/collectlogs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash

NOW=`date +%Y%m%d%H%M%S`
LOGDIRECTORY="$HOSTNAME-$NOW"
Expand Down Expand Up @@ -83,10 +83,8 @@ do
echo "[$(date +%Y%m%d%H%M%S)][INFO][$HOSTNAME] Dumping $service service status and journal" | tee -a $TRACEFILENAME
if systemctl list-units | grep -q $service.service; then
sudo systemctl show $service &> $LOGDIRECTORY/${service}_status.log
# journal can be long, do not collect everything
# TODO make this smarter
sudo journalctl -u $service | head -n 10000 &> $LOGDIRECTORY/${service}_journal_head.log
sudo journalctl -u $service | tail -n 10000 &> $LOGDIRECTORY/${service}_journal_tail.log
# TODO use --until --since --lines to limit size
sudo journalctl --utc -o short-iso -u $service &> $LOGDIRECTORY/${service}.service.log

if systemctl is-active --quiet $service.service | grep inactive; then
echo "[$(date +%Y%m%d%H%M%S)][ERROR][$HOSTNAME] The $service service is not running" | tee -a $ERRFILENAME
Expand Down
5 changes: 1 addition & 4 deletions diagnosis/collectlogsdvm.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash

NOW=`date +%Y%m%d%H%M%S`
LOGDIRECTORY="$HOSTNAME-$NOW"
Expand Down Expand Up @@ -39,9 +39,6 @@ echo "[$(date +%Y%m%d%H%M%S)][INFO][$HOSTNAME] Looking for apt logs" | tee -a $T
mkdir -p $LOGDIRECTORY/apt/
try_copy_directory_content /var/log/apt/ $LOGDIRECTORY/apt

echo "[$(date +%Y%m%d%H%M%S)][INFO][$HOSTNAME] Dumping system journal" | tee -a $TRACEFILENAME
sudo journalctl &> $LOGDIRECTORY/journalctl.log

echo "[$(date +%Y%m%d%H%M%S)][INFO][$HOSTNAME] Looking for known issues and misconfigurations" | tee -a $TRACEFILENAME
find_cse_errors $LOGDIRECTORY/cse/cluster-provision.log
find_cse_errors $LOGDIRECTORY/cloud-init-output.log
Expand Down
2 changes: 1 addition & 1 deletion diagnosis/common.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash

ERRFILENAME=$1

Expand Down
2 changes: 1 addition & 1 deletion diagnosis/detectors.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash

ERRFILENAME=$1

Expand Down
2 changes: 1 addition & 1 deletion diagnosis/hosts.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash

###
# <summary>
Expand Down