So did he add that code to the conditions of the rule? I know practically nothing about groovy and syntax. So if the name has npwgp in it, that will be true? No idea what the BigDecimal is or if it's needed, the bottom part is what is in my copied rule.
try{
BigDecimal bd = new BigDecimal(#capacityAvailable from $scope.hostLogicalDisk#.toString());
john_s_main
132 Posts
0
September 26th, 2012 15:00
http://en.community.dell.com/techcenter/performance-monitoring/foglight-administrators/f/4788/t/19557614#60975
This should assist you.
vsegafredo1
2 Posts
0
September 26th, 2012 16:00
So did he add that code to the conditions of the rule? I know practically nothing about groovy and syntax. So if the name has npwgp in it, that will be true? No idea what the BigDecimal is or if it's needed, the bottom part is what is in my copied rule.
try{
BigDecimal bd = new BigDecimal(#capacityAvailable from $scope.hostLogicalDisk#.toString());
availbility = bd.setScale(2,BigDecimal.ROUND_HALF_UP);
if(scope.get("virtualMachine").get("name").substring(0,8)!='npwgp')
{
if(availbility<=registry("VMWGaz vmLogicalDrive.fatal")) return true;
else return false;
}
else return false;
} catch (Exception e) {return false;}
-------------------------------------------------------------------------------------------------------------
if(scope.get("localState") <= 4)
{
try{
qObjs = #totalSpace from $scope.hostLogicalDisk#;
tmpList = qObjs?.values(qObjs?.topologyObjects[0]);
if(tmpList==null || tmpList?.size() == 0) {
return false;
}
timeToFill = VMwareGetTimeToFull(#spaceUsed from $scope.hostLogicalDisk for 7 days 1 day ago#,tmpList.get(0)?.getValue()?.getAvg());
if(timeToFill==null) return false;
@rulette_data["TimeToFill"] = timeToFill;
if((timeToFill!=0) && (timeToFill < registry("VMW:noOfDays.fatal"))) return true;
else return false;
}
catch (Exception e) {return false;}
}
return false;