Skip to content

Commit

Permalink
Merge pull request #717 from wayyoungboy/3.2.0-update
Browse files Browse the repository at this point in the history
add task to check tenant resource pool configuration, if the cpu or m…
  • Loading branch information
frf12 authored Jan 26, 2025
2 parents 37ac10d + 594a347 commit 0186f98
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions plugins/check/tasks/observer/tenant/tenant_min_resource.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
info: 'Check tenant resource pool configuration, if the cpu or memory is less than 2C4G, it will be reported.'
task:
- version: "[4.0.0.0,*]"
steps:
- type: sql
sql: ' SELECT GROUP_CONCAT(DISTINCT T4.TENANT_ID)
FROM DBA_OB_RESOURCE_POOLS T1
JOIN DBA_OB_UNIT_CONFIGS T2 ON T1.UNIT_CONFIG_ID = T2.UNIT_CONFIG_ID
JOIN DBA_OB_UNITS T3 ON T1.RESOURCE_POOL_ID = T3.RESOURCE_POOL_ID
JOIN DBA_OB_TENANTS T4 ON T1.TENANT_ID = T4.TENANT_ID
WHERE T4.TENANT_ID>1 AND T2.MAX_CPU < 2 OR ROUND(T2.MEMORY_SIZE/1024/1024/1024,2) < 4 ;'
result:
set_value: too_small_tenant
verify: '[ -z "$too_small_tenant" ]'
err_msg: 'there tenant resource pool configuration is less than 2C4G, please check it. tenant_id: #{too_small_tenant}'

0 comments on commit 0186f98

Please sign in to comment.