turbot/oci_insights

Query: compute_instance_by_monitoring

Usage

powerpipe query oci_insights.query.compute_instance_by_monitoring

Steampipe Tables

SQL

with instance_monitoring as (
select
distinct display_name
from
oci_core_instance,
jsonb_array_elements(agent_config -> 'pluginsConfig') as config
where
config ->> 'name' = 'Compute Instance Monitoring'
and config ->> 'desiredState' = 'ENABLED'
)
select
case when m.display_name is null then 'disabled' else 'enabled' end as status,
count(*)
from
oci_core_instance as i
left join instance_monitoring as m on i.display_name = m.display_name
where
i.lifecycle_state <> 'TERMINATED'
group by
status;

Dashboards

The query is used in the dashboards: