From c7f7d6dd5b79ece6b6b48d16e11e74585615c24a Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 13 Oct 2019 09:39:29 -0400 Subject: [PATCH] Swap Sections 3 & 4, so iptables info is in 1 spot --- scripts/iiab-diagnostics | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/scripts/iiab-diagnostics b/scripts/iiab-diagnostics index 7981b9979..57fd075ba 100755 --- a/scripts/iiab-diagnostics +++ b/scripts/iiab-diagnostics @@ -66,6 +66,17 @@ function cat_file() { cat_file_raw $1 } +function cat_cmd() { # $1 = command + params, $2 = explanation + echo " $1 # $2" + echo "=IIAB==========================================================================" >> $outfile + cmd=$(echo $1 | sed 's/\s.*$//') # Keep command on left; Drop params on right + pth=$(which $cmd | sed 's/[^/]*$//') # Keep only path on left; Drop command on right + echo "COMMAND: $pth$1 # $2" >> $outfile + echo >> $outfile + $(echo $1) >> $outfile + echo >> $outfile +} + function cat_dir() { echo " $1" echo "=IIAB==========================================================================" >> $outfile @@ -80,17 +91,6 @@ function cat_dir() { fi } -function cat_cmd() { # $1 = command + params, $2 = explanation - echo " $1 # $2" - echo "=IIAB==========================================================================" >> $outfile - cmd=$(echo $1 | sed 's/\s.*$//') # Keep command on left; Drop params on right - pth=$(which $cmd | sed 's/[^/]*$//') # Keep only path on left; Drop command on right - echo "COMMAND: $pth$1 # $2" >> $outfile - echo >> $outfile - $(echo $1) >> $outfile - echo >> $outfile -} - function cat_tail() { # $1 = path/filename; $2 = # of lines, for tail echo " $1" echo "=IIAB==========================================================================" >> $outfile @@ -148,15 +148,7 @@ cat_file /usr/bin/iiab-gen-iptables #popd > /dev/null #cat_file /tmp/all-ansible-vars -echo -e "\n 3. Content of Directories, 1-level deep:\n" -cat_dir /etc/network/interfaces.d -cat_dir /etc/systemd/network -cat_dir /etc/NetworkManager/system-connections -cat_dir /etc/netplan -#cat_dir /etc/sysconfig/network-scripts/if-cfg* # No longer common. -#cat_dir /etc/network # Above file /etc/network/interfaces suffices - -echo -e "\n 4. Output of Commands:\n" +echo -e "\n 3. Output of Commands:\n" cat_cmd 'uname -a' 'Linux kernel' cat_cmd 'free' 'RAM memory' cat_cmd 'lscpu' 'CPU details' @@ -173,6 +165,14 @@ cat_cmd 'systemctl status dnsmasq' 'Is dnsmasq Ok?' cat_cmd 'journalctl -u dnsmasq' 'dnsmasq log' #cat_cmd 'ansible localhost -m setup 2>/dev/null' 'All Ansible facts' # For cleaner scraping of Ansible vars, consider "./runrole all-vars /tmp/all-ansible-vars" 15-19 lines above? +echo -e "\n 4. Content of Directories, 1-level deep:\n" +cat_dir /etc/network/interfaces.d +cat_dir /etc/systemd/network +cat_dir /etc/NetworkManager/system-connections +cat_dir /etc/netplan +#cat_dir /etc/sysconfig/network-scripts/if-cfg* # No longer common. +#cat_dir /etc/network # Above file /etc/network/interfaces suffices + echo -e "\n 5. Log Files: (last 100 lines of each)\n" cat_tail /opt/iiab/iiab/iiab-install.log 100 cat_tail /opt/iiab/iiab/iiab-network.log 100