ADSM-L

Re: scripting client's data???

2001-06-29 06:37:34
Subject: Re: scripting client's data???
From: Lindsay Morris <lmorris AT SERVERGRAPH DOT COM>
Date: Fri, 29 Jun 2001 06:34:12 -0400
Summing up LASTSESS_RECVD will miss some data, though.
If a node had two or more sessions in one day, only the last session will be
counted.
And many nodes do this: nodes using HSM, database nodes where the archive
logs are saved every hour ...

A more accurate way is to sum up the ANE4961 messages from the activity log.

Another accurate way is to dig through the
<server-bin-directory>/dsmaccnt.log.
Its layout is described in the Admin Guide.


> -----Original Message-----
> From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU]On Behalf Of
> Lawrence Clark
> Sent: Thursday, June 28, 2001 11:18 AM
> To: ADSM-L AT VM.MARIST DOT EDU
> Subject: Re: scripting client's data???
>
>
> #!/usr/bin/ksh
>
> # Define the location of the log.
> LOC=/home/root/tsmfiles
>
> # Get the total number of bytes received by the TSM server last night.
> tempv=`/bin/dsmadmc -password=admin -id=uoieax "select sum(LASTSESS_RECVD)
> as BytesYesterday from nodes" | /bin/grep -A2 BYTEYESTERDAY |
> /bin/tail -1 | /bi
> n/head -1`
>
> # Convert bytes to MB.  Use awk since it can handle decimal numbers
> 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
>
>
> ~
> ~
> ~
> "tsmmegs" 18 lines, 572 characters
> [backup] /home/root/bin # tsmmegs
> grep: Not a recognized flag: A
> grep: Not a recognized flag: 2
> Usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] -e
> pattern_list...
>         [-f pattern_file...] [file...]
>
>
> >>> 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
> 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>