ADSM-L

Re: scripting client's data???

2001-06-28 10:43:34
Subject: Re: scripting client's data???
From: Mahesh Tailor <MTailor AT CARILION DOT COM>
Date: Thu, 28 Jun 2001 10:44:17 -0400
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>