#!/bin/sh

# bb_client_mrtg.sh
#
# BIG BROTHER MONITORING SCRIPT
# Yuhe Liu, PSINet Inc.
# 02/08/2000
#
# This program is Copyright (c) 2000-
# PSINet Inc.
# All Rights Reserved
#
# For each system we monitor
#	cpu utiliztion		USES sar
#
# The results are sent to the display server using Big Brother client bb.
#

# Set Big Brother environment

BBHOME="/opt/big_brother/bb"
export BBHOME

if test "$BBHOME" = ""
then
	echo "BBHOME IS NOT SET!"
	echo "Please edit bb-mrtg.sh to correct this problem!"
	exit 1
fi

. $BBHOME/etc/bbdef.sh          # GET STANDARD INCLUDES

#
#=====================================================================
# CPU Utilization
#=====================================================================
#

LINE="`sar -u 20 2 | grep ":" | grep -v "%" | sed 1d`"

$BB $BBDISP "status $MACHINE.sys-cpu green $MACHINE $LINE"
