Changeset 17530 for trunk


Ignore:
Timestamp:
01/21/14 01:35:59 (11 years ago)
Author:
Daniela Dorner
Message:
improved logging output to be sent via email
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/Monitoring/CheckNetworkStatus.sh

    r13043 r17530  
    44
    55vals=(`/sbin/ifconfig -s | tr -s ' ' | cut -d' ' -f1,5,9 | grep -v RX `)
     6#echo ${vals[@]}
     7#echo ${#vals[@]}
    68
     9numvals=`echo " $numnetworks * 3 + 3" | bc -l`
     10#echo $numvals
     11if [ ${#vals[@]} -ne $numvals ]
     12then
     13   echo "ERROR Not all "$numnetworks" networks available."
     14   exit
     15fi
    716
    817for (( i=0 ; i < $numnetworks ; i++ ))
    918do
    1019   query="SELECT fRXErrors, fTXErrors FROM NetworkErrors WHERE fEth="$i" ORDER BY fTime DESC LIMIT 0,1;"
    11    errors=( `/usr/bin/mysql -u systemstatus --host=fact01 SystemStatus -s -e "$query"`)
     20   #echo $query
     21   errors=( `/usr/bin/mysql -u systemstatus --host=fact01 systemstatus -s -e "$query"` )
     22   #echo ${errors[@]}
    1223   if [ ${errors[0]} -lt ${vals[$i*3+1]} ]
    1324   then
    14       echo "RX errors increased to "${errors[0]} 
     25      echo "RX errors increased to "${errors[0]}" on eth"$i
    1526   fi
    1627   if [ ${errors[1]} -lt ${vals[$i*3+2]} ]
    1728   then
    18       echo "TX errors increased to "${errors[0]}
     29      echo "TX errors increased to "${errors[0]}" on eth"$i
    1930   fi
    2031   query="INSERT NetworkErrors SET fEth="$i", fRXErrors="${vals[$i*3+1]}", fTXErrors="${vals[$i*3+2]}", fTime=Now()"
    21    /usr/bin/mysql -u systemstatus --host=fact01 SystemStatus -e "$query"
     32   /usr/bin/mysql -u systemstatus --host=fact01 systemstatus -e "$query"
    2233done
    2334
Note: See TracChangeset for help on using the changeset viewer.