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 Routing table
23 verbose_run_command netstat -rn
24 BOOT_FILE=/usr/boot/boot_server
25 BOOT_SERVER=$(cat $BOOT_FILE)
26 verbose_show_message Pinging boot server "(" $BOOT_SERVER ")" from file $BOOT_FILE
27 verbose_run_command ping -c 4 -w 4 $BOOT_SERVER
28 verbose_show_message Pinging google public DNS
29 verbose_run_command ping -c 1 -w 5 8.8.8.8
30 # try to resolve this hostname as that's the one used for ntp
31 dnss=$(grep '^nameserver' /etc/resolv.conf 2>/dev/null | awk '{print $2;}')
32 if [ -z "$dnss" ] ; then
33 # not too helpful, but..
34 verbose_show_message No server found in /etc/resolv.conf - Resolving hostname at the google public DNS
35 verbose_run_command host -W 4 pool.ntp.org 8.8.8.8
38 verbose_show_message Resolving hostname at $dns
39 verbose_run_command host -W 4 pool.ntp.org $dns
42 echo $(date "+%H:%M:%S") " ======================================== END SANITY CHECKS"