Untitled
public text v1 · immutable#!/bin/bash
WM='warn@email.com'
MBW=50
BW=`bwm-ng -c 1 -o plain |grep eth0 |awk {'print $6'}`
ETH=`bwm-ng -c 1 -o plain |grep eth0`
BW2=${BW/.*}
DAT=`date`
echo Current check date: $DAT
echo Status:
echo $ETH
echo ----------------------
if [ $BW2 -ge $MBW ]; then
echo Bandwidth is over $MBW - Currently: $BW
echo Prepearing a warning e-mail to $WM
else
echo Bandwidth is under $MBW - Curently: $BW
fi