Script for space usage per node in directory container pool

schuhb

ADSM.ORG Member
Joined
Apr 14, 2004
Messages
20
Reaction score
0
Points
0
Location
Vienna
Website
Visit site
Hi
I just struggle creating a script that shows me the actual disk usage per node.
I find with "select * from dedupstats" all backups, but it includes every day.

Is there an easy way to show just the last valid usage for each node in one script.

Thankful for any script in handling deduplication stgpool and nodes.

Thx, Hannes
 
Do you mean one script or one query/command? A script is usually a collection of commands. Either way, I have not seen scripts or SQL queries to do what you want. The dedupstats table, like you have noticed is a compilation of daily statistics, not a running total.

I think GENERATE DEDUPSTATS and QUERY DEDUPSTATS is what you are looking for.
 
Yes, but I need to script it and need to display ONE amount of data used PER node.
So I need to work with dedupstats table not the view.
It is summing up all filespaces from the current dedupstat-run and multiplying with the saved percentage.
My TSM-SQL knowledge struggles a bit with it. :)
 
You will still need to run generate dedupstats to update the dedupstats table prior.

The dates you see are also not every day, unless you run generate dedupstats daily.

Your script could do:

Code:
serial
generate dedupstats {poolname} * wait=yes
select node_name,sum(physical_mb)/1024/1024 as "Total Space Used (MB)" from dedupstats where date(date_time)=date(current_timestamp) group by node_name

NOTE: If you run the script twice back to back, the values will double. It will only work if you run "generate dedupstats" once a day.
 
You will still need to run generate dedupstats to update the dedupstats table prior.

The dates you see are also not every day, unless you run generate dedupstats daily.

Your script could do:

Code:
serial
generate dedupstats {poolname} * wait=yes
select node_name,sum(physical_mb)/1024/1024 as "Total Space Used (MB)" from dedupstats where date(date_time)=date(current_timestamp) group by node_name

NOTE: If you run the script twice back to back, the values will double. It will only work if you run "generate dedupstats" once a day.

Thx, that is what I needed....was actually simply...sorry to bother you all with that. :)
btw: /1024/1024 is not needed bcos already MBs
 
Back
Top