Skip to content

Commit f45504d

Browse files
committed
Added CloudWatch as a destination; Added an volume inode utilization alert; Added an EMS filter, as well as exceptions and specific matches for volume utilization alerts.
1 parent e4bc969 commit f45504d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Monitoring/monitor-ontap-services/monitor_ontap_services.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def checkSystem():
208208
message = f'CRITICAL: Received a non 200 HTTP status code ({response.status}) when trying to access {clusterName}.'
209209
else:
210210
message = f'CRITICAL: Failed to issue API against {clusterName}. Cluster could be down.'
211-
sendAert(message, "CRITICAL")
211+
sendAlert(message, "CRITICAL")
212212
fsxStatus["systemHealth"] = False
213213
changedEvents = True
214214

@@ -421,19 +421,19 @@ def lagTimeStr(seconds):
421421
minutes = seconds // 60
422422
seconds = seconds - (minutes * 60)
423423

424-
str=""
424+
timeStr=""
425425
if days > 0:
426426
plural = "s" if days != 1 else ""
427-
str = f'{days} day{plural} '
427+
timeStr = f'{days} day{plural} '
428428
if hours > 0 or days > 0:
429429
plural = "s" if hours != 1 else ""
430-
str += f'{hours} hour{plural} '
430+
timeStr += f'{hours} hour{plural} '
431431
if minutes > 0 or days > 0 or hours > 0:
432432
plural = "s" if minutes != 1 else ""
433-
str += f'{minutes} minute{plural} and '
433+
timeStr += f'{minutes} minute{plural} and '
434434
plural = "s" if seconds != 1 else ""
435-
str += f'{seconds} second{plural}'
436-
return str
435+
timeStr += f'{seconds} second{plural}'
436+
return timeStr
437437

438438
################################################################################
439439
# This function is used to check SnapMirror relationships.
@@ -504,8 +504,8 @@ def processSnapMirrorRelationships(service):
504504
if lagSeconds > rule["maxLagTime"]:
505505
uniqueIdentifier = record["uuid"] + "_" + key
506506
if not eventExist(events, uniqueIdentifier): # This resets the "refresh" field if found.
507-
str = lagTimeStr(lagSeconds)
508-
message = f'Snapmirror Lag Alert: {sourceClusterName}::{record["source"]["path"]} -> {clusterName}::{record["destination"]["path"]} has a lag time of {lagSeconds} seconds or {str}.'
507+
timStr = lagTimeStr(lagSeconds)
508+
message = f'Snapmirror Lag Alert: {sourceClusterName}::{record["source"]["path"]} -> {clusterName}::{record["destination"]["path"]} has a lag time of {lagSeconds} seconds or {timStr}.'
509509
sendAlert(message, "WARNING")
510510
changedEvents=True
511511
event = {

0 commit comments

Comments
 (0)