From 31084693f4129b5d3f5624f0ad592f4099a318c1 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Wed, 20 Mar 2019 12:09:04 -0700 Subject: [PATCH 01/24] working to function on current code --- roles/1-prep/templates/iiab-network-reset | 72 ++++------------------- 1 file changed, 10 insertions(+), 62 deletions(-) diff --git a/roles/1-prep/templates/iiab-network-reset b/roles/1-prep/templates/iiab-network-reset index e17fe7add..1bf0ee361 100755 --- a/roles/1-prep/templates/iiab-network-reset +++ b/roles/1-prep/templates/iiab-network-reset @@ -15,12 +15,8 @@ cat << EOF > /tmp/script2overview #!/bin/bash # generate the body overview part diagnostic package about network echo "==========================================================" -for f in \$(ls /etc/sysconfig/network-scripts/ifcfg-*|gawk '{printf(" %s",\$1)}'); do - echo - echo \$f - cat \$f -done -echo +echo iiab.env +cat /etc/iiab/iiab.env echo "==========================================================" echo ifconfig ifconfig @@ -47,62 +43,29 @@ netstat -rn echo echo "==========================================================" echo "install log -- last 50 lines" -tail -50 /opt/schoolserver/iiab/iiab-install.log +tail -50 /opt/iiab/iiab/iiab-install.log echo echo "==========================================================" echo "iiab-network log -- last 50 lines" -if [ -f /opt/schoolserver/iiab/iiab-network.log ]; then -tail -50 /opt/schoolserver/iiab/iiab-network.log +if [ -f /opt/iiab/iiab/iiab-network.log ]; then +tail -50 /opt/iiab/iiab/iiab-network.log else echo no iiab-network.log fi echo echo "==========================================================" -cat /etc/fedora-release | grep 18 -if [ \$? -eq 0 ]; then - echo "nmcli conn list" - nmcli conn list 3>&2 -else - echo "nmcli conn show" - nmcli conn show 3>&2 -fi -echo -echo "==========================================================" -echo nmcli dev wifi list -nmcli dev wifi list EOF chmod 755 /tmp/script2overview /tmp/script2overview > /tmp/$basket/overview -if [ -f /opt/schoolserver/iiab/iiab-network.log ]; then - cp /opt/schoolserver/iiab/iiab-network.log /tmp/$basket +if [ -f /opt/iiab/iiab/iiab-network.log ]; then + cp /opt/iiab/iiab/iiab-network.log /tmp/$basket else touch /tmp/$basket/no_iiab-network.log fi -if [ -f /etc/sysconfig/iiab_domain_name ];then - cp -p /etc/sysconfig/iiab_domain_name /tmp/$basket -else - touch /tmp/$basket/iiab_domain_name_not_set -fi - -if [ -f /etc/sysconfig/iiab_lan_device ];then - cp -p /etc/sysconfig/iiab_lan_device /tmp/$basket -else - touch /tmp/$basket/iiab_lan_device_not_set -fi -if [ -f /etc/sysconfig/iiab_wan_device ];then - cp -p /etc/sysconfig/iiab_wan_device /tmp/$basket -else - touch /tmp/$basket/iiab_wan_device_not_set -fi -ls /etc/NetworkManager/system-connections > /dev/null -if [ $? -eq 0 ]; then - cp -rp /etc/NetworkManager/system-connections /tmp/$basket -fi -cp /etc/sysconfig/network-scripts/ifcfg-* /tmp/$basket -if [ -f /opt/schoolserver/iiab/iiab-network.log ]; then - cp -p /opt/schoolserver/iiab/iiab-network.log /tmp/$basket +if [ -f /opt/iiab/iiab/iiab-network.log ]; then + cp -p /opt/iiab/iiab/iiab-network.log /tmp/$basket fi mkdir -p /etc/iiab/diagnose/ @@ -119,19 +82,4 @@ else rm -rf /tmp/$basket fi -# clear out all the memory variables and let auto-configure start from scratch -rm -rf /etc/sysconfig/iiab_domain_name -rm -rf /etc/sysconfig/iiab_lan_device -rm -rf /etc/sysconfig/iiab_wan_device -rm -rf /etc/NetworkManager/system-connestions/* -if [ -f /etc/sysconfig/network-scripts/ifcfg-WAN ];then - mv /etc/sysconfig/network-scripts/ifcfg-WAN /root - echo -e "\n\nWAN setup file moved to /root for safekeeping.\n\n" -fi - -ls -1 /etc/sysconfig/network-scripts/ifcfg-*|grep -v -e ifcfg-lo -if [ $? -eq 0 ]; then - ls -1 /etc/sysconfig/network-scripts/ifcfg-*|grep -v -e ifcfg-lo|xargs rm -fi - -echo -e "\n\nAll Network variables erased. Now run 'iiab-network' to set up the new network configuration.\n\nPlease see /opt/schoolserver/iiab/docs/GETTING_HELP.rst for ways to get help or \nprovide the feedback which will improve XSCE\n\n" +echo -e "\n\nAll Network variables erased. Now run 'iiab-network' to set up the new network configuration.\n\nPlease see /opt/iiab/iiab/docs/GETTING_HELP.rst for ways to get help or \nprovide the feedback which will improve IIAB\n\n" From 24d3d5c9897d2d27ffc216c9f906f4b2ad404244 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Wed, 20 Mar 2019 12:09:04 -0700 Subject: [PATCH 02/24] working to function on current code --- roles/1-prep/templates/iiab-network-reset | 72 ++++------------------- 1 file changed, 10 insertions(+), 62 deletions(-) diff --git a/roles/1-prep/templates/iiab-network-reset b/roles/1-prep/templates/iiab-network-reset index e17fe7add..1bf0ee361 100755 --- a/roles/1-prep/templates/iiab-network-reset +++ b/roles/1-prep/templates/iiab-network-reset @@ -15,12 +15,8 @@ cat << EOF > /tmp/script2overview #!/bin/bash # generate the body overview part diagnostic package about network echo "==========================================================" -for f in \$(ls /etc/sysconfig/network-scripts/ifcfg-*|gawk '{printf(" %s",\$1)}'); do - echo - echo \$f - cat \$f -done -echo +echo iiab.env +cat /etc/iiab/iiab.env echo "==========================================================" echo ifconfig ifconfig @@ -47,62 +43,29 @@ netstat -rn echo echo "==========================================================" echo "install log -- last 50 lines" -tail -50 /opt/schoolserver/iiab/iiab-install.log +tail -50 /opt/iiab/iiab/iiab-install.log echo echo "==========================================================" echo "iiab-network log -- last 50 lines" -if [ -f /opt/schoolserver/iiab/iiab-network.log ]; then -tail -50 /opt/schoolserver/iiab/iiab-network.log +if [ -f /opt/iiab/iiab/iiab-network.log ]; then +tail -50 /opt/iiab/iiab/iiab-network.log else echo no iiab-network.log fi echo echo "==========================================================" -cat /etc/fedora-release | grep 18 -if [ \$? -eq 0 ]; then - echo "nmcli conn list" - nmcli conn list 3>&2 -else - echo "nmcli conn show" - nmcli conn show 3>&2 -fi -echo -echo "==========================================================" -echo nmcli dev wifi list -nmcli dev wifi list EOF chmod 755 /tmp/script2overview /tmp/script2overview > /tmp/$basket/overview -if [ -f /opt/schoolserver/iiab/iiab-network.log ]; then - cp /opt/schoolserver/iiab/iiab-network.log /tmp/$basket +if [ -f /opt/iiab/iiab/iiab-network.log ]; then + cp /opt/iiab/iiab/iiab-network.log /tmp/$basket else touch /tmp/$basket/no_iiab-network.log fi -if [ -f /etc/sysconfig/iiab_domain_name ];then - cp -p /etc/sysconfig/iiab_domain_name /tmp/$basket -else - touch /tmp/$basket/iiab_domain_name_not_set -fi - -if [ -f /etc/sysconfig/iiab_lan_device ];then - cp -p /etc/sysconfig/iiab_lan_device /tmp/$basket -else - touch /tmp/$basket/iiab_lan_device_not_set -fi -if [ -f /etc/sysconfig/iiab_wan_device ];then - cp -p /etc/sysconfig/iiab_wan_device /tmp/$basket -else - touch /tmp/$basket/iiab_wan_device_not_set -fi -ls /etc/NetworkManager/system-connections > /dev/null -if [ $? -eq 0 ]; then - cp -rp /etc/NetworkManager/system-connections /tmp/$basket -fi -cp /etc/sysconfig/network-scripts/ifcfg-* /tmp/$basket -if [ -f /opt/schoolserver/iiab/iiab-network.log ]; then - cp -p /opt/schoolserver/iiab/iiab-network.log /tmp/$basket +if [ -f /opt/iiab/iiab/iiab-network.log ]; then + cp -p /opt/iiab/iiab/iiab-network.log /tmp/$basket fi mkdir -p /etc/iiab/diagnose/ @@ -119,19 +82,4 @@ else rm -rf /tmp/$basket fi -# clear out all the memory variables and let auto-configure start from scratch -rm -rf /etc/sysconfig/iiab_domain_name -rm -rf /etc/sysconfig/iiab_lan_device -rm -rf /etc/sysconfig/iiab_wan_device -rm -rf /etc/NetworkManager/system-connestions/* -if [ -f /etc/sysconfig/network-scripts/ifcfg-WAN ];then - mv /etc/sysconfig/network-scripts/ifcfg-WAN /root - echo -e "\n\nWAN setup file moved to /root for safekeeping.\n\n" -fi - -ls -1 /etc/sysconfig/network-scripts/ifcfg-*|grep -v -e ifcfg-lo -if [ $? -eq 0 ]; then - ls -1 /etc/sysconfig/network-scripts/ifcfg-*|grep -v -e ifcfg-lo|xargs rm -fi - -echo -e "\n\nAll Network variables erased. Now run 'iiab-network' to set up the new network configuration.\n\nPlease see /opt/schoolserver/iiab/docs/GETTING_HELP.rst for ways to get help or \nprovide the feedback which will improve XSCE\n\n" +echo -e "\n\nAll Network variables erased. Now run 'iiab-network' to set up the new network configuration.\n\nPlease see /opt/iiab/iiab/docs/GETTING_HELP.rst for ways to get help or \nprovide the feedback which will improve IIAB\n\n" From ec04e861c7539347adfa1b234a097160b138ff18 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Sun, 14 Apr 2019 14:29:56 -0700 Subject: [PATCH 03/24] add in ansible vars, and network control files for network manager and systemd networkd --- roles/1-prep/templates/iiab-network-reset | 85 ------------- roles/all-vars/tasks/main.yml | 14 +++ runrole | 7 +- scripts/net-footprint | 139 ++++++++++++++++++++++ 4 files changed, 158 insertions(+), 87 deletions(-) delete mode 100755 roles/1-prep/templates/iiab-network-reset create mode 100644 roles/all-vars/tasks/main.yml create mode 100755 scripts/net-footprint diff --git a/roles/1-prep/templates/iiab-network-reset b/roles/1-prep/templates/iiab-network-reset deleted file mode 100755 index 1bf0ee361..000000000 --- a/roles/1-prep/templates/iiab-network-reset +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash -# if called w/ parameter, skip the reset, create diagnostic package w/ param as file name -SCRIPTDIR=$(cd `dirname $0` pwd) -diagnose_name= -if [ $# -ne 0 ]; then - basket=$1 - diagnose_name=$1 -else - basket=netlog.$$ -fi - -# collect all the network info in one place -mkdir -p /tmp/$basket -cat << EOF > /tmp/script2overview -#!/bin/bash -# generate the body overview part diagnostic package about network -echo "==========================================================" -echo iiab.env -cat /etc/iiab/iiab.env -echo "==========================================================" -echo ifconfig -ifconfig -echo -echo "==========================================================" -echo ip addr -ip addr -echo -echo "==========================================================" -echo "brctl show" -brctl show -echo -echo "==========================================================" -echo "/etc/resolv.conf" -cat /etc/resolv.conf -echo -echo "==========================================================" -echo "cat {{ iiab_ini_file }}" -cat {{ iiab_ini_file }} -echo -echo "==========================================================" -echo "routing table" -netstat -rn -echo -echo "==========================================================" -echo "install log -- last 50 lines" -tail -50 /opt/iiab/iiab/iiab-install.log -echo -echo "==========================================================" -echo "iiab-network log -- last 50 lines" -if [ -f /opt/iiab/iiab/iiab-network.log ]; then -tail -50 /opt/iiab/iiab/iiab-network.log -else - echo no iiab-network.log -fi -echo -echo "==========================================================" -EOF -chmod 755 /tmp/script2overview -/tmp/script2overview > /tmp/$basket/overview - -if [ -f /opt/iiab/iiab/iiab-network.log ]; then - cp /opt/iiab/iiab/iiab-network.log /tmp/$basket -else - touch /tmp/$basket/no_iiab-network.log -fi - -if [ -f /opt/iiab/iiab/iiab-network.log ]; then - cp -p /opt/iiab/iiab/iiab-network.log /tmp/$basket -fi - -mkdir -p /etc/iiab/diagnose/ -if [ ! -z $diagnose_name ];then - pushd /tmp > /dev/null - tar czf /etc/iiab/diagnose/$basket.tgz $basket/* - popd > /dev/null - rm -rf /tmp/$basket - exit 0 -else - pushd /tmp > /dev/null - tar czf /etc/iiab/diagnose/$basket.tgz $basket/* - popd > /dev/null - rm -rf /tmp/$basket -fi - -echo -e "\n\nAll Network variables erased. Now run 'iiab-network' to set up the new network configuration.\n\nPlease see /opt/iiab/iiab/docs/GETTING_HELP.rst for ways to get help or \nprovide the feedback which will improve IIAB\n\n" diff --git a/roles/all-vars/tasks/main.yml b/roles/all-vars/tasks/main.yml new file mode 100644 index 000000000..6ad04676b --- /dev/null +++ b/roles/all-vars/tasks/main.yml @@ -0,0 +1,14 @@ +- name: Print some debug information + vars: + msg: | + Module Variables ("vars"): + -------------------------------- + {{ vars | to_nice_json }} + + Environment Variables ("environment"): + -------------------------------- + {{ environment | to_nice_json }} + + debug: + msg: "{{ msg.split('\n') }}" + tags: debug_info diff --git a/runrole b/runrole index 31f4aac54..4d060c719 100755 --- a/runrole +++ b/runrole @@ -4,8 +4,11 @@ INVENTORY="ansible_hosts" PLAYBOOK="run-one-role.yml" #PLAYBOOK="iiab-stages.yml" CWD=`pwd` - -export ANSIBLE_LOG_PATH="$CWD/iiab-debug.log" +if [ $# -eq 2 ]; then + export ANSIBLE_LOG_PATH="$2" +else + export ANSIBLE_LOG_PATH="$CWD/iiab-debug.log" +fi if [ ! -f $PLAYBOOK ]; then echo "Exiting: IIAB Playbook not found." diff --git a/scripts/net-footprint b/scripts/net-footprint new file mode 100755 index 000000000..409ef8f66 --- /dev/null +++ b/scripts/net-footprint @@ -0,0 +1,139 @@ +#!/bin/bash +# create a diagnostic footprint of network, and OS settings + +read -p "\n\nPlease identiy yourself (<8 characters, no spaces)" who +if [ -z "$who" ]; then + who="noname" +fi + +read -p "\n\nIf this is a request for help, what email addr for response" email +# Build up a meaningful name for transmission back to the development team +OS_VER=`cat /etc/iiab/iiab.env | grep OS_VER | cut -d'=' -f2` +pushd /opt/iiab/iiab +HASH=`git log --pretty=format:'g%h' -n 1` +YMD=$(date +%y%m%d) +popd + +SCRIPTDIR=$(cd `dirname $0` pwd) +footprint_name=${OS_VER}-$YMD-$who +basket=$footprint_name.$$ +VARS_VALUES=/tmp/all-vars + +# record all the ansible variables +pushd /opt/iiab/iiab > /dev/null + ./runrole all-vars $VARS_VALUES +popd > /dev/null + +# cat files in this direcory +function cat_dir(){ + echo "==========================================================" + echo "Printing contents of $1" + filelist=$(ls $1) + if [ ! -z "$filelist" ]; then + pushd $1 + for f in `ls *`;do + echo $f + cat $f + done + popd + fi +} + +# collect all the network info in one place +mkdir -p /tmp/$basket +cat << EOF > /tmp/script2overview +#!/bin/bash +# generate the body overview part diagnostic package about network +echo "==========================================================" +echo Footprint submitted by: +echo $who +echo $email +echo "==========================================================" +echo iiab.env +cat /etc/iiab/iiab.env +echo "==========================================================" +echo ifconfig +ifconfig +echo +echo "==========================================================" +echo ip addr +ip addr +echo +echo "==========================================================" +echo "brctl show" +brctl show +echo +echo "==========================================================" +echo "/etc/resolv.conf" +cat /etc/resolv.conf +echo +echo "==========================================================" +echo "cat iiab_ini_file " +cat /etc/iiab/iiab.ini +echo +echo "==========================================================" +echo "routing table" +netstat -rn +echo +echo "==========================================================" +echo "install log -- last 50 lines" +tail -50 /opt/iiab/iiab/iiab-install.log +echo +echo "==========================================================" +echo "iiab-network log -- last 50 lines" +if [ -f /opt/iiab/iiab/iiab-network.log ]; then +tail -50 /opt/iiab/iiab/iiab-network.log +else + echo no iiab-network.log +fi +echo +echo "==========================================================" +echo "Contents of /etc/network/interfaces" +cat /etc/network/interfaces +echo "End of Contents of /etc/network/interfaces" +echo "==========================================================" +# cat files in this direcory +function cat_dir(){ + echo "==========================================================" + echo "Printing contents of Directory \$1" + filelist=\$(ls \$1) + if [ ! -z "\$filelist" ]; then + for f in \$filelist;do + echo ===== Contents of file: \$base/\$f + cat \$1/\$f + echo ===== End of Contents of file: \$f + done + fi +} +cat_dir /etc/network/interfaces.d +cat_dir /etc/systemd/network +cat_dir /etc/NetworkManager/system-connections +cat_dir /etc/sysconfig/network-scripts/if-cfg* +EOF +chmod 755 /tmp/script2overview +/tmp/script2overview > /tmp/$basket/overview + +if [ -f /opt/iiab/iiab/iiab-debug.log ]; then + cp /opt/iiab/iiab/iiab-debug.log /tmp/$basket +else + touch /tmp/$basket/no_iiab-network.log +fi + +if [ -f /opt/iiab/iiab/iiab-install.log ]; then + cp -p /opt/iiab/iiab/iiab-install.log /tmp/$basket +fi + +if [ -f "$VARS_VALUES" ]; then + cp -p "$VARS_VALUES" /tmp/$basket +fi + +mkdir -p /etc/iiab/footprint +if [ ! -z $footprint_name ];then + pushd /tmp > /dev/null + tar czf /etc/iiab/footprint/$basket.tgz $basket/* + popd > /dev/null + rm -rf /tmp/$basket + exit 0 +fi +cat_dir /etc/interfaces.d +cat_dir /etc/systemd/network From 17f1a378f2162e75d18add16c52df395eeec277a Mon Sep 17 00:00:00 2001 From: George Hunt Date: Sun, 14 Apr 2019 15:07:22 -0700 Subject: [PATCH 04/24] start deacribing features --- scripts/net-footprint | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/net-footprint b/scripts/net-footprint index 409ef8f66..5b6bce7c9 100755 --- a/scripts/net-footprint +++ b/scripts/net-footprint @@ -76,6 +76,10 @@ echo "routing table" netstat -rn echo echo "==========================================================" +echo "port usage" +netstat -natp +echo +echo "==========================================================" echo "install log -- last 50 lines" tail -50 /opt/iiab/iiab/iiab-install.log echo From 83e0212a01c058f8ae836f32d87dd6076660ebca Mon Sep 17 00:00:00 2001 From: George Hunt Date: Sun, 14 Apr 2019 15:09:48 -0700 Subject: [PATCH 05/24] feature list --- scripts/footprint_features | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 scripts/footprint_features diff --git a/scripts/footprint_features b/scripts/footprint_features new file mode 100644 index 000000000..1495d547a --- /dev/null +++ b/scripts/footprint_features @@ -0,0 +1,23 @@ +Creates a tgz which includes user's name, date, operating system in title. Gathers the following: + +1. iiab.ini +2. iiab.env +3. ip addr +4. ifconfig +5. brctl show +6. /etc/resolv.conf +7. netstat -rn (routing table) +8. netstat -natp (which services have which ports) +9. iiab-install.log +10. iiab-debug.log +11. iiab-network.log +12. all ansible variables + +contents of following directories: + +1. /etc/network/interfaces.d (and interfaces) +2. /etc/sysconfig/network-scripts/if-cfg* +3. /etc/NetworkManager/system-connections +4. /etc/systemd/network/ + +Creates tgz less than 1MB. Can be read by vi without untaring. From 16ffcaa770a79ad7c5adf5559bd32c4e24f803db Mon Sep 17 00:00:00 2001 From: George Hunt Date: Mon, 15 Apr 2019 09:54:13 -0700 Subject: [PATCH 06/24] script name -> footprint --- scripts/{net-footprint => footprint} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{net-footprint => footprint} (100%) diff --git a/scripts/net-footprint b/scripts/footprint similarity index 100% rename from scripts/net-footprint rename to scripts/footprint From 67c70ddc8f63df959337bef34db86a9543f9582c Mon Sep 17 00:00:00 2001 From: George Hunt Date: Mon, 15 Apr 2019 10:14:05 -0700 Subject: [PATCH 07/24] put iiab-footprint on PATH --- roles/3-base-server/tasks/main.yml | 6 ++++++ scripts/{footprint => iiab-footprint} | 0 2 files changed, 6 insertions(+) rename scripts/{footprint => iiab-footprint} (100%) diff --git a/roles/3-base-server/tasks/main.yml b/roles/3-base-server/tasks/main.yml index 6f43f84a2..4c61b027c 100644 --- a/roles/3-base-server/tasks/main.yml +++ b/roles/3-base-server/tasks/main.yml @@ -26,6 +26,12 @@ src: roles/1-prep/templates/iiab_env.py.j2 dest: /etc/iiab/iiab_env.py +- name: Put a symbolic link to diagnostic footprint on PATH + file: + src: "{{ iiab_dir }}/scripts/iiab-footprint" + dest: /usr/bin/iiab-footprint + state: link + - name: Recording STAGE 3 HAS COMPLETED ===================== lineinfile: dest: "{{ iiab_env_file }}" diff --git a/scripts/footprint b/scripts/iiab-footprint similarity index 100% rename from scripts/footprint rename to scripts/iiab-footprint From f70b294452d197e2ad253b75299aaa26d67eeb9e Mon Sep 17 00:00:00 2001 From: George Hunt Date: Mon, 15 Apr 2019 10:18:26 -0700 Subject: [PATCH 08/24] remove testing code --- scripts/iiab-footprint | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/iiab-footprint b/scripts/iiab-footprint index 5b6bce7c9..a5bdd72dd 100755 --- a/scripts/iiab-footprint +++ b/scripts/iiab-footprint @@ -139,5 +139,3 @@ if [ ! -z $footprint_name ];then rm -rf /tmp/$basket exit 0 fi -cat_dir /etc/interfaces.d -cat_dir /etc/systemd/network From dc04ac0ff3e0d038ae5564b265d6fc2b8769b2de Mon Sep 17 00:00:00 2001 From: georgejhunt Date: Mon, 15 Apr 2019 10:31:34 -0700 Subject: [PATCH 09/24] Update and rename footprint_features to footprint_features.md --- scripts/footprint_features | 23 ----------------------- scripts/footprint_features.md | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 23 deletions(-) delete mode 100644 scripts/footprint_features create mode 100644 scripts/footprint_features.md diff --git a/scripts/footprint_features b/scripts/footprint_features deleted file mode 100644 index 1495d547a..000000000 --- a/scripts/footprint_features +++ /dev/null @@ -1,23 +0,0 @@ -Creates a tgz which includes user's name, date, operating system in title. Gathers the following: - -1. iiab.ini -2. iiab.env -3. ip addr -4. ifconfig -5. brctl show -6. /etc/resolv.conf -7. netstat -rn (routing table) -8. netstat -natp (which services have which ports) -9. iiab-install.log -10. iiab-debug.log -11. iiab-network.log -12. all ansible variables - -contents of following directories: - -1. /etc/network/interfaces.d (and interfaces) -2. /etc/sysconfig/network-scripts/if-cfg* -3. /etc/NetworkManager/system-connections -4. /etc/systemd/network/ - -Creates tgz less than 1MB. Can be read by vi without untaring. diff --git a/scripts/footprint_features.md b/scripts/footprint_features.md new file mode 100644 index 000000000..362ff5690 --- /dev/null +++ b/scripts/footprint_features.md @@ -0,0 +1,26 @@ +#### Objective #### +* Creates a tgz which includes user's name, date, operating system in title. Creates tgz less than 1MB. Can be read by vi without untaring.Gathers the following: + +1. iiab.ini +2. iiab.env +3. ip addr +4. ifconfig +5. brctl show +6. /etc/resolv.conf +7. netstat -rn (routing table) +8. netstat -natp (which services have which ports) +9. iiab-install.log +10. iiab-debug.log +11. iiab-network.log +12. all ansible variables + +contents of following directories: + +1. /etc/network/interfaces.d (and interfaces) +2. /etc/sysconfig/network-scripts/if-cfg* +3. /etc/NetworkManager/system-connections +4. /etc/systemd/network/ + +#### Suggested Usage #### +1. Use a FAT formatted USB stick (FAT format is recognized by both Windows and Mac) to move /etc/iiab/footprint/ to a machine that has internet access and a browser. +2. Upload the footprint to https://filebin.ca, record the returned URL, and email that URL, along with a description of the symptoms, to xsce-devel@googlegroups.com. From decfd3ceea48faa48c5d126d1c194d6bc3aa6098 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Mon, 15 Apr 2019 19:05:24 +0100 Subject: [PATCH 10/24] add in rpi-issue information --- scripts/iiab-footprint | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/iiab-footprint b/scripts/iiab-footprint index a5bdd72dd..a20d407fe 100755 --- a/scripts/iiab-footprint +++ b/scripts/iiab-footprint @@ -60,6 +60,14 @@ echo ip addr ip addr echo echo "==========================================================" +echo Checking for information about raspberry pi base image +if [ -f /etc/rpi-issue ];then +cat /etc/rpi-issue +echo "stage 2 = lite; stage 3 = desktop" +else + echo "not a raspberry pi" +fi +echo "==========================================================" echo "brctl show" brctl show echo From 6de481930edd32b5b3832ca8f92da9e826fa6e6d Mon Sep 17 00:00:00 2001 From: George Hunt Date: Mon, 15 Apr 2019 19:22:47 +0100 Subject: [PATCH 11/24] change email target --- scripts/footprint_features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/footprint_features.md b/scripts/footprint_features.md index 362ff5690..2cbb36c7b 100644 --- a/scripts/footprint_features.md +++ b/scripts/footprint_features.md @@ -23,4 +23,4 @@ contents of following directories: #### Suggested Usage #### 1. Use a FAT formatted USB stick (FAT format is recognized by both Windows and Mac) to move /etc/iiab/footprint/ to a machine that has internet access and a browser. -2. Upload the footprint to https://filebin.ca, record the returned URL, and email that URL, along with a description of the symptoms, to xsce-devel@googlegroups.com. +2. Upload the footprint to https://filebin.ca, record the returned URL, and email that URL, along with a description of the symptoms, to bugs@iiab.io. From 26bd8f358a60b5ad6ac10c2fc2c1652465df1fc6 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Mon, 15 Apr 2019 11:58:32 -0700 Subject: [PATCH 12/24] default install pastebinit, and change readme --- roles/2-common/tasks/packages.yml | 1 + scripts/footprint_features.md | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/2-common/tasks/packages.yml b/roles/2-common/tasks/packages.yml index 348fa0524..748864178 100644 --- a/roles/2-common/tasks/packages.yml +++ b/roles/2-common/tasks/packages.yml @@ -54,6 +54,7 @@ - ntfs-3g #- openssh-server # ssh (Raspbian) or openssh-server (other OS's) already installed by 1-prep's roles/sshd/tasks/main.yml - pandoc + - pastebinit - rsync - sudo - tar diff --git a/scripts/footprint_features.md b/scripts/footprint_features.md index 2cbb36c7b..db52c23a8 100644 --- a/scripts/footprint_features.md +++ b/scripts/footprint_features.md @@ -22,5 +22,8 @@ contents of following directories: 4. /etc/systemd/network/ #### Suggested Usage #### -1. Use a FAT formatted USB stick (FAT format is recognized by both Windows and Mac) to move /etc/iiab/footprint/ to a machine that has internet access and a browser. -2. Upload the footprint to https://filebin.ca, record the returned URL, and email that URL, along with a description of the symptoms, to bugs@iiab.io. +1. Upload the footprint you have just generate to pastebinit +``` +pbput /etc/iiab/footprint/ +``` +2. Email a description of the symptoms, and how to generate them, along with the URL which was returned by the "pbput" command, to bugs@iiab.io. From e33cb8838444f4d43313919d6da41e43d9c29ac1 Mon Sep 17 00:00:00 2001 From: georgejhunt Date: Mon, 15 Apr 2019 12:01:11 -0700 Subject: [PATCH 13/24] Update footprint_features.md --- scripts/footprint_features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/footprint_features.md b/scripts/footprint_features.md index db52c23a8..eeac59dbd 100644 --- a/scripts/footprint_features.md +++ b/scripts/footprint_features.md @@ -22,7 +22,7 @@ contents of following directories: 4. /etc/systemd/network/ #### Suggested Usage #### -1. Upload the footprint you have just generate to pastebinit +1. Upload the footprint you have just generated to pastebinit. ``` pbput /etc/iiab/footprint/ ``` From 12d07dd5196f0363ceb029904392de9378cd5995 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Wed, 8 May 2019 20:02:16 -0700 Subject: [PATCH 14/24] change footprint to diagnostics --- roles/3-base-server/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/3-base-server/tasks/main.yml b/roles/3-base-server/tasks/main.yml index 4c61b027c..9e5c39bcf 100644 --- a/roles/3-base-server/tasks/main.yml +++ b/roles/3-base-server/tasks/main.yml @@ -26,10 +26,10 @@ src: roles/1-prep/templates/iiab_env.py.j2 dest: /etc/iiab/iiab_env.py -- name: Put a symbolic link to diagnostic footprint on PATH +- name: Put a symbolic link to diagnostic diagnostics on PATH file: - src: "{{ iiab_dir }}/scripts/iiab-footprint" - dest: /usr/bin/iiab-footprint + src: "{{ iiab_dir }}/scripts/iiab-diagnostics" + dest: /usr/bin/iiab-diagnostics state: link - name: Recording STAGE 3 HAS COMPLETED ===================== From 43a710fa5f0e99d74c7892047be635d94702e756 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Thu, 9 May 2019 03:25:20 +0000 Subject: [PATCH 15/24] change footprint to diagnostics --- run-one-role.yml | 2 +- scripts/{footprint_features.md => diagnostics_features.md} | 0 scripts/{iiab-footprint => iiab-diagnostics} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename scripts/{footprint_features.md => diagnostics_features.md} (100%) rename scripts/{iiab-footprint => iiab-diagnostics} (100%) diff --git a/run-one-role.yml b/run-one-role.yml index 5b0ce5038..fdc678c37 100644 --- a/run-one-role.yml +++ b/run-one-role.yml @@ -4,7 +4,7 @@ vars_files: - vars/default_vars.yml - - vars/{{ ansible_local.local_facts.os_ver }}.yml + - "vars/{{ ansible_local.local_facts.os_ver }}.yml" - /etc/iiab/local_vars.yml - /etc/iiab/config_vars.yml diff --git a/scripts/footprint_features.md b/scripts/diagnostics_features.md similarity index 100% rename from scripts/footprint_features.md rename to scripts/diagnostics_features.md diff --git a/scripts/iiab-footprint b/scripts/iiab-diagnostics similarity index 100% rename from scripts/iiab-footprint rename to scripts/iiab-diagnostics From c125329bef5102e74f3007b52eea65aa3dc5afb2 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Thu, 9 May 2019 04:02:33 +0000 Subject: [PATCH 16/24] more changes to footprint --- scripts/diagnostics_features.md | 4 ++-- scripts/iiab-diagnostics | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/diagnostics_features.md b/scripts/diagnostics_features.md index eeac59dbd..a52178a58 100644 --- a/scripts/diagnostics_features.md +++ b/scripts/diagnostics_features.md @@ -22,8 +22,8 @@ contents of following directories: 4. /etc/systemd/network/ #### Suggested Usage #### -1. Upload the footprint you have just generated to pastebinit. +1. Upload the diagnostics you have just generated to pastebinit. ``` -pbput /etc/iiab/footprint/ +pbput /etc/iiab/diagnostics/ ``` 2. Email a description of the symptoms, and how to generate them, along with the URL which was returned by the "pbput" command, to bugs@iiab.io. diff --git a/scripts/iiab-diagnostics b/scripts/iiab-diagnostics index a20d407fe..59798afb6 100755 --- a/scripts/iiab-diagnostics +++ b/scripts/iiab-diagnostics @@ -1,5 +1,5 @@ #!/bin/bash -# create a diagnostic footprint of network, and OS settings +# create a diagnostic diagnostics of network, and OS settings read -p "\n\nPlease identiy yourself (<8 characters, no spaces)" who if [ -z "$who" ]; then @@ -15,8 +15,8 @@ YMD=$(date +%y%m%d) popd SCRIPTDIR=$(cd `dirname $0` pwd) -footprint_name=${OS_VER}-$YMD-$who -basket=$footprint_name.$$ +diagnostics_name=${OS_VER}-$YMD-$who +basket=$diagnostics_name.$$ VARS_VALUES=/tmp/all-vars # record all the ansible variables @@ -139,10 +139,10 @@ if [ -f "$VARS_VALUES" ]; then cp -p "$VARS_VALUES" /tmp/$basket fi -mkdir -p /etc/iiab/footprint -if [ ! -z $footprint_name ];then +mkdir -p /etc/iiab/diagnostics +if [ ! -z $diagnostics_name ];then pushd /tmp > /dev/null - tar czf /etc/iiab/footprint/$basket.tgz $basket/* + tar czf /etc/iiab/diagnostics/$basket.tgz $basket/* popd > /dev/null rm -rf /tmp/$basket exit 0 From 40d743bde29d5bb7e764e68f0fcc4919ea55fd8d Mon Sep 17 00:00:00 2001 From: George Hunt Date: Thu, 9 May 2019 04:17:28 +0000 Subject: [PATCH 17/24] more refinements --- scripts/iiab-diagnostics | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/iiab-diagnostics b/scripts/iiab-diagnostics index 59798afb6..2ba252659 100755 --- a/scripts/iiab-diagnostics +++ b/scripts/iiab-diagnostics @@ -1,5 +1,5 @@ #!/bin/bash -# create a diagnostic diagnostics of network, and OS settings +# create a diagnostic footprint of network, and OS settings read -p "\n\nPlease identiy yourself (<8 characters, no spaces)" who if [ -z "$who" ]; then @@ -45,7 +45,7 @@ cat << EOF > /tmp/script2overview #!/bin/bash # generate the body overview part diagnostic package about network echo "==========================================================" -echo Footprint submitted by: +echo Diagnostics submitted by: echo $who echo $email echo "==========================================================" From 8744f513d515bdc30ecec519c88ffb6575365871 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Thu, 9 May 2019 04:25:52 +0000 Subject: [PATCH 18/24] add handle,and local_vars.yml --- scripts/iiab-diagnostics | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/iiab-diagnostics b/scripts/iiab-diagnostics index 2ba252659..a83753991 100755 --- a/scripts/iiab-diagnostics +++ b/scripts/iiab-diagnostics @@ -52,6 +52,12 @@ echo "==========================================================" echo iiab.env cat /etc/iiab/iiab.env echo "==========================================================" +echo /etc/iiab/local_vars.yml +cat /etc/iiab/local_vars.yml +echo "==========================================================" +echo /etc/iiab/openvpn_handle +cat /etc/iiab/openvpn_handle +echo "==========================================================" echo ifconfig ifconfig echo From 701b0ced0ba5f96f520efaa0059101cf65211a03 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Thu, 9 May 2019 05:30:54 +0000 Subject: [PATCH 19/24] improvements --- scripts/iiab-diagnostics | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/iiab-diagnostics b/scripts/iiab-diagnostics index a83753991..db0463375 100755 --- a/scripts/iiab-diagnostics +++ b/scripts/iiab-diagnostics @@ -6,7 +6,7 @@ if [ -z "$who" ]; then who="noname" fi -read -p "\n\nIf this is a request for help, what email addr for response" email +read -p "\n\nIf this is a request for help, what is your email address? " email # Build up a meaningful name for transmission back to the development team OS_VER=`cat /etc/iiab/iiab.env | grep OS_VER | cut -d'=' -f2` pushd /opt/iiab/iiab @@ -69,7 +69,7 @@ echo "==========================================================" echo Checking for information about raspberry pi base image if [ -f /etc/rpi-issue ];then cat /etc/rpi-issue -echo "stage 2 = lite; stage 3 = desktop" +echo "stage 2 = lite; stage 3 = desktop SEE github.com/RPi-Distro/pi-gen#stage-anatomy" else echo "not a raspberry pi" fi @@ -82,7 +82,7 @@ echo "/etc/resolv.conf" cat /etc/resolv.conf echo echo "==========================================================" -echo "cat iiab_ini_file " +echo "/etc/iiab_ini_file " cat /etc/iiab/iiab.ini echo echo "==========================================================" @@ -90,6 +90,14 @@ echo "routing table" netstat -rn echo echo "==========================================================" +echo "iptales-save output" +iptables-save +echo +echo "==========================================================" +echo "/usr/bin/iiab-gen-iptable" +cat /usr/bin/iiab-gen-iptables +echo +echo "==========================================================" echo "port usage" netstat -natp echo From 1bdf29a4002e464c8389d6dcc31b3d298171600b Mon Sep 17 00:00:00 2001 From: George Hunt Date: Thu, 9 May 2019 09:52:31 -0700 Subject: [PATCH 20/24] add in image and dnsmasq --- scripts/iiab-diagnostics | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/iiab-diagnostics b/scripts/iiab-diagnostics index db0463375..bdf5d07e2 100755 --- a/scripts/iiab-diagnostics +++ b/scripts/iiab-diagnostics @@ -98,6 +98,18 @@ echo "/usr/bin/iiab-gen-iptable" cat /usr/bin/iiab-gen-iptables echo echo "==========================================================" +echo "/.iiab-image" +cat /.iiab-image +echo +echo "==========================================================" +echo "systemctl status dnsmasq" +systemctl status dnsmasq +echo +echo "==========================================================" +echo "journalctl -u dnsmasq" +journalctl -u dnsmasq +echo +echo "==========================================================" echo "port usage" netstat -natp echo From fc69ccbb28abcff745c0e80111cde9a22206fe4c Mon Sep 17 00:00:00 2001 From: georgejhunt Date: Thu, 20 Jun 2019 20:15:43 -0700 Subject: [PATCH 21/24] Update scripts/iiab-diagnostics Co-Authored-By: A Holt --- scripts/iiab-diagnostics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/iiab-diagnostics b/scripts/iiab-diagnostics index bdf5d07e2..7670d3993 100755 --- a/scripts/iiab-diagnostics +++ b/scripts/iiab-diagnostics @@ -1,7 +1,7 @@ #!/bin/bash # create a diagnostic footprint of network, and OS settings -read -p "\n\nPlease identiy yourself (<8 characters, no spaces)" who +read -p "\n\nPlease provide a name or nickname: (8 characters or less, no spaces) " who if [ -z "$who" ]; then who="noname" fi From d155e8a1132b3bc3a0e0e1b176bf33bf72b30d09 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Fri, 21 Jun 2019 07:12:57 -0700 Subject: [PATCH 22/24] create flat file with all info --- scripts/filelist | 9 ++ scripts/iiab-diagnostics | 211 +++++++++++++++++++-------------------- 2 files changed, 111 insertions(+), 109 deletions(-) create mode 100644 scripts/filelist diff --git a/scripts/filelist b/scripts/filelist new file mode 100644 index 000000000..a194e2180 --- /dev/null +++ b/scripts/filelist @@ -0,0 +1,9 @@ + +/etc/iiab/iiab.env +/etc/iiab/local_vars.yml +/etc/iiab/config_vars.yml +/etc/iiab/iiab.ini +/usr/bin/iiab-gen-iptables +/etc/network/interfaces +/etc/resolv.conf +/etc/iiab/openvpn_handle diff --git a/scripts/iiab-diagnostics b/scripts/iiab-diagnostics index 7670d3993..19fde7684 100755 --- a/scripts/iiab-diagnostics +++ b/scripts/iiab-diagnostics @@ -1,12 +1,11 @@ #!/bin/bash -# create a diagnostic footprint of network, and OS settings +# create a diagnostic collection, and documet OS settings read -p "\n\nPlease provide a name or nickname: (8 characters or less, no spaces) " who if [ -z "$who" ]; then who="noname" fi -read -p "\n\nIf this is a request for help, what is your email address? " email # Build up a meaningful name for transmission back to the development team OS_VER=`cat /etc/iiab/iiab.env | grep OS_VER | cut -d'=' -f2` pushd /opt/iiab/iiab @@ -16,160 +15,154 @@ popd SCRIPTDIR=$(cd `dirname $0` pwd) diagnostics_name=${OS_VER}-$YMD-$who -basket=$diagnostics_name.$$ +outfile=$diagnostics_name.$$ VARS_VALUES=/tmp/all-vars # record all the ansible variables pushd /opt/iiab/iiab > /dev/null - ./runrole all-vars $VARS_VALUES +# ./runrole all-vars $VARS_VALUES popd > /dev/null # cat files in this direcory function cat_dir(){ - echo "==========================================================" - echo "Printing contents of $1" - filelist=$(ls $1) - if [ ! -z "$filelist" ]; then - pushd $1 - for f in `ls *`;do - echo $f - cat $f - done - popd + echo >>/tmp/$outfile + echo "=IIAB=====================================================" >> /tmp/$outfile + if [ -d "$1" ];then + echo "Printing files in $1 directory" >> /tmp/$outfile + echo >>/tmp/$outfile + filelist=$(ls $1) + if [ ! -z "$filelist" ]; then + pushd $1 + for f in `ls *`;do + echo "Printing contents of $f" >> /tmp/$outfile + echo >>/tmp/$outfile + cat $f | iconv -t UTF-8//IGNORE >> /tmp/$outfile + done + popd + fi + else + echo "Directory $1 does not exist" >> /tmp/$outfile fi } +function cat_file(){ + echo >>/tmp/$outfile + echo "=IIAB====================================================" >> /tmp/$outfile + if [ -f $1 ];then + echo "Printing contents of $1" >> /tmp/$outfile + echo >>/tmp/$outfile + if [ $# -eq 2 ];then + echo "Printing last 100 lines" >> /tmp/$outfile + tail -100 $1 | iconv -t UTF-8//IGNORE >> /tmp/$outfile + else + cat $1 | iconv -t UTF-8//IGNORE >> /tmp/$outfile + fi + else + echo "File $1 does not exists" >> /tmp/$outfile + fi +} + +function cat_file_list(){ + for f in $(cat filelist);do + cat_file $f + done +} # collect all the network info in one place -mkdir -p /tmp/$basket -cat << EOF > /tmp/script2overview +cat << EOF > /tmp/diagnostics_script #!/bin/bash # generate the body overview part diagnostic package about network -echo "==========================================================" +echo "=IIAB=====================================================" echo Diagnostics submitted by: echo $who -echo $email -echo "==========================================================" -echo iiab.env -cat /etc/iiab/iiab.env -echo "==========================================================" -echo /etc/iiab/local_vars.yml -cat /etc/iiab/local_vars.yml -echo "==========================================================" -echo /etc/iiab/openvpn_handle -cat /etc/iiab/openvpn_handle -echo "==========================================================" -echo ifconfig +echo "Identifier: $diagnostics_name" +echo "=IIAB=====================================================" +echo Output from /sbin/ifconfig command +echo ifconfig echo -echo "==========================================================" -echo ip addr +echo "=IIAB=====================================================" +echo Output fro /sbin/ip addr +echo ip addr echo -echo "==========================================================" +echo "=IIAB=====================================================" echo Checking for information about raspberry pi base image +echo Output from command 'cat /etc/rpi-issue' +echo if [ -f /etc/rpi-issue ];then cat /etc/rpi-issue -echo "stage 2 = lite; stage 3 = desktop SEE github.com/RPi-Distro/pi-gen#stage-anatomy" +echo "stage2 = lite; stage5 = desktop SEE https://github.com/RPi-Distro/pi-gen#stage-anatomy" else echo "not a raspberry pi" fi -echo "==========================================================" -echo "brctl show" +echo "=IIAB=====================================================" +echo "/sbin/brctl show" +echo brctl show echo -echo "==========================================================" -echo "/etc/resolv.conf" -cat /etc/resolv.conf -echo -echo "==========================================================" -echo "/etc/iiab_ini_file " -cat /etc/iiab/iiab.ini -echo -echo "==========================================================" +echo "=IIAB=====================================================" +echo Output from /bin/netstat -rn echo "routing table" netstat -rn echo -echo "==========================================================" -echo "iptales-save output" +echo "=IIAB=====================================================" +echo "Output of /sbin/iptables-save" +echo iptables-save echo -echo "==========================================================" -echo "/usr/bin/iiab-gen-iptable" -cat /usr/bin/iiab-gen-iptables +echo "=IIAB=====================================================" +if [ -f /.iiab-image ];then +echo "Output of /bin/cat /.iiab-image command." echo -echo "==========================================================" -echo "/.iiab-image" cat /.iiab-image -echo -echo "==========================================================" -echo "systemctl status dnsmasq" -systemctl status dnsmasq -echo -echo "==========================================================" -echo "journalctl -u dnsmasq" -journalctl -u dnsmasq -echo -echo "==========================================================" -echo "port usage" -netstat -natp -echo -echo "==========================================================" -echo "install log -- last 50 lines" -tail -50 /opt/iiab/iiab/iiab-install.log -echo -echo "==========================================================" -echo "iiab-network log -- last 50 lines" -if [ -f /opt/iiab/iiab/iiab-network.log ]; then -tail -50 /opt/iiab/iiab/iiab-network.log -else - echo no iiab-network.log +else + echo /.iiab-image does not exist. fi echo -echo "==========================================================" -echo "Contents of /etc/network/interfaces" -cat /etc/network/interfaces -echo "End of Contents of /etc/network/interfaces" -echo "==========================================================" -# cat files in this direcory -function cat_dir(){ - echo "==========================================================" - echo "Printing contents of Directory \$1" - filelist=\$(ls \$1) - if [ ! -z "\$filelist" ]; then - for f in \$filelist;do - echo ===== Contents of file: \$base/\$f - cat \$1/\$f - echo ===== End of Contents of file: \$f - done - fi -} +echo "=IIAB=====================================================" +echo "systemctl status dnsmasq" +echo +systemctl status dnsmasq +echo +echo "=IIAB=====================================================" +echo "journalctl -u dnsmasq" +echo +journalctl -u dnsmasq +echo +echo "=IIAB=====================================================" +echo "Output of command /bin/netstat -natp showing port usage" +echo +netstat -natp +echo +echo "=IIAB=====================================================" +echo "Output of command /ansible -i localhost -m setup showing all local facts." +echo +ansible localhost -m setup 2>/dev/null +echo +EOF +chmod 755 /tmp/diagnostics_script +/tmp/diagnostics_script > /tmp/$outfile + +cat_file_list + cat_dir /etc/network/interfaces.d cat_dir /etc/systemd/network cat_dir /etc/NetworkManager/system-connections cat_dir /etc/sysconfig/network-scripts/if-cfg* -EOF -chmod 755 /tmp/script2overview -/tmp/script2overview > /tmp/$basket/overview -if [ -f /opt/iiab/iiab/iiab-debug.log ]; then - cp /opt/iiab/iiab/iiab-debug.log /tmp/$basket -else - touch /tmp/$basket/no_iiab-network.log -fi +cat_file /opt/iiab/iiab/iiab-debug.log last +cat_file /opt/iiab/iiab/iiab-install.log last +cat_file /opt/iiab/iiab-admin-console/admin-install.log last -if [ -f /opt/iiab/iiab/iiab-install.log ]; then - cp -p /opt/iiab/iiab/iiab-install.log /tmp/$basket -fi - -if [ -f "$VARS_VALUES" ]; then - cp -p "$VARS_VALUES" /tmp/$basket -fi +#if [ -f "$VARS_VALUES" ]; then +# cat "$VARS_VALUES" >> /tmp/$outfile +#fi mkdir -p /etc/iiab/diagnostics if [ ! -z $diagnostics_name ];then pushd /tmp > /dev/null - tar czf /etc/iiab/diagnostics/$basket.tgz $basket/* + cp /tmp/$outfile /etc/iiab/diagnostics/ popd > /dev/null - rm -rf /tmp/$basket + #rm -rf /tmp/$outfile exit 0 fi From 58e1839fa40ba6071f7b7ec1b33cc8fcf6b2b947 Mon Sep 17 00:00:00 2001 From: georgejhunt Date: Fri, 21 Jun 2019 07:33:46 -0700 Subject: [PATCH 23/24] Update diagnostics_features.md --- scripts/diagnostics_features.md | 40 +++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/scripts/diagnostics_features.md b/scripts/diagnostics_features.md index a52178a58..773649c22 100644 --- a/scripts/diagnostics_features.md +++ b/scripts/diagnostics_features.md @@ -1,18 +1,18 @@ -#### Objective #### -* Creates a tgz which includes user's name, date, operating system in title. Creates tgz less than 1MB. Can be read by vi without untaring.Gathers the following: +## Objective +* Creates a flat file which can be uploaded to pastebinit. Gathers the following: -1. iiab.ini -2. iiab.env -3. ip addr -4. ifconfig -5. brctl show +1. /etc/iiab/iiab.ini +2. /etc/iiab/iiab.env +3. Output of /sbin/ip addr command +4. Output of /sbin/ifconfig command +5. Output of /sbin/brctl show 6. /etc/resolv.conf -7. netstat -rn (routing table) -8. netstat -natp (which services have which ports) -9. iiab-install.log -10. iiab-debug.log -11. iiab-network.log -12. all ansible variables +7. Output of /bin/netstat -rn (routing table) +8. Output from /bin/netstat -natp (which services have which ports) +9. /opt/iiab/iiab-install.log +10. /opt/iiab/iiab-debug.log +11. /opt/iiab-network.log +12. all ansible facts contents of following directories: @@ -21,9 +21,15 @@ contents of following directories: 3. /etc/NetworkManager/system-connections 4. /etc/systemd/network/ -#### Suggested Usage #### -1. Upload the diagnostics you have just generated to pastebinit. +#### Suggested Usage +1. Create a diagnostic package ``` -pbput /etc/iiab/diagnostics/ +sudo iiab-diagnostics ``` -2. Email a description of the symptoms, and how to generate them, along with the URL which was returned by the "pbput" command, to bugs@iiab.io. +(this will generate a new file with the collected information and place it into /etc/iiab/diagnostic/) + +2. Upload the diagnostics you have just generated to pastebinit. +``` + pastebinit -i /etc/iiab/diagnostics/ +``` +3. Email a description of the symptoms, and how to generate them, along with the URL which was returned by the "pastebinit" command, to bugs@iiab.io. From 3b278235a71c5852218dc3a8cf5b435ab6a52648 Mon Sep 17 00:00:00 2001 From: georgejhunt Date: Fri, 21 Jun 2019 07:34:42 -0700 Subject: [PATCH 24/24] Update diagnostics_features.md --- scripts/diagnostics_features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/diagnostics_features.md b/scripts/diagnostics_features.md index 773649c22..6e06f1698 100644 --- a/scripts/diagnostics_features.md +++ b/scripts/diagnostics_features.md @@ -26,7 +26,7 @@ contents of following directories: ``` sudo iiab-diagnostics ``` -(this will generate a new file with the collected information and place it into /etc/iiab/diagnostic/) +(this will generate a new file with the collected information and place it into /etc/iiab/diagnostics/) 2. Upload the diagnostics you have just generated to pastebinit. ```