Unsolved
This post is more than 5 years old
5 Posts
0
4127
using Perl or Ruby can you show how much space is used by a (sub)tenant?
I prefer Perl but Ruby is acceptable. I need a script to look at all tenants/subnants and give me a report on how much space they are using. I might assign the subtenant "Alpha App" 2 TB of space. I need to know how much space they are using so I can actively talk to them about them using up all their space and they might need more. or for some reporting/dashboards.
thanks
JasonCwik
281 Posts
0
April 13th, 2012 12:00
I should mention that you can get more information in the System Management API guide, page 124.
JasonCwik
281 Posts
0
April 13th, 2012 12:00
Here you go:
Args are: IP, Tenant Name, Subtenant Name, tenant admin, tenant admin password.
Execution will output XML like this:
ShaiNair
11 Posts
0
February 13th, 2014 07:00
Hi Jason,
I am trying to write a script using perl to report on the free space on an RMG.
I have got the basic script working to get details from the Atmos but.
The api RMG Info (Sys Management API guide page 27 to 29) is only returning the following.
rmg, name, local time etc etc no space information
The Node Info is returning the total space on the node but not the used space.
When you login to the managemetn gui and look at the system dashboard you get the information.
Is there an API i can use to get the info in the system dashboard?
Regards
Shaji
JasonCwik
281 Posts
0
February 13th, 2014 09:00
If you do a POX login (per the sysmgmt API guide) and then GET:
/maui_admin/list_rmg?from=datatables
You'll get the chunk of HTML from the GUI and you can parse the usage from there. Note that this is undocumented and subject to change between versions. I will file an enhancement request to make this available and documented through the POX API (if you remove ?from=datatables, you'll get an XML response but it does not include used capacity).
ShaiNair
11 Posts
0
February 14th, 2014 01:00
Thanks Jason, I will give it a go.
May be asking too much while trying to save me from reinventing the wheel.
Have you got a sample script using the POX API, like the one you posted above for REST.
Once again, it has given me a lot to go on with ....
ShaiNair
11 Posts
0
February 14th, 2014 02:00
I got what i need usign the following.
#!/usr/bin/perl
use strict;
use WWW::Mechanize;
use HTTP::Cookies;
my $url = "https://atmos/mgmt_login/login";
my $username = "sysadmin";
my $password = "passwd";
my $mech = WWW::Mechanize->new();
$mech->cookie_jar(HTTP::Cookies->new());
$mech->get($url);
$mech->form_name('login_form');
$mech->field(username => $username);
$mech->field(password => $password);
$mech->click();
my $output_page = $mech->content();
my $url = "https://atmos/maui_admin/maui_dashboard";
$mech->get($url);
my $output_page = $mech->content();
A bunch of search and repalce and if statements to get what i want ....
ShaiNair
11 Posts
0
February 20th, 2014 02:00
Hi,
I have used perl and use WWW::Mechanize module to browse /maui_admin/maui_dashboard.
Then used a lot of search and replace and split commands to get what i need.
I managed to get the total and used capacity.
Regards
Shaji