Skip Headers
Oracle® Enterprise Manager Cloud Administration Guide
12c Release 4 (12.1.0.4)

E28814-11
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

34 Chargeback and Metering EMCLI Verbs

This chapter describes the EMCLI verbs used for Chargeback and Metering and provides details on verb names, descriptions, parameters and syntax. Examples of verb output and commands are also provided. This chapter contains the following sections:

34.1 Performing UI Equivalent Chargeback Operations

The section describes EMCLI verbs with which you can perform the same operations you can perform within the Chargeback user interface.

34.1.1 list_chargeback_entity_types

Lists all entity types that Chargeback supports. You can optionally list all entity types and their respective usage mode, or all usage modes that a particular entity type supports.

Syntax

list_chargeback_entity_types
        -[usage_mode]
        -[entity_type="eType"]

Parameters

  • usage_mode–(optional) displays all applicable usage modes for each entity type

  • entity_type–(optional) displays all applicable usage modes for the specified entity type

Examples

list_chargeback_entity_types

Entity Type        Entity Type Display Name
oracle_database    Database Instance
host               Host
list_chargeback_entity_types -usage_mode

Entity Type        Entity Type Display Name        Usage Mode
oracle_database    Database Instance               dbMetered
oracle_database    Database Instance               dbByService
oracle_database    Database Instance               cdbBypdb

host               Host                            hostMetered
list_chargeback_entity_types -entity type="oracle database"

Entity Type        Entity Type Display Name        Usage Mode
oracle_database    Database Instance               dbMetered
oracle_database    Database Instance               dbByService
oracle_database    Database Instance               cdbBypdb

34.1.2 list_chargeback_entities

Lists all entities that have been added to Chargeback; that is, all entities of any type for which charges and metering are calculated.

Syntax

list_chargeback_entities

Examples

Output appears in tabular format and displays the following information for each added entity:

Column Name Column Value
Entity Name acme_db
Entity Guid xrdbyy
Entity Type oracle_database
Creation Date 2014-01-01 00.00.00.0
Parent Entity Name No Parent
Parent Entity Type Not Applicable
Cost Center Name cc1
Charge Plan Name cp1

34.1.3 add_chargeback_entity

Adds an entity instance of a given entity type to Chargeback with the specified usage mode.

Syntax

add_chargeback_entity
        -entity_name="eName"
        -entity_type="eType"
        -usage_mode="uMode"

Parameters

  • entity_name–identifies an entity instance by name currently being monitored by Enterprise Manager that you want to add to Chargeback.

  • entity_type–identifies the entity type of the instance being added.

  • usage_mode–specifies the usage mode; that is, how the entity instance is to be metered. Use the list_chargeback_entity_types verb with the -entity type option to see available usage modes.

Examples

add_chargeback_entity -entity_name="db1" -entity_type="oracle_database" -usage_mode="dbMetered"

Adds the entity db1 to Chargeback, metered by database instance.

34.1.4 remove_chargeback_entity

Removes an entity instance of a given entity type from Chargeback; that is, terminates Chargeback activity on the entity. with the specified usage mode.

Syntax

remove_chargeback_entity
        -entity_name="eName"
        -entity_type="eType"
        -[entity_guid="entity guid"]

Parameters

  • entity_name–identifies an entity instance by name that you want to remove from Chargeback.

  • entity_type–identifies the entity type of the instance being removed.

  • entity_guid–(optional) specifies the globally unique identifier by which the entity is known internally. When there are multiple entities of the same type with the same name, command output lists all such entities with additional details including GUID. Execute the command again, this time using entity_guid instead of the other parameters to correctly identify the intended entity.

Examples

remove_chargeback_entity -entity_name="db1" -entity_type="oracle_database"

Removes the Oracle database entity db1 from Chargeback.

34.1.5 list_charge_plans

Lists all charge plans currently in use in Chargeback. Optionally lists charge plans scheduled for use in the future. Can also optionally list current or future plans by entity type or charge plan details.

Syntax

list_charge_plans 
        [-[entity_type="entity type" -[ all]] 
        -[charge_plan="charge plan name" -[all]] 
        -[ all]]

Parameters

  • entity_type–lists all active charge plans for the specified entity type.

  • charge_plan–lists details about a particular charge plan.

  • all–lists all active and future charge plans in Chargeback, or for a specified entity type, or the details of all active and future versions of the specified charge plan.

Examples

Output appears in tabular format and displays the following information, depending on parameters specified:

Column Name Column Value
Charge Plan Name cp1
Entity Type host
Description Host flat rate plan
Start Date 2014-01-01 00.00.00.0
End Date 2014-02-01 00.00.00.0

34.1.6 assign_charge_plan

Assigns a specified charge plan to an entity of a particular type.

Syntax

assign_charge_plan
        -entity_name="eName"
        -entity_type="eType"
        -plan_name="pName"
        -[entity_guid="entity guid"] 

Parameters

  • entity_name–identifies the entity to which a plan is to be assigned.

  • entity_type–identifies the entity type of the named entity. Charge plans are entity-type specific.

  • plan_name–specifies the name of an existing charge plan to be assigned to the entity.

  • entity_guid–(optional) specifies the globally unique identifier by which the entity is known internally. When there are multiple entities of the same type with the same name, command output lists all such entities with additional details including GUID. Execute the command again, this time using entity_guid instead of the other parameters to correctly identify the intended entity.

Examples

assign_charge_plan -entity_name="db1" -entity_type="oracle_database" -plan_name="plan1" 

Assigns charge plan plan1 to database instance db1 of entity type Oracle Database.

34.1.7 unassign_charge_plan

Removes the charge plan assignment from the specified entity.

Syntax

unassign_charge_plan
        -entity_name="eName"
        -entity_type="eType"
        -[entity_guid="entity guid"] 

Parameters

  • entity_name–identifies the entity from which to remove the plan assignment.

  • entity_type–identifies the entity type of the named entity.

  • entity_guid–(optional) specifies the globally unique identifier by which the entity is known internally. When there are multiple entities of the same type with the same name, command output lists all such entities with additional details including GUID. Execute the command again, this time using entity_guid instead of the other parameters to correctly identify the intended entity.

Examples

unassign_charge_plan -entity_name="db1" -entity_type="oracle_database" -plan_name="plan1" 

Removes the charge plan assignment from database instance db1 of entity type Oracle Database.

34.1.8 list_cost_centers

Lists all cost centers known to Chargeback or cost centers in various hierarchical displays.

Syntax

list_cost_centers
        -[[cost_center_name="cName"]
        -[parent]
        -[children]
        -[top]
        -[leaf]] 

Parameters

  • cost_center_name–identifies a specific cost center for which other options can be specified.

  • parent–displays the cost center parent of the specified cost center.

  • children–lists all children cost centers of the specified cost center.

  • top–displays ancestor cost centers of the specified cost center.

  • displays leaf node cost centers of the specified cost center.

Examples

list_cost_centers

Cost Center Name          Parent Node          Number
     cc1                                       [2,4,0,0]
     cc11                      cc1             [2,2,0,0]
     cc12                      cc1             [0,0,0,0]
     cc111                     cc11            [0,0,0,0]
     cc112                     cc11            [0,0,0,0]

The number column represents number of immediate child cost centers, total child cost centers, number of immediate users, total users, reading left to right.

With the above example as a basis, list_cost_centers verb options appear as follows:

list_cost_centers -cost_center_name="cc11" -parent

Parent Node
    cc1

list_cost_centers -cost_center_name="cc1" -children

Children Nodes
    cc11
    cc12

list_cost_centers -cost_center_name="cc111" -top

Hierarchy
[cc1]----->[cc11]----->[cc111]

list_cost_centers -cost_center_name="cc1" -leaf

Leaf Nodes
    cc111
    cc112
    cc12

34.1.9 assign_cost_center

Assigns a specified cost center to an entity of a particular type.

Syntax

assign_cost_center
        -entity_name="eName"
        -entity_type="eType"
        -cost_center_name="cName"
        -[entity_guid="entity guid"] 

Parameters

  • entity_name–identifies the entity to which a cost center is to be assigned.

  • entity_type–identifies the entity type of the named entity.

  • cost_center_name–specifies the name of an existing cost center to be assigned to the entity.

  • entity_guid–(optional) specifies the globally unique identifier by which the entity is known internally. When there are multiple entities of the same type with the same name, command output lists all such entities with additional details including GUID. Execute the command again, this time using entity_guid instead of the other parameters to correctly identify the intended entity.

Examples

assign_cost_center_plan -entity_name="db1" -entity_type="oracle_database" -cost_center_name="cc1" 

Assigns cost center cc1 to database instance db1 of entity type Oracle Database.

34.1.10 unassign_charge_plan

Removes the cost center assignment from the specified entity.

Syntax

unassign_cost_center
        -entity_name="eName"
        -entity_type="eType"
        -[entity_guid="entity guid"] 

Parameters

  • entity_name–identifies the entity from which to remove the cost center assignment.

  • entity_type–identifies the entity type of the named entity.

  • entity_guid–(optional) specifies the globally unique identifier by which the entity is known internally. When there are multiple entities of the same type with the same name, command output lists all such entities with additional details including GUID. Execute the command again, this time using entity_guid instead of the other parameters to correctly identify the intended entity.

Examples

unassign_cost_center -entity_name="db1" -entity_type="oracle_database" -plan_name="plan1" 

Removes the cost center assignment from database instance db1 of entity type Oracle Database.

34.2 Using Custom Charge Items

The following sections provide some sample commands along with descriptions and examples. These verbs are used in the following circumstances:

  • You would like to meter/charge based on the metric extension/custom configuration that you have defined. Custom charge items can also be used for out of box metrics and target properties. Note that Chargeback only supports metric extensions without key columns.

  • These custom charge items, when created in Chargeback, allow you to meter or charge for the custom item like any existing charge items that are shipped along with a plug-in, such as CPU Utilization. Note that the EM_CBA_ADMIN role is required to access these verbs.

34.2.1 list_charge_item_candidates

Lists the items that can be registered to Chargeback.

Syntax

emcli list_charge_item_candidates 
   -target_type=<target type> 
   -source_data_type=<metric|config|property> 
   -target_name=<target name> 
   -config_name=<config name> 
   -config_data_source=<target name> 
   -all 

Parameters

  • target_type–(required) name of target type. Supported target types include: oracle_database, oracle_vm_guest, host, oracle_pdb, and weblogic_j2eeserver.

  • source_data_type–valid values are metric, config, and property.

  • target_name–if specified, metering and charge data are retrieved only for the named target. If you do not specify a valid target name, or if the specified target has not been enabled in the given date range, then no data is generated. If this parameter is not specified, All targets for the specified target-type are included.

  • config_name–required if source_data_type=config.

  • config_data_source–data source of the configuration. Required if source_data_type=config.

  • all–displays all items, including out of box metrics of target type. Without this option, only user-defined metric extensions, and configuration extensions are displayed.

Examples

emcli list_charge_item_candidates -target_type="oracle_database" -source_data_type="metric" 
emcli list_charge_item_candidates -target_type="oracle_database" -source_data_type="config" -target_name="myDatabase" -config_name="myCustomCCS" -config_data_source="ccsfile"

34.2.2 create_charge_item

Creates a charge item for Chargeback.

Syntax

emcli create_charge_item -input_file="property_file:<full path of property file>" 

Parameters

The option [-input_file] is the full path of a file that contains the item properties. The following properties can be defined in the file:

  • target_type–(required) specifies the target type. Supported target types include: oracle_database, oracle_vm_guest, host, oracle_pdb, and weblogic_j2eeserver.

  • source_data_type–(required) specifies the source data type. Valid values are metric, config, and property.

  • item_name–(required) specifies the name of the item.

  • metric_group–metric group name as listed in list_item_candidates. This is a required property if source_data_type=metric.

  • metric_column–metric column name as listed in list_item_candidates. Required property if source_data_type=metric.

  • config_view–config view name as listed in list_item_candidates. Required property if source_data_type=config.

  • config_key–config key name as listed in list_item_candidates. Required property if source_data_type=config.

  • config_column–config column name as listed in list_item_candidates. Required property if source_data_type=config.

  • config_data_source–data source of configuration metric. Required property if source_data_type=config.

  • property–property name as listed in list_item_candidates. Required property if source_data_type=property.

  • item_displayname–(required) item display name.

  • unit–unit display name.

  • aggregation_type–type of aggregation to use for this item. Applicable only if data type=number. Valid values are sum and avg. Default value is avg.

  • is_config_condition–Is the item used conditionally in a charge plan. Valid values are 0, 1. Default value is 0.

  • item_category–category of item. Default value is instance. Valid values are cpu, storage, memory, network, and instance.

  • data_type–data type. Default value is number. Valid values are string and number.

Examples

emcli create_charge_item -input_file="property_file:/home/user/property_file"
Contents of /home/user/property_file: 
       target_type=host 
       source_data_type=metric 
       item_name=total_proc 
       metric_group=Load 
       metric_column=noOfProcs 
       item_displayname=Total Processes 
       unit=process 
       aggregation_type=avg 
       item_category=instance 
       data_type=number 
emcli create_charge_item -input_file="property_file:/home/user/property_file" 
Contents of /home/user/property_file: 
       target_type=oracle_database 
       source_data_type=config 
       item_name=custom_config 
       config_view=myCustomCCS 
       config_key=region 
       config_column=country 
       config_data_source=regionList.txt 
       item_display_name=Region of Instance 
       item_category=instance 
       data_type=string 

34.2.3 delete_charge_item

Deletes the custom charge item from Chargeback.

Syntax

emcli delete_charge_item  -target_type=<target type> -item_name=<Item name>

Parameters

  • target_type–(required) specifies the target type associated with the custom charge item. Supported target types for this release include oracle_database, oracle_vm_guest, host, oracle_pdb, and weblogic_j2eeserver.

  • item_name–(required) name of the custom charge item to be deleted.

Examples

emcli delete_charge_item -target_type="oracle_database" -item_name="SampleMetricExtension"
emcli delete_charge_item -target_type="host" -item_name="SampleCustomConfig"

34.3 Examples of Custom Charge Item Verb Use

The following sections provide end-to-end examples in the correct use of Custom Charge Item verbs for custom configurations.

34.3.1 Metric Extension (PGA)

In this example, a metric extension "PGA" with a metric column named "PGA Memory" is created for a database instance target to collect PGA size.

Figure 34-1 PGA Memory

metric extension for pga
  1. Log in to EMCLI and use the Chargeback EMCLI verb list_charge_item_candidates to list the items that can be registered to Chargeback.

    Figure 34-2 list_charge_item_candidates

    list_charge_item_candidates
  2. Create a property file prop_file to generate the custom charge item for the PGA Memory metric column.

    For this metric, the charge rate will be based on the average value over a number of samples, with aggregation_type is set to "avg".

    Figure 34-3 Set aggregation_type

    create custom charge item for "PGA Memory"
  3. Create custom item in Chargeback using create_charge_item EMCLI verb.

    Figure 34-4 Create custom item

    create custom item
  4. Once the custom charge item is created, the Charge Plans page shows the new custom item. Rates can be set against custom items similar to those set for out-of-box charge items.

    Figure 34-5 Create Plan: Custom Plan

    create plan: custom plan

    As the aggregation_type is set to "avg", the charge rate is related to a time period (for example, per GB per timeperiod).

    Figure 34-6 Confirmation

    confirmation screen

34.3.2 Metric Extension (Application A Orders)

A metric extension named "Application A Orders" with a metric column called "Orders Processed" is created for a database instance target. This metric collects the number of orders processed by Application A.

Figure 34-7 Metric Extensions

metric extensions
  1. Log in to EMCLI and use the Chargeback EMCLI verb list_charge_item_candidates to list the items that can be registered to Chargeback.

    Figure 34-8 list_charge_item_candidates

    list_charge_item_candidates
  2. Create a property file prop_file2 to generate a custom charge item for the "Orders Processed" metric column.

    For this metric, the charge rate will be based on total number of orders processed, with aggregation_type set to "sum".

    Figure 34-9 Set Aggregation Type

    set aggregation type
  3. Create a custom item in Chargeback using the create_charge_item EMCLI verb.

    Figure 34-10 create-charge_item

    create_charge_item
  4. Once the custom charge item is created, the Charge Plans page shows the new custom item. Rates can be set against a custom item similar to those set for out-of-box charge items.

    Figure 34-11 Set Rates: Custom Plan

    set rates: custom plan

    As the aggregation_type is set to "sum", the charge rate does not depend upon time periods but rather on the total value of "Orders Processed".

    Figure 34-12 Confirmation

    confirmation screen
  5. Add the database target to Chargeback and assign the "Custom Plan".

    Figure 34-13 Cost Center and Charge Plan Assignment

    cost center and charge plan assignments
  6. Following the daily ETL run, the charge/usage is calculated against new custom items. The charge/usage of custom items can be viewed from the Chargeback report page.

    Figure 34-14 Details

    details screen

34.3.3 Configuration Extensions

A configuration extension named "Config Extensions" is created for the database instance target. This collects the number of high available tablespaces and the name of each high available tablespace as shown below. In this example, the high available tablespaces value is used as the basis of the new custom charge item.

Figure 34-15 Configuration Extensions

configuration extensions
  1. Log in to EMCLI and use the Chargeback EMCLI verb list_charge_item_candidates to list the configuration items that can be registered to Chargeback. Note that config_name is the name of the configuration extension shown on the UI ("Config Extensions" in this case). Similarly, config_data_source is the name of the config column shown on the UI (in this case "tmp/dbconfig.xml").

    Figure 34-16 list_charge_item_candidates

    list_charge_item_candidates
  2. Create a property file prop_file1 to generate a custom charge item for the "Number of High Available Tablespaces" metric column.

    Note that the config_key value comes from the output of the "Custom Config Key" column in the output of the list_charge_item_candidates verb described previously. Similarly, the value of the config_view should be the value of "Custom Config Name" above.

    Figure 34-17 Number of High Available Tablespaces

    number of high available tablespaces
  3. Create a custom item in Chargeback using the create_charge_item EMCLI verb.

    Figure 34-18 create_charge_item

    create_charge_item
  4. Once the custom charge item is created, the Charge Plans page shows the new custom item. Rates can be set against a custom item similar to those set for regular out-of-box charge items.

    Figure 34-19 Set Rates: New Plan

    set rates: new plan

    Figure 34-20 Confirmation

    confirmation
  5. Add the database target to Chargeback and assign the "New Plan".

    Figure 34-21 New Plan

    New Plan
  6. After the daily ETL run, the charge/usage is calculated against new custom items. The charge/usage of custom items can be viewed from the Chargeback report page.

34.4 Creating a Generic Entity Type

Enterprise Manager supports an almost limitless number of target types. Only a relatively small number have out-of-box Chargeback support. You can, however, create a custom entity type for an Enterprise Manager target type for which there is no current Chargeback support. There is a one-to-one correspondence of custom entity type to Enterprise Manager target type.

Use the EM CLI verb emcli add_custom_cb_entity_type to identify the custom entity type in terms of an existing target type.

Syntax

add_custom_cb_entity_type -target_type=target_type 

Where target_type is a known Enterprise Manager target type for which there is no current Chargeback support; for example, Oracle Apache.

After creating the custom entity type, customize charge items appropriate to the new entity type, following the process described in Section 34.2.

Charge Item Properties

For example, you might create a custom charge item based on an input property file named properties_oracle_apache where the properties are as follows:

     target_type=oracle_apache 
     source_data_type=metric 
     item_name=active_sessions 
     metric_group=ohs_server 
     metric_column=sessions.active 
     item_displayname=Active Sessions 
     unit=sessions 
     aggregation_type=avg 
     item_category=instance 
     data_type=number

The custom charge item is based on the average number of active sessions.

Implementation

Now proceed as follows:

  1. Create a charge plan for the Oracle Apache entity type that includes the active sessions customized charge item.

  2. Add the Oracle Apache entity type to Chargeback using the Add wizard in the application, as you would for any entity type. The Oracle Apache entity type is available in Target Selector dialog.

  3. Assign the charge plan you created in Step 1 to the Oracle Apache entity type.

  4. Optional. Assign a cost center to the Oracle Apache entity type.

  5. Using the reporting feature to view metering and charge data related to the Oracle Apache entity type.

34.5 Retrieving Metering Data from Enterprise Manager

The Chargeback APIs can be used to integrate Enterprise Manager with Billing and Revenue Management systems (including Oracle BRM). They also provide flexible Chargeback mechanisms. Some examples include:

  • Integration with a billing system with different rate plans for small, medium, and large configurations.

  • To calculate Chargeback for a flexible time period. For example, months starting from 15th and ending on the 15th.

  • To rationalize Chargeback based on other attributes that are not captured by Enterprise Manager.

  • To adjust or round up Chargeback based on usage. For example charge is calculated for the full-day even if the usage is for the partial day.

34.5.1 get_metering_data

Retrieves Chargeback metering data in the form of comma-separated output with each row or line containing usage (and optionally charge) information for the specified parameters.

Syntax

emcli get_metering_data
[-start_date=<start date in mmddyyyy> [-end_date=<end_date in mmddyyyy>]]
[ -target_type=<target type> [-target_name= <target name> ] ]
[ -cost_center=<cost center name> ]
[ -charge] 

Parameters

All parameters of this verb are optional.

  • start_date–specifies the start date in mmddyyy format by which to filter data retrieval, commencing at midnight. Default is the start date of the current report cycle.

  • end_date–specifies the end date in mmddyyy format by which to filter data retrieval, terminating at midnight. Default is the end date of the current report cycle.

  • target_type–specifies the target types by which to filter data retrieval, provided targets of the specified types have been configured for Chargeback within the specified date range. Default is to retrieve data for all targets of all target types that have been configured for Chargeback within the specified date range.

  • target_name–retrieves metering and charge data only for the named target of the specified target type. If the target name is invalid or has not been configured for the specified date range, no data retrieval occurs. The default retrieves data for all targets of the specified target type.

  • cost_center–specifies a cost center name as it appears on the Cost Center tab in Chargeback. Retrieves appropriate metering and charge data provided the cost center name is valid as of the specified date range. Default value is the logged-in user. To retrieve metering and charge data for all cost centers, specify "All Users" (in quotes). Each user is also a consumer (cost center) in Chargeback. The logged-in user's privileges determine metering and charge data retrieved across different targets.

  • charge_–retrieves both metering and charge data. Default retrieves only metering data.

Note:

The privileges required to view target information in Chargeback are:
  • VIEW_CAT_TARGET: Allows you to view information for a specific target (active or inactive).

  • VIEW_ANY_CAT_TARGET: Allows you to view information for any Chargeback target (active or inactive).

34.5.2 Data Retrieval Output

This get_metering_data verb generates the following output:

  • CONSUMER_NAME: Name of the cost-center.

  • TARGET_TYPE: Type of target.

  • TARGET_NAME: Name of the target.

  • ITEM_TYPE: Type of the item or metric. Possible values are: config, fixed, metric, property, and usage.

  • CATEGORY_NAME: Possible values are: cpu, memory, storage, activity, instance, network, service, and software.

  • ENTITY_NAME: Name of the shared entity (valid when the target is enabled in Chargeback in shared mode).

  • ITEM_DISPLAY_NAME: Display name of the item or metric (in English language). Note: Translation support is currently not available.

  • VALUE_AVERAGE: Average value for the metric on the given date (valid for numeric metrics).

  • STRING_VALUE: Value for the metric data (valid for string-based metrics).

  • DATA_TYPE: Data type of the metric. This can be string or number.

  • UNIT: Unit of the metric data (for example, req and GB).

  • COLLECTION_DATE: Date on which the data is collected from the Enterprise Manager metric or configuration tables.

  • PLAN_NAME: Name of the Charge Plan associated with the particular target.

  • CHARGE: Charge value for the specific metric of the target on the particular date.

  • DEFINED_RATE: Charge rate defined in the charge plan associated with the target.

  • RATE_TYPE: Type of the rate. Possible values are: No value (blank), Flat, config, and usage.

  • RATE_FACTOR: Adjustment rate for universal metrics, as defined in the associated extended Chargeplan.

  • CHARGE_RATE_UNIT: Unit, corresponding to the metric or item, as defined in the Charge Plan for the specific rate. For example, for an item or metric named CPU Utilization (%) or CPU Utilization (%) per service, the value will be "CPU". For a metric or item named Base Charge, the value will be "instance", a metric named 'User Requests', the value will be "req"). If the rate defined in Chargeplan is $1 per MB per day, the value for this column will be "MB" .

  • CHARGE_TIME_UNIT: Time unit as defined in the Charge Plan for the specific rate. (such as, hourly, daily, weekly, monthly, yearly). For example, if the rate defined in Charge Plan is $1 per MB per Day, value for this column will be daily.

Example: Sample Output

"CONSUMER_NAME","TARGET_TYPE","TARGET_NAME","ITEM_TYPE","CATEGORY_NAME","ENTITY_NAME","ITEM_DISPLAY_NAME","STRING_VALUE","PLAN_NAME","COLLECTION_DATE","CHARGE","VALUE_AVERAGE","DEFINED_RATE","RATE_TYPE","RATE_FACTOR","CHARGE_RATE_UNIT","CHARGE_TIME_UNIT","NORMALIZE_RATE","ADJUST_RATE","DATA_TYPE","UNIT" 

"linbo","oracle_vm_guest","mySite/myWls/AdminServer:agent_push","fixed","instance"," ","Base Charge","","zone_plan",15-OCT-11 00:00:00,72,1,"3","flat",1,"instance","hourly",1,1,"number",""
"linbo","oracle_vm_guest","mySite/myWls/AdminServer:agent_push","fixed","instance"," ","Base Charge","","zone_plan",16-OCT-11 00:00:00,72,1,"3","flat",1,"instance","hourly",1,1,"number",""
"linbo","oracle_vm_guest","mySite/myWls/AdminServer:agent_push","fixed","instance"," ","Base Charge","","zone_plan",17-OCT-11 00:00:00,72,1,"3","flat",1,"instance","hourly",1,1,"number",""
"linbo","oracle_vm_guest","mySite/myWls/AdminServer:agent_push","fixed","instance"," ","Base Charge","","zone_plan",18-OCT-11 00:00:00,72,1,"3","flat",1,"instance","hourly",1,1,"number",""
"linbo","oracle_vm_guest","mySite/myWls/Cluster-0_vm0:assembly1","fixed","instance"," ","Base Charge","","zone_plan",15-OCT-11 00:00:00,72,1,"3","flat",1,"instance","hourly",1,1,"number","

34.5.3 get_metering_data Examples

Following are examples of verb usage:

  • emcli get_metering_data: Returns metering information for all targets (active or enabled in Chargeback) for the current report cycle for the logged in user.

  • emcli get_metering_data -charge: Returns metering and charge information for all targets (active or enabled in Chargeback) for the current report cycle for the logged in user.

  • emcli get_metering_data -start_date=01202011-cost_center=ORG1: Returns metering information for all targets (active or enabled in Chargeback) starting from 20th January 2011 until the end of the month for the ORG1 cost-center.

  • emcli get_metering_data -start_date=01152011 -end_date=02152011 -target_type=oracle_database: Returns metering information for all Oracle DB targets (active or enabled in Chargeback) that are owned by the logged in user, starting from 15th January 2011 until the 15th February 2011.

  • emcli get_metering_data -target_type=host target_name=my_host -cost_center=organization1: Returns metering and charge information for "my_host" target (of type host) for the current report cycle for "organization1" cost-center.

  • emcli get_metering_data -cost_center="All Users": Returns metering and charge information for all targets (active or enabled in Chargeback) in the current report cycle for all cost centers.

  • Log in as cba_admin_user (who is the Chargeback Administrator) and enter the following commands:

    • emcli get_metering_data: Returns metering information for all targets (active or enabled in Chargeback) for the current report cycle for the cba_admin_user.

    • emcli get_metering_data -cost_center=ssa_user1: Returns metering information for all targets (active or enabled in Chargeback) that are owned by the ssa_user1 in the cost center in the current report cycle.

  • If the value specified for the cost center, target type, and / or target name is incorrect, no data is generated. For example, the following commands will not generate data:

    • emcli get_metering_data -target_type=unknown

    • emcli get_metering_data -target_type=oracle_database -target_name=unknown_target

      Note: There is no target with the name unknown_target configured in Enterprise Manager.