Custom SAM License Metric using Resource Value for more than one product
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2025 12:26 PM
I am working with some of our IBM Mainframe products which all have the same calculation needed based on raw data entry. I successfully created the code in a custom license metric to do the calculation for one test product. What I want to know is, if it is possible to use the same calculation and metric for more than one product. Instead of passing a sys_id of the RV entry as the sample code suggests I tried querying the RV table for all the Resource Value records with a specific name - however it is returning the same calculation for both even though each units Consumed is different:
Setup:
1. Custom Metric called "Mainframe VU" - queries the RV table for entries with this as the name, then grabs the units_consumed and goes through and if/than/else statement to do the proper calculation.
2. Created two entitlements and two RV entries for different products. RV entry 1 has 4 as the units_consumed and RV entry 2 has 67
When I run reconciliation it shows the same usage in the workspace for both. I want to try to avoid having to create four separate custom metrics when the calculation is all the same, just not sure how to accomplish this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
I want to help investigate this... You have the logic in the custom License Metric - looking up the RV's data by name and calculating based on that? Would you be willing to share your script so we can jointly check the logic?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
Thank you for reaching out, I appreciate it. I think that was what I was trying - figuring out which entitlement it was processing and then trying to use that to find the corresponding resource value record - I can't find my code from before I created separate ones per product - but talking about again I made another attempt this morning - but now it doesn't seem to be getting into the custom metric code at all - its returning 0 for required licenses for both:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
This is what I am using when doing separate ones - not sure how to get the info of the entitlement it is processing to know which RV record to get:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
I figured it out - just you responding pushed me to dig again and I figured it out 🙂 For anyone else here - don't discount and wipe out the sample code immediately:
