diff --git a/scripts/iiab-diagnostics b/scripts/iiab-diagnostics index 69c2c7f42..a775e5a62 100755 --- a/scripts/iiab-diagnostics +++ b/scripts/iiab-diagnostics @@ -87,7 +87,11 @@ function cat_cmd() { # $1 = command + params, $2 = explan 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 + if [ -z "$pth" ]; then + echo "COMMAND NOT FOUND: $1" >> $outfile + else + $(echo $1) >> $outfile + fi echo >> $outfile } @@ -151,6 +155,7 @@ cat_file /etc/iiab/iiab_state.yml cat_file /etc/iiab/config_vars.yml cat_file /etc/resolv.conf cat_file /etc/network/interfaces +cat_file /etc/hostapd/hostapd.conf # Record all Ansible variables: SLOW! OUTPUT TOO LARGE? #pushd /opt/iiab/iiab > /dev/null @@ -178,13 +183,20 @@ cat_cmd 'blkid' 'Mount point details' cat_cmd 'ip addr' 'Network interfaces' cat_cmd 'ifconfig' 'Network interfaces (old view)' cat_cmd 'brctl show' 'Bridge for LAN side' +cat_cmd 'ip route' 'Routing table' cat_cmd 'netstat -rn' 'Routing table' cat_cmd 'sudo netstat -natp' 'Ports/Services in use' cat_cmd 'systemctl status dnsmasq' 'Is dnsmasq Ok?' -cat_cmd 'sudo journalctl -u dnsmasq' 'dnsmasq log' +cat_cmd 'sudo journalctl -b 0 -u dnsmasq' 'dnsmasq log' cat_cmd 'env' 'Environment variables' #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" 27-31 lines above? cat_cmd 'dmesg' 'Linux diagnostic messages' +cat_cmd 'networkctl' 'systemd-networkd status' +cat_cmd 'nmcli d' 'NetworkManager status' +cat_cmd 'sudo journalctl -b 0 -u networkd-dispatcher' 'networkd-dispatcher log' +cat_cmd 'iw dev' 'list of wireless interfaces' +cat_cmd 'systemctl status hostapd' 'Is hostapd Ok?' +cat_cmd 'ps -AH' 'staging of wpa_supplicant service' echo -e "\n 5. Firewall Rules:\n" echo -e "\n\n\n\n5. FIREWALL RULES\n" >> $outfile