Alex Panzarella
ServiceNow Employee

TLDR Answer: Pretty easy if you put in a couple hours to learn basic JavaScript

Why use custom license metrics?

Publisher Packs and Common Metrics account for the majority of a customers environment and software spend, but sometimes smaller publishers have their own unique licensing. This is where creating custom license metrics fill the gap. The information we’ll need to create a custom license metric is the publisher license definition and some basic JavaScript knowledge.

Example

Shank posted a question on the community forum looking for help with a custom license metric and I thought what better way to understand the custom license metric functionality than by helping a customer. Shank was trying to license the publisher Cohesity with a product licensed based on the storage size of the device to the terabyte (TB). By googling "Cohesity" and "terabyte licensing" I was able to identify the license definition from the Publisher which enables me to whiteboard the license logic.

Steps

  1. Navigate to Software Asset > Administration > Custom License Metrics
  2. Select New
  3. Input License Metric name
    • “Per 1TB Capacity”
  4. Whiteboard license logic
    • When a software installation of the product is found count the disk space of the computer to the nearest terabyte in the cmdb_ci_computer table
    • Since the computer disk space value is in GB we'll need to convert it into TB by dividing by 1000
  5. Code your logic in JavaScript
    • getrights();
    • function getrights(){
    • var rights = -1;
    • var device = new GlideRecord('cmdb_ci_computer');
    • if(device.get(entity)){rights = device.getValue('disk_space');
    • }
    • return rights/1000;
    • }
    • find_real_file.png
  6. Discover Software Installs
    • We manually imported two installs of Cohesity DataProtect using import sets and transform maps
    • Video link (3min) on importing data and normalization
  7. Create a Software Model
    • Publisher = Cohesity
    • Product = DataProtect
    • Version = Anything
    • Edition = Anything
  8. Create a Software Entitlement
    • Software Model = Cohesity DataProtect
    • Metric Group = Custom
    • License Metric = Per 1TB Capacity
  9. Run Reconciliation
  10. Results
    • Pic 1 - License Workbench showing Cohesity DataProtect licensed by Per 1TB Capacity having two installs being counted toward the license amount. 4 rights are consumed by Server-A and 1 right consumed by VM-A.find_real_file.pngPic 2 - Shows Server-A computer details having a disk space of 3,500GB. 3,5000GB is equivalent to 3.5 terabytes which is then rounded to the nearest whole terabyte of 4.find_real_file.png

  

Disclaimer: This blogpost and script is solely for demonstration purposes. The opinions expressed in this publication are those of the authors and do not necessarily reflect the views of ServiceNow.

9 Comments
Marc Farmen
ServiceNow Employee

Great post Alex!

Erick22
Kilo Explorer

SAM managers and IT executives and highlights how to build a successful strategy to or focused primarily on simple per-device licensing metrics will offer little in  management and asset reports as well as the ability to easily create custom .Thanks for the information keep sharing such informative post keep suggesting such post.

 

myprepaidcenter.com

Alex Panzarella
ServiceNow Employee

Let me know if you have any license metrics that I can take a look at creating!

Md rabi
Giga Contributor

I noticed license metric "PER GIG" is missing in servicenow. It would be helpful if it get added.

mikewhalley1
Tera Expert

Fantastic post, Alex. This example is particularly useful for measuring Splunk license compliance.

Srikant Singh2
Tera Contributor

Hi Alex ,

 

Can we create license metric without scripting . I have created custom license metric as "Per Hour" , but when we have imported the software entitlement against that specific metric , it's showing error . 

 

We manually selected metric group as custom ,license metric field should show one of the custom metric in drop down as "Per Hour" but this is not happening(Per Hour is not reflecting).

 

What can be the issue ?

Winny
Tera Contributor

Hi Alex,

 

I would like to create a custom license metric for Oracle Golden Gates.
Is there any sample script to calculate Oracle Golden Gate (per processor)?
I don't know where to get the number of processor cores. I was wondering if you could share a reference.

 

The licensing logic is as follows
 ▶️ Number of processor cores x 0.5 (Core Factor)

 

Kind regards,

mchristiansen
Tera Contributor

what is the best way to  create a custom license metric where there are 3 licenses available per user?  ie 1 user, 3 computer devices is ok.    

BradP-InnoSolv
Tera Expert
 

 

__PRESENT