UnixServerAdmin

Server Administration & Management

bandwidth.sh

###########################################################
## bandwidth.sh ##
###########################################################
## Make a Directory /REPORTS ##
## Make a file msg.txt under /REPORTS Directory ##
## Write Following in msg.txt file ##
###########################################################
## Hi, ##
## The Bndwidth Scan process the server has been completed. ##
## For Bandwidth Scan Report, please check the attached bandwidth Report. ##
## Thanks & Regards, ##
## Unixserveradmin.com Security Team ##
###########################################################
#! /bin/bash

/bin/echo “=========================================================” > /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo “THE Bandwidth Report of virlnx3.Securehostdns.com at $(date)” >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo “=========================================================” >> /REPORTS/vnstat.log_$(date +%d%m%y)

/bin/echo ”      ” >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo ”      ” >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo “========================================================” >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo “Bandwidth Report by Day”  >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo “————————–”  >> /REPORTS/vnstat.log_$(date +%d%m%y)
/usr/bin/vnstat -u -i eth0
/usr/bin/vnstat -d >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo “——————————————————–” >> /REPORTS/vnstat.log_$(date +%d%m%y)

/bin/echo ”      ” >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo ”      ” >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo “========================================================” >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo “Bandwidth Report by Hour”  >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo “—————————”  >> /REPORTS/vnstat.log_$(date +%d%m%y)
/usr/bin/vnstat -h >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo “——————————————————–” >> /REPORTS/vnstat.log_$(date +%d%m%y)

/bin/echo ”      ” >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo ”      ” >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo “========================================================” >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo “Bandwidth Report by Month”  >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo “—————————–”  >> /REPORTS/vnstat.log_$(date +%d%m%y)
/usr/bin/vnstat -m >> /REPORTS/vnstat.log_$(date +%d%m%y)
/bin/echo “—————————————————” >> /REPORTS/vnstat.log_$(date +%d%m%y)

mutt -s “Bandwidth Scan REPORT $(hostname | tr ‘a-z’ ‘A-Z’)” -a /REPORTS/vnstat.log_$(date +%d%m%y) unixserv@unixserveradmin.com < /REPORTS/msg.txt

mutt -s “Bandwidth Scan REPORT $(hostname | tr ‘a-z’ ‘A-Z’)” -a /REPORTS/vnstat.log_$(date +%d%m%y) info@unixserveradmin.com < /REPORTS/msg.txt

Advertisements

October 18, 2011 - Posted by | Security, Shell Script, Tips & Tricks, Unix/Linux | , , , , , ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: