Skip to content

Commit 8b7663a

Browse files
committed
Implem. script code suggestion and updated README
1 parent 663d304 commit 8b7663a

File tree

3 files changed

+270
-394
lines changed

3 files changed

+270
-394
lines changed

manageability-and-operations/observability-and-manageability/oci-monitoring/custom-metrics/custom-metric-python-SDK-services-limit-monitoring/README.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ Basically the **logic** is:
4040

4141
````
4242
Start
43+
Parse input arguments (compartment_ocid, region)
4344
Setup the OCI connection authentication (OCI IAM Config or Instance Principals)
44-
Set compartment_ocid
45-
Initialize the clients for the different API calls (IAM, Monitoring, Service Limits)
45+
Initialise the clients for the different API calls (IAM, Monitoring, Service Limits)
4646
Gather the full list of Service Limits Definitions sorted by Service Limit name
4747
For the list of Service Limit names
4848
If the scope is Availability Domain
@@ -55,27 +55,7 @@ For the list of Service Limit names
5555
End
5656
````
5757

58-
## 4. GETTING STARTED
59-
60-
To execute the script:
61-
62-
1. Ensure that the requirements are met with your desired variant (using IAM user or Instance Principals)
63-
2. Upload the script into your administration VM inside OCI (IAM user or Instance Principals), or outside OCI (IAM user only)
64-
3. Edit the script and put your OCI tenancy root compartment OCID in the compartment_ocid variable
65-
4. To execute the script:
66-
* For the IAM User principals authentication method, execute:
67-
````
68-
$ python3 serviceLimitsMetricsIAM.py
69-
````
70-
* The script is available [here](./files/Scripts/postServiceLimitsMetricsIAM.py)
71-
* For the Instance principal authentication method, execute:
72-
````
73-
$ python3 serviceLimitsMetricsIP.py
74-
````
75-
* The script is available [here](./files/Scripts/postServiceLimitsMetricsIP.py)
76-
77-
78-
## 5. REQUIREMENTS
58+
## 4. REQUIREMENTS
7959

8060
We have different requirements depending on the variant of this asset that we would use:
8161

@@ -98,16 +78,37 @@ We have different requirements depending on the variant of this asset that we wo
9878
The VM where to run the script must have installed python3 with the following required packages installed with pip:
9979
* **oci**
10080

101-
## 6. INPUT
81+
## 5. INPUT
10282

103-
The required input is the ***compartment_ocid*** with the OCID of your tenancy root compartment. Replace the value of the variable at the beginning of the script.
83+
The required input arguments are:
10484

105-
## 7. OUTPUT
85+
* **compartment_ocid** with the OCID of your tenancy root compartment. 
86+
* **region** where you want to get the Services Limits with regional scope and where to publish metrics
87+
88+
## 6. OUTPUT
10689

10790
Every time the script is run, it will feed a custom metric namespace called "**limits_metrics**" in the tenancy's root compartment with the information of the Services Limits usage.
10891

10992
You can check the custom metric extension from the OCI Metrics Explorer, where you will be able also to create an alarms from an specific metric query.
11093

94+
## 7. GETTING STARTED
95+
96+
To execute the script:
97+
98+
1. Ensure that the requirements are met with your desired variant (using IAM user or Instance Principals)
99+
2. Upload the script into your administration VM inside OCI (IAM user or Instance Principals), or outside OCI (IAM user only)
100+
3. To execute the script:
101+
* For the IAM User principals authentication method, execute:
102+
````
103+
$ python3 serviceLimitsMetricsIAM.py -c/--compartment_ocid <root's compartment OCID> -r/--region <target region>
104+
````
105+
* The script is available [here](./files/Scripts/postServiceLimitsMetricsIAM.py)
106+
* For the Instance principal authentication method, execute:
107+
````
108+
$ python3 serviceLimitsMetricsIP.py -c/--compartment_ocid <root's compartment OCID> -r/--region <target region>
109+
````
110+
* The script is available [here](./files/Scripts/postServiceLimitsMetricsIP.py)
111+
111112
## 8.KNOWN PROBLEMS
112113
113114
None at this point.

0 commit comments

Comments
 (0)