How do I get the current CPU utilization of a host

20.9.6 How do I get the current CPU utilization of a host

SQL> SELECT column_label, value
  2    FROM mgmt$metric_current
  3   WHERE metric_name = 'Load'
  4     AND metric_column = 'cpuUtil'
  5     AND target_name = 'dba';
COLUMN_LABEL            VALUE
----------------------- -------
CPU Utilization (%)     .77
SQL>

获取一台主机上所有监控信息

SELECT DISTINCT metric_group_label as metric_group,
                metric_column_label metric_name,
                nvl(warning_threshold, ' ') as warning_threshold,
                nvl(critical_threshold, ' ') as critical_threshold,
                decode(mc.is_enabled, 1, 'Yes', 0, 'No') is_enabled,
                emc.entity_type
  FROM sysman.gc_metric_columns_target emc,
       (SELECT policy_guid metric_guid,
               NVL(warn_threshold, ' ') warning_threshold,
               NVL(crit_threshold, ' ') critical_threshold,
               coll_name
          FROM sysman.mgmt_policy_assoc_cfg_params
         WHERE object_guid IN
               (SELECT target_guid
                  FROM sysman.mgmt_targets
                 where (target_name, target_type) in
                       (SELECT a.target_name, a.target_type
                          FROM mgmt$target a
                         where host_name = 'dba'))
           AND param_name = ' ') thr,
       sysman.MGMT_COLLECTIONS mc
 WHERE (entity_name, entity_type) in
       (SELECT a.target_name, a.target_type
          FROM mgmt$target a
         where host_name = 'dba')
   AND usage_type = 0
   and entity_guid = mc.object_guid
   and thr.coll_name = mc.coll_name
   AND emc.metric_column_guid = thr.metric_guid(+)
 order by metric_group asc;

很多How To

This entry was posted in Em & Oem. Bookmark the permalink.