ADSM-L

Re: scripting client's data???

2001-06-28 11:02:05
Subject: Re: scripting client's data???
From: Mahesh Tailor <MTailor AT CARILION DOT COM>
Date: Thu, 28 Jun 2001 11:02:55 -0400
By the way, I am using the GNU version of grep not the grep that comes
with AIX.  Install the full distribution of GNU grep by getting a
precompiled version (gnu.grep-2.3.0.0.exe) from http://freeware.bull.net.

And, at the start of my email it should be "$LOC directory" not "$LOG
directory".

Mahesh

P.S.  I tried to send this earlier with the gnu grep attached but the
list rejected.

>>> "Mahesh Tailor" <MTailor AT carilion DOT com> 06/28/01 10:44AM >>>
Try this script.  It'll create a log called daily.log in the $LOG
directory.  This log will contain two things: date and the number of MB
received.  Import the log file into a spreadsheet and graph it.

In the script, change the location of the directory (LOC) where you want
to save the log file.  One thing the script does not do is prune the log
after a certain number of days/months/years worth of entries.

================== Script Starts Here =============================

#!/usr/bin/ksh

# Define the location of the log.
LOC=/whereever/bytesBackup

# Get the total number of bytes received by the TSM server last night.
tempv=`/bin/dsmadmc -password=admin -id=admin "select
sum(LASTSESS_RECVD)
as BytesYesterday \
   from nodes" | /usr/local/bin/grep -A2 BYTESYESTERDAY | /usr/bin/tail
-1 | /usr/bin/head -1`
# Convert bytes to MB.  Use awk since it can handle decimal numbers
# Convert bytes to MB.  Use awk since it can handle decimal numbers
unlike ksh.
bytes=`echo $tempv | /usr/bin/awk 'BEGIN {sum=0} {sum = $1 / 1000000}
END
{print sum}'`

# Create an entry in the log.
print `/usr/bin/date +%m/%d/%Y` $bytes >>  $LOC/daily.log

exit 0

=================== Script Ends Here =============================

Add the script as a cron entry and you're done.  Hope this does it for
you.


Mahesh Tailor
WAN Administrator
Carilion Health System
Voice: 540-224-3929
Fax: 540-224-3954

>>> marc.levitan AT PFPC DOT COM 06/28/01 08:36AM >>>
Hi All-

Every morning I check the activity log with the following query:

query actlog begindate=today-1 begintime=20:00 enddate=today endtime=now
search=ANE4961I originator=client

This tells me total number of bytes transferred from each client the
previous night.

QUESTION:  How can I create a script to automate this?  I would like to
keep this data in a spread sheet for trending purposes.
Has anyone successfully done this?

Thanks!
Marc Levitan
<Prev in Thread] Current Thread [Next in Thread>