OCI monitoring sends an alert when the CPU utilization pass 70%, Oracle Notification Service get this alert and trigger Oracle functions that create a custom message and call Syniverse API to send the SMS.
More
As you make your way through this tutorial, look out for this icon .
Whenever you see it, it's time for you to perform an action.
Before you proceed further, ensure you have followed all the steps outlined in the parent README file located in oci-notification-syniverse
Review the following files in the current folder:
- the code of the function, func.py
- its dependencies, requirements.txt
- the function metadata, func.yaml
In Cloud Shell, run the fn deploy
command to build this function and its dependencies as a Docker image,
push the image to the specified Docker registry, and deploy this function to Oracle Functions
in the application created earlier:
fn -v deploy --app <app-name>
e.g.
fn -v deploy --app myapp
In Cloud Shell, run the following fn invoke
command to unit test this function:
fn invoke <app-name> <function-name> < test-alert.json
e.g.,
fn invoke myapp oci-alerts-to-syniverse-python < test-alert.json
You should see the SMS notifications sent by Syniverse.
-
From the menu in the upper-left corner, select Application Integration, and then select Notifications.
-
Click Create Topic and create a topic with Alerts_Syniverse_SMS_Notification name.
-
Choose your topic, click Create Subscription and use the following example:
- Protocol: Function
- Function Compartment: Select the compartment syniverse_compartment that you created
- Function Application: myapp
- Function: oci-alerts-to-syniverse-python
-
From the menu in the upper-left corner, select Monitoring, and then select Alarm definitions.
-
Click Create Alarm and use the following example:
- Alarm Name: 70% CPU Utilization
- Alarm severity: Critical
- Alarm body: OCI Alarm: syniverse. CpuUtilization: 70
-
On Metric description select the compartment syniverse_compartment, select Metric namespace as oci_computeagent, Metric name as CpuUtilization, Interval as 1m, and Statistic as Max
-
On Trigger rule select Value greater than 70
-
On Notification select Destination service as notification service, select the compartment syniverse_compartment, and select Topic as Alerts_Syniverse_SMS_Notification
Make sure you configure basic observability for your function and topic using metrics, alarms and email alerts: