On Tue, Mar 28, 2006 at 02:58:12PM -0700, Steven A. DuChene wrote: > Joel: > I looked at this network_gmetric.sh script and actually implemented it here > at our site. Problem is it is restricted to gathering input and output stats > from > eth interface devices. It pulls from /proc/net/dev which does indeed have > transmit and receive stats for the myri0 device but this script ignores that > since it is not a eth device. So any network transmit or receive stats for any > myrinet devices in the system are not pushed into ganglia. > > The relevent lines are: > > stats=(`cat $procfile | sed -e "s/:/ /" | grep "eth"`)
Joel, my recommendation is to change the 'grep' portion to include both ethernet devices and myri devices. I don't thikn there should be any trouble, so long as the order of fields in the rest of the dev file are the same. I don't have any myri devices, so I can't check. :( The above line is unfortunately not the only place it must be changed - in addition to collecting stats from myri for the current instance of the script, the lines that store historic data must be changed as well. Here's the short version; the long version (diff -c) is attached. -ben [EMAIL PROTECTED]:~$ diff /usr/local/bin/network_gmetric.sh /tmp/net_plus_myri.sh 95c95 < cat $procfile | sed -e "s/:/ /" | grep "eth" >> $STATEFILE --- > cat $procfile | sed -e "s/:/ /" | grep "\(eth\)\|\(myri\)" >> $STATEFILE 120c120 < stats=(`cat $procfile | sed -e "s/:/ /" | grep "eth"`) --- > stats=(`cat $procfile | sed -e "s/:/ /" | grep "\(eth\)\|\(myri\)"`) 264c264 < cat $procfile | sed -e "s/:/ /" | grep "eth" >> $STATEFILE --- > cat $procfile | sed -e "s/:/ /" | grep "\(eth\)\|\(myri\)" >> $STATEFILE -- Ben Hartshorne email: [EMAIL PROTECTED] http://ben.hartshorne.net
*** /usr/local/bin/network_gmetric.sh 2005-10-24 11:03:31.000000000 -0700
--- /tmp/net_plus_myri.sh 2006-03-28 16:06:28.000000000 -0800
***************
*** 92,98 ****
mkdir -p `dirname $STATEFILE`
fi
echo "$date" > $STATEFILE
! cat $procfile | sed -e "s/:/ /" | grep "eth" >> $STATEFILE
if [ ! -e $STATEFILE ]
then
# if it didn't exist and we couldn't create
--- 92,98 ----
mkdir -p `dirname $STATEFILE`
fi
echo "$date" > $STATEFILE
! cat $procfile | sed -e "s/:/ /" | grep "\(eth\)\|\(myri\)" >> $STATEFILE
if [ ! -e $STATEFILE ]
then
# if it didn't exist and we couldn't create
***************
*** 117,123 ****
exec 3>&-
# this script uses gets its stats directly from /proc
! stats=(`cat $procfile | sed -e "s/:/ /" | grep "eth"`)
old_stats=(`cat $STATEFILE`)
old_date=${old_stats[0]}
--- 117,123 ----
exec 3>&-
# this script uses gets its stats directly from /proc
! stats=(`cat $procfile | sed -e "s/:/ /" | grep "\(eth\)\|\(myri\)"`)
old_stats=(`cat $STATEFILE`)
old_date=${old_stats[0]}
***************
*** 261,267 ****
fi
echo "$date" > $STATEFILE
! cat $procfile | sed -e "s/:/ /" | grep "eth" >> $STATEFILE
rm -f $ERROR_CREATE $ERROR_IOSTAT $ERROR_DEVNAME2 $ERROR_DEVNAME
$ERROR_GMETRIC $ERROR_TIMEDIFF $ERROR_NOTROOT
--- 261,267 ----
fi
echo "$date" > $STATEFILE
! cat $procfile | sed -e "s/:/ /" | grep "\(eth\)\|\(myri\)" >> $STATEFILE
rm -f $ERROR_CREATE $ERROR_IOSTAT $ERROR_DEVNAME2 $ERROR_DEVNAME
$ERROR_GMETRIC $ERROR_TIMEDIFF $ERROR_NOTROOT
signature.asc
Description: Digital signature

