You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Monitoring/monitor-ontap-services/cloudformation.yaml.bak
+16-10Lines changed: 16 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -959,11 +959,11 @@ Resources:
959
959
if response.status == 200:
960
960
data = json.loads(response.data)
961
961
for aggr in data["records"]:
962
-
if (aggr["space"]["block_storage"]["used"]/aggr["space"]["block_storage"]["size"]) * 100 >= rule[key]:
962
+
if aggr["space"]["block_storage"]["used_percent"] >= rule[key]:
963
963
uniqueIdentifier = aggr["uuid"] + "_" + key
964
964
if not eventExist(events, uniqueIdentifier): # This resets the "refresh" field if found.
965
965
alertType = 'Warning' if lkey == "aggrwarnpercentused" else 'Critical'
966
-
message = f'Aggregate {alertType} Alert: Aggregate {aggr["name"]} on {clusterName} is more than {rule[key]} full.'
966
+
message = f'Aggregate {alertType} Alert: Aggregate {aggr["name"]} on {clusterName} is {aggr["space"]["block_storage"]["used_precent"]}% full, which is more or equal to {rule[key]}% full.'
967
967
logger.warning(message)
968
968
snsClient.publish(TopicArn=config["snsTopicArn"], Message=message, Subject=f'Monitor ONTAP Services Alert for cluster {clusterName}')
969
969
changedEvents = True
@@ -978,18 +978,18 @@ Resources:
978
978
print(f'API call to {endpoint} failed. HTTP status code {response.status}.')
979
979
elif lkey == "volumewarnpercentused" or lkey == "volumecriticalpercentused":
980
980
#
981
-
# Run the API call to get the physical storage used.
if record["space"].get("logical_space") and record["space"]["logical_space"].get("used_percent"):
988
-
if record["space"]["logical_space"]["used_percent"] >= rule[key]:
987
+
if record["space"].get("used_percent"):
988
+
if record["space"]["used_percent"] >= rule[key]:
989
989
uniqueIdentifier = record["uuid"] + "_" + key
990
990
if not eventExist(events, uniqueIdentifier): # This resets the "refresh" field if found.
991
991
alertType = 'Warning' if lkey == "volumewarnpercentused" else 'Critical'
992
-
message = f'Volume Usage {alertType} Alert: volume {record["svm"]["name"]}:/{record["name"]} on {clusterName} is {record["space"]["logical_space"]["used_percent"]}% full, which is more than {rule[key]}% full.'
992
+
message = f'Volume Usage {alertType} Alert: volume {record["svm"]["name"]}:/{record["name"]} on {clusterName} is {record["space"]["used_percent"]}% full, which is more or equal to {rule[key]}% full.'
993
993
logger.warning(message)
994
994
snsClient.publish(TopicArn=config["snsTopicArn"], Message=message, Subject=f'Monitor ONTAP Services Alert for cluster {clusterName}')
0 commit comments