Skip to content

Commit 8f4ae48

Browse files
committed
Made minor documentation changes.
1 parent b220406 commit 8f4ae48

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

Monitoring/auto-add-cw-alarms/README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44
There are times when you want to be notified when a FSx for ONTAP file system, or one of its volumes, is reaching
55
its capacity. AWS CloudWatch has metrics that can give you this information. The only problem is that they are
66
on a per instance basis. This means as you add and delete file systems and/or volumes, you have to add and
7-
delete alarms. This can be tedious, and error prone. This script will automates the creation of
7+
delete alarms. This can be tedious, and error prone. This script will automate the creation of
88
AWS CloudWatch alarms that monitor the utilization of the file system and its volumes. It will also create alarms
99
to monitor the CPU utilization of the file system. And if a volume or file system is removed, it will remove the associated alarms.
1010

11-
To implement this, you might think to just create EventTail filters to tigger on FSx Volume Create and Volume Delete
12-
events. This would kind of work, but since you have command line access to the FSx for ONTAP file system, you can create
13-
and delete volumes without creating CloudTrail events. So, instead of relying on those events, this script will
14-
scan all the file systems and volumes in all the regions then create and delete alarms as needed.
11+
To implement this, you might think to just create EventTail filters to trigger on the creation or deletion of an FSx Volume.
12+
This would kind of work, but since you have command line access to the FSx for ONTAP file system, you can create
13+
and delete volumes without creating CloudTrail events. So, this method would not be reliable. Therefore, instead
14+
of relying on those events, this script will scan all the file systems and volumes in all the regions then create and delete alarms as needed.
1515

1616
## Invocation
17-
There are two way you can invoke this script (Python program). Either from a computer that has Python installed, or you could upload it
17+
There are two ways you can invoke this script (Python program). Either from a computer that has Python installed, or you could upload it
1818
as a Lambda function.
1919

2020
### Configuring the program
2121
Before you can run the program you will need to configure it. You can configure it two ways. Either by editing the top part of the program itself,
22-
where there are the following variable defitions, or if you are running it as a standalong program, via some command line options.
22+
where there are the following variable definitions, or if you are running it as a standalone program, via some command line options.
2323
Here is the list of variables, and what they define:
2424

2525
| Variable | Description |Command Line Option|
2626
|:---------|:------------|:--------------------------------|
27-
|SNStopic | The SNS Topic name where CloudWatch will send alerts to. Note that it is assumed that the SNS topic, with the same name, will exist in all the regions where where alarms are to be created.|-s SNS_Topic_Name|
27+
|SNStopic | The SNS Topic name where CloudWatch will send alerts to. Note that it is assumed that the SNS topic, with the same name, will exist in all the regions where alarms are to be created.|-s SNS_Topic_Name|
2828
|accountId | The AWS account ID associated with the SNStopic. This is only used to compute the ARN to the SNS Topic.|-a Account_number|
2929
|customerId| This is really just a comment that will be added to the alarm description.|-c Customer_String|
3030
|defaultCPUThreshold | This will define the default CPU utilization threshold. You can override the default by having a specific tag associated with the file system. See below for more information.|-C number|
@@ -37,7 +37,7 @@ Here is the list of variables, and what they define:
3737
As mentioned with the threshold variables, you can create a tag on the specific resource to override the default value set by the associated threshold
3838
variable. Here is the list of tags and where they should be located:
3939

40-
|Tag|Descrption|location|
40+
|Tag|Description|Location|
4141
|:---|:------|:---|
4242
|alarm_threshold | Sets the volume utilization threshold. | Volume |
4343
|cpu_alarm_threshold| Sets the CPU utilization threshold. | File System |
@@ -46,7 +46,7 @@ variable. Here is the list of tags and where they should be located:
4646
:bulb: **NOTE:** When the alarm threshold is set to 100, the alarm will not be created. So, if you set the default to 100, then you can selectively add alarms by setting the appropriate tag.
4747

4848
### Running on a computer
49-
To run the program on a computer, you will must have Python installed. You will also need to install the boto3 library.
49+
To run the program on a computer, you must have Python installed. You will also need to install the boto3 library.
5050
You can do that by running the following command:
5151

5252
```bash
@@ -62,22 +62,22 @@ having to edit the program, you can use the Command Line Option specified in the
6262
option and the program will display a list of all the available options.
6363

6464
You can limit the regions that the program will act on by using the `-r region` option. You can specify that option
65-
mulitple times to act on multiple regions.
65+
multiple times to act on multiple regions.
6666

67-
You can run the program in "Dry Run" mode by speficying the `-d` (or `--dryRun`) option. This will cause the program to only display
67+
You can run the program in "Dry Run" mode by specifying the `-d` (or `--dryRun`) option. This will cause the program to only display
6868
messages showing what it would have done, and not really create or delete any CloudWatch alarms.
6969

7070
### Running as a Lambda function
7171
If you run the program as a Lambda function, you will want to set the timeout to at least two minutes since some of the API calls
72-
can take a sigificant amount of "clock time" to run, especially in distant regions.
72+
can take a significant amount of "clock time" to run, especially in distant regions.
7373

7474
Once you have installed the Lambda function it is recommended to set up a scheduled type EventBridge rule so the function will run on a regular basis.
7575

7676
The appropriate permissions will need to be assigned to the Lambda function in order for it to run correctly.
7777
It doesn't need many permissions. It just needs to be able to:
7878
* List the FSx for ONTAP file systems
7979
* List the FSx volume names
80-
* List the CloudWatch Alarms
80+
* List the CloudWatch alarms
8181
* Create CloudWatch alarms
8282
* Delete CloudWatch alarms
8383
* Create CloudWatch Log Groups and Log Streams in case you need to diagnose an issue
@@ -125,10 +125,10 @@ The following permissions are required to run the script (although you could nar
125125
Once the script has been configured and invoked, it will:
126126
* Scan for every FSx for ONTAP file systems in every region. For every file system it finds it will:
127127
* Create a CPU utilization CloudWatch alarm, unless the threshold value is set to 100 for the specific alarm.
128-
* Create a SSD utilization CloudWatch alarm, unless the threshold value is set to 100 for the specific alarm.
128+
* Create a SSD utilization CloudWatch alarm, unless the threshold value is set to 100 for the specific alarm.
129129
* Scan for every FSx for ONTAP volume in every region. For every volume it finds it will:
130-
* Create a Volume Utilization CloudWatch alarms, unless the threshold value is set to 100 for the specific alarm.
131-
* Scan for the CloudWatch alarms, and remove any alarms that the associated resource doens't exist anymore.
130+
* Create a Volume Utilization CloudWatch alarm, unless the threshold value is set to 100 for the specific alarm.
131+
* Scan for the CloudWatch alarms and remove any alarms that the associated resource doesn't exist anymore.
132132

133133

134134
## Author Information

Monitoring/auto-add-cw-alarms/auto_add_cw_alarms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def lambda_handler(event, context):
327327
fsName = fsId.replace('fs-', 'FsxId')
328328
alarmDescription = f"Volume utilization alarm for volumeId {volumeId}{customerId}, File System Name: {fsName}, Volume Name: {volumeName} in region {region}."
329329
if(not contains_alarm(alarmName, alarms)):
330-
print(f'Adding volume utilization alarm for {volume["Name"]} in region {region}.')
330+
print(f'Adding volume utilization alarm for {volumeName} in region {region}.')
331331
add_volume_alarm(cw, volumeId, alarmName, alarmDescription, fsId, threshold, region)
332332
#
333333
# Scan for volume alarms without volumes.

0 commit comments

Comments
 (0)