More Info:
A tenancy with zero configured metric alarms indicates a complete lack of operational and security monitoring. Alarms are mandatory for maintaining situational awareness.Risk Level
MediumAddress
Compliance, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS AWS
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- Cloudanix Best Practice
- DPDPA
- Digital Operational Resilience Act (EU)
- HIPAA
- ISO 27001
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST CSF
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate “OCI Monitoring should have at least one alarm configured” using the OCI Console, you need to create at least one Monitoring Alarm in each relevant compartment/region where you have monitored resources.Below are step‑by‑step console instructions.
By having at least one active alarm configured in each required compartment/region, you remediate the misconfiguration “OCI Monitoring Should Have At Least One Alarm Configured” for OCI Alerting Monitoring.
1. Decide What You Want to Monitor
Typical choices:- Compute: CPU Utilization, Memory (custom), Network
- Block Volume: VolumeUsage, VolumeThroughput
- Object Storage: BucketStorageUsage
- Databases: CPU, Storage, I/O
- Load Balancer: Backend health, HTTP codes, Latency
2. (If Needed) Create a Notification Topic & Subscription
- In the OCI Console, open the hamburger menu (☰).
- Go to Application Integration → Notifications.
- Ensure you’re in the correct region (top-right region selector).
- Click Create Topic:
- Name: e.g.,
critical-alarms-topic - Description: optional
- Compartment: choose the compartment where you want to manage alerts
- Click Create.
- Name: e.g.,
- Click the topic you just created.
- Under Subscriptions, click Create Subscription:
- Protocol: e.g., Email
- Endpoint: your email address
- Click Create.
- Go to your email and confirm the subscription (click the confirmation link).
3. Create a Monitoring Alarm
- Open the hamburger menu (☰).
- Go to Observability & Management → Monitoring → Alarms.
- Verify the region and compartment are correct (top of page).
- Click Create alarm.
A. Basic Details
- Fill in:
- Alarm name: e.g.,
cpu-utilization-high - Compartment: where the alarm should be defined
- Metric compartment: where the resource metrics reside (can be same as alarm compartment)
- Optional: Alarm description.
- Alarm name: e.g.,
B. Alarm Query (Metric & Condition)
You can either use the Query Builder or the text editor.- Under Metric namespace, choose appropriate namespace, e.g.:
- For Compute instances:
oci_computeagent
- For Compute instances:
- Under Metric name, select a metric, e.g.:
CpuUtilization
- In the resource filters, select:
- Resource group: (if any, optional)
- Dimension filters: e.g., choose specific instance or
instancePoolId, etc.
- Set the statistic and interval, e.g.:
- Statistic:
mean - Interval:
1 minuteor5 minutes.
- Statistic:
- Set Trigger rule:
- Condition: e.g.,
>(greater than) - Threshold: e.g.,
80 - Duration: number of consecutive periods, e.g. “for 3 out of 3 intervals”.
- Condition: e.g.,
C. Alarm Severity
- Set Severity:
- e.g.
Criticalfor production/high-priority alerts.
- e.g.
D. Destinations (Where to Send Alerts)
- Under Alarm Destinations, choose:
- Notifications Topic you created earlier (e.g.,
critical-alarms-topic).
- Notifications Topic you created earlier (e.g.,
- Optionally enable:
- Repeat notifications at intervals if condition persists.
E. Actions & Lifecycle
- Under Notification Settings, optionally:
- Enable “Notify when alarm is cleared” if you want recovery notifications.
- Under Suppress (optional):
- Configure suppression windows if you want to silence alarms during maintenance.
F. Save the Alarm
- Review all settings.
- Click Create alarm.
4. Verify the Alarm
- In Monitoring → Alarms, confirm:
- The alarm is listed and in OK or INSUFFICIENT_DATA state (initial state can take a few minutes).
- Confirm:
- Email subscription is Confirmed in Notifications → Subscriptions.
- (Optional) Temporarily create a condition that will definitely trigger (for test), or increase load on the resource, then:
- Check that the alarm state changes to FIRING.
- Verify that you receive the email notification.
5. Ensure Policy Coverage
If alarms or notifications are cross-compartment or cross-tenant, ensure IAM policies allow Monitoring and Notifications usage. For basic same-compartment alarms using your own user, typically no extra policy changes are required.By having at least one active alarm configured in each required compartment/region, you remediate the misconfiguration “OCI Monitoring Should Have At Least One Alarm Configured” for OCI Alerting Monitoring.
Using CLI
Using CLI
Below is a minimal, CLI-focused runbook to ensure OCI Monitoring has at least one alarm configured.
Capture the Confirm and activate via the email link you receive.
Or for all instances in a compartment (not best-practice for prod, but valid for “at least one alarm”):
Key flags:
Check that:This ensures the “OCI Monitoring Should Have At Least One Alarm Configured” requirement is satisfied using OCI CLI.
1. Prerequisites
- OCI CLI installed and configured (
oci setup config) - IAM permissions to:
- Read metrics and create alarms
- Read/create Notifications topics (ONS)
- Compartment OCID:
ocid1.compartment.oc1..xxxx - Region correctly set in your CLI config.
2. (Optional) Create a Notifications Topic for Alarm Delivery
If you don’t already have an ONS topic:topic-id from the output (call it TOPIC_OCID).Add at least one subscription (email example):3. Decide What to Monitor (Example Metric)
Example: Instance CPU Utilization > 80% for 5 minutes.- Namespace:
oci_computeagent - Metric name:
CpuUtilization - Resource group: usually blank for basic alarms, or you can include if needed.
- Example query:
4. Create the Alarm via OCI CLI
Run:--compartment-id: where the alarm resource lives--metric-compartment-id: where the metric is emitted (often the same compartment)--namespace: metric namespace (oci_computeagent,oci_blockstore, etc.)--query-text: alarm expression--destinations: JSON array of ONS topic OCIDs
5. Verify the Alarm Exists and Is Enabled
- Alarm is listed
lifecycle-stateisOKis-enabledistrue
Using Python
Using Python
Below is a concise, step‑by‑step way to ensure “OCI Monitoring has at least one alarm configured” using Python and the OCI SDK.Assumptions:
- You already have:
- An OCI tenancy, compartment, and region
- OCI CLI/SDK config file at
~/.oci/configwith a profile (e.g.,DEFAULT) - Python
ociSDK installed:pip install oci
1. Decide What to Alarm On
Example: Create a basic alarm on an instance’s CPU utilization:- Namespace:
oci_computeagent - Metric:
CpuUtilization - Statistic:
AVG - Threshold: 80%
- Period: 5 minutes
- Severity: CRITICAL
COMPARTMENT_OCID– where the instance and metrics liveDESTINATION_TOPIC_OCID– an OCI Notifications topic OCID for alarm notifications
2. Minimal Python Script to Create an Alarm
3. Ensure Notifications Topic Exists and Has Subscribers
-
In OCI Console:
Developer Services → Application Integration → Notifications → Topics- Create a topic
- Add at least one subscription (Email / PagerDuty / HTTPS, etc.)
- Confirm the subscription (e.g., via email link)
-
Use that topic’s OCID as
DESTINATION_TOPIC_OCIDin the script.
4. Validate the Alarm
- In Console: Observability & Management → Monitoring → Alarms
- Confirm the alarm exists and is “Enabled”.
- Generate load on the instance (or adjust the threshold to a very low value) and verify:
- Alarm state changes to “FIRING”
- Notification is sent to your subscription
5. Applying at Scale (Optional)
You can:- Loop over multiple compartments or resources.
- Use different queries per metric (e.g., memory, disk, custom metrics).
- Use tags or resource IDs in the query to target specific resources.
Using Terraform
Using Terraform
oci_monitoring_alarm resource does not replace any existing resource; it simply adds an alarm so the tenancy is no longer without monitoring.Verification: terraform plan should show one new resource to be created: + oci_monitoring_alarm.cpu_high_alarm.
