This post is more than 5 years old
5 Posts
0
151170
April 19th, 2013 20:00
obtaining free space in GB rather than % in vbundle?
How would one do this? Currently we have a rule using the 'vBundle.datastore.storage.free' variable, but that only reports in percentage.
No Events found!



john_s_main
132 Posts
0
April 21st, 2013 08:00
set scope to VMWDatastore
#spaceAvailable# metric is in megabytes
john_s_main
132 Posts
0
April 22nd, 2013 13:00
Scope is the topologyObject type/query result which is used as the entry point into the topology structure for the rule you want to create.
In this case, VMWDatastore.
The vBundle derived metric is likely using that scope in it's calculation as well. ( since vBundle is deprecated, I no longer have it readily available, so can't be sure.)
In this case, the spaceAvailable metric is already existing on the VMWDatastore objects, so you don't need to create a new derived metric.
Simply copy the rule you currently use, give it a new name, and change the condition(s) to use the spaceAvailable metric instead of the vBundle derived metric.
mpalombi
5 Posts
0
April 22nd, 2013 11:00
By scope, do you mean the cartridge name?
mpalombi
5 Posts
0
April 26th, 2013 16:00
So, got a chance to look at this and the topology type was already set to VMWDatastore.
This is the code for the condition:
// First - Check DS Ignore List
// Second - Check GB Free - Space Available
// Read Ignore list from Registry
def IgnoreList = registry("vBundle.datastore.storage.free.ignore.list");
// Get DS Name
def DSName1 = scope.get("name");
def boolean Found = false;
if (IgnoreList != null) {
Found = IgnoreList.contains(DSName1);}
if (Found) return false;
// If not found in ignore list Continue
try{
// Evaluate GB Free
def GBLevel = registry("vBundle.datastore.storage.free.fatal")*1024;
if(#spaceAvailable#
else return false;}
catch (Exception e) {return false;}
But it's alerting on % (it appears) rather than size.
mpalombi
5 Posts
0
April 26th, 2013 19:00
This is when it is alerting:
On a 249.8GB datastore, it alerted when free space dropped below 100 GB.
On a 2TB datastore, it alerted sometime around 158 GB free (can't find the exact value, is it possible it dipped below that and it wasn't recorded in the max/min?)
Is this a case where #spaceAvailable# could be off by a factor of 10?
The value in "vBundle.datastore.storage.free.fatal" is 20. The intent is that it alert when under 20 GB free. Does the code above not do this?
john_s_main
132 Posts
0
April 26th, 2013 19:00
Try replacing the registry sourced value with a hard coded value.