@@ -43,9 +43,13 @@ Metadata:
4343 - volumeUtilizationCriticalAlert
4444 - volumeFileUtilizationWarnAlert
4545 - volumeFileUtilizationCriticalAlert
46+ - volumeOfflineAlert
4647 - softQuotaUtilizationAlert
4748 - hardQuotaUtilizationAlert
4849 - inodesQuotaUtilizationAlert
50+ - vserverStateAlert
51+ - vserverNFSProtocolStateAlert
52+ - vserverCIFSProtocolStateAlert
4953
5054Parameters :
5155 OntapAdminSever :
@@ -220,6 +224,12 @@ Parameters:
220224 Type : Number
221225 Default : 95
222226
227+ volumeOfflineAlert :
228+ Description : " Alert when a volume goes offline."
229+ Type : String
230+ AllowedValues : ["true", "false"]
231+ Default : " true"
232+
223233 softQuotaUtilizationAlert :
224234 Description : " Alert when a soft quota exceeds this threshold in percentage."
225235 Type : Number
@@ -235,6 +245,24 @@ Parameters:
235245 Type : Number
236246 Default : 80
237247
248+ vserverStateAlert :
249+ Description : " Alert when a vserver goes offline."
250+ Type : String
251+ AllowedValues : ["true", "false"]
252+ Default : " true"
253+
254+ vserverNFSProtocolStateAlert :
255+ Description : " Alert when a vserver's NFS protocol goes offline."
256+ Type : String
257+ AllowedValues : ["true", "false"]
258+ Default : " true"
259+
260+ vserverCIFSProtocolStateAlert :
261+ Description : " Alert when a vserver's CIFS protocol goes offline."
262+ Type : String
263+ AllowedValues : ["true", "false"]
264+ Default : " true"
265+
238266Conditions :
239267 CreateSecretsManagerEndpoint : !Equals [!Ref createSecretsManagerEndpoint, "true"]
240268 CreateSNSEndpoint : !Equals [!Ref createSNSEndpoint, "true"]
@@ -464,9 +492,13 @@ Resources:
464492 initialVolumeUtilizationCriticalAlert : !Ref volumeUtilizationCriticalAlert
465493 initialVolumeFileUtilizationWarnAlert : !Ref volumeFileUtilizationWarnAlert
466494 initialVolumeFileUtilizationCriticalAlert : !Ref volumeFileUtilizationCriticalAlert
495+ initialVolumeOfflineAlert : !Ref volumeOfflineAlert
467496 initialSoftQuotaUtilizationAlert : !Ref softQuotaUtilizationAlert
468497 initialHardQuotaUtilizationAlert : !Ref hardQuotaUtilizationAlert
469498 initialInodesQuotaUtilizationAlert : !Ref inodesQuotaUtilizationAlert
499+ initialVserverStateAlert : !Ref vserverStateAlert
500+ initialVserverNFSProtocolStateAlert : !Ref vserverNFSProtocolStateAlert
501+ initialVserverCIFSProtocolStateAlert : !Ref vserverCIFSProtocolStateAlert
470502 Code :
471503 ZipFile : |
472504 #!/bin/python3
@@ -489,8 +521,8 @@ Resources:
489521 # "matching conditions." It is intended to be run as a Lambda function, but
490522 # can be run as a standalone program.
491523 #
492- # Version: v2.13
493- # Date: 2025-04-28-16:26:21
524+ # Version: v2.14
525+ # Date: 2025-04-29-12:53:45
494526 ################################################################################
495527
496528 import json
@@ -1733,7 +1765,8 @@ Resources:
17331765 {"name": "ems", "rules": []},
17341766 {"name": "snapmirror", "rules": []},
17351767 {"name": "storage", "rules": []},
1736- {"name": "quota", "rules": []}
1768+ {"name": "quota", "rules": []},
1769+ {"name": "vserver", "rules": []}
17371770 ]}
17381771 #
17391772 # Now, add rules based on the environment variables.
@@ -1797,6 +1830,11 @@ Resources:
17971830 value = int(value)
17981831 if value > 0:
17991832 conditions["services"][getServiceIndex("storage", conditions)]["rules"].append({"volumeCriticalFilesPercentUsed": value})
1833+ elif name == "initialVolumeOfflineAlert":
1834+ if value == "true":
1835+ conditions["services"][getServiceIndex("storage", conditions)]["rules"].append({"offline": True})
1836+ else:
1837+ conditions["services"][getServiceIndex("storage", conditions)]["rules"].append({"offline": False})
18001838 elif name == "initialSoftQuotaUtilizationAlert":
18011839 value = int(value)
18021840 if value > 0:
@@ -1809,6 +1847,21 @@ Resources:
18091847 value = int(value)
18101848 if value > 0:
18111849 conditions["services"][getServiceIndex("quota", conditions)]["rules"].append({"maxQuotaInodesPercentUsed": value})
1850+ elif name == "initialVserverStateAlert":
1851+ if value == "true":
1852+ conditions["services"][getServiceIndex("vserver", conditions)]["rules"].append({"vserverState": True})
1853+ else:
1854+ conditions["services"][getServiceIndex("vserver", conditions)]["rules"].append({"vserverState": False})
1855+ elif name == "initialVserverNFSProtocolStateAlert":
1856+ if value == "true":
1857+ conditions["services"][getServiceIndex("vserver", conditions)]["rules"].append({"nfsProtocolState": True})
1858+ else:
1859+ conditions["services"][getServiceIndex("vserver", conditions)]["rules"].append({"nfsProtocolState": False})
1860+ elif name == "initialVserverCIFSProtocolStateAlert":
1861+ if value == "true":
1862+ conditions["services"][getServiceIndex("vserver", conditions)]["rules"].append({"cifsProtocolState": True})
1863+ else:
1864+ conditions["services"][getServiceIndex("vserver", conditions)]["rules"].append({"cifsProtocolState": False})
18121865
18131866 return conditions
18141867
0 commit comments