3 function verbose_show_message () {
4 echo $(date "+%H:%M:%S") " ==================== " "$@"
7 function verbose_run_command () {
8 echo $(date "+%H:%M:%S") " ========== running" "$@"
10 echo $(date "+%H:%M:%S") " ==========" "$@" "returned with retcod=$?"
13 function pl_network_sanity_checks () {
14 echo $(date "+%H:%M:%S") " ======================================== BEG SANITY CHECKS"
15 for file in $(ls /etc/resolv.conf /etc/sysconfig/network-scripts/ifcfg-eth* ) ; do
16 verbose_run_command cat $file
18 verbose_show_message Loaded modules
19 verbose_run_command lsmod
20 verbose_show_message Configured interfaces
21 verbose_run_command ifconfig
22 verbose_show_message cat /proc/net/dev
23 verbose_run_command cat /proc/net/dev
24 verbose_show_message Routing table
25 verbose_run_command netstat -rn
26 BOOT_FILE=/usr/boot/boot_server
27 BOOT_SERVER=$(cat $BOOT_FILE)
28 verbose_show_message Pinging boot server "(" $BOOT_SERVER ")" from file $BOOT_FILE
29 verbose_run_command ping -c 4 -w 4 $BOOT_SERVER
30 verbose_show_message Pinging google public DNS
31 verbose_run_command ping -c 1 -w 5 8.8.8.8
32 # try to resolve this hostname as that's the one used for ntp
33 dnss=$(grep '^nameserver' /etc/resolv.conf 2>/dev/null | awk '{print $2;}')
34 if [ -z "$dnss" ] ; then
35 # not too helpful, but..
36 verbose_show_message No server found in /etc/resolv.conf - Resolving hostname at the google public DNS
37 verbose_run_command host -W 4 pool.ntp.org 8.8.8.8
40 verbose_show_message Resolving hostname at $dns
41 verbose_run_command host -W 4 pool.ntp.org $dns
44 echo $(date "+%H:%M:%S") " ======================================== END SANITY CHECKS"