05-08-2018 06:24 AM
Hi,
Is there a way to retrieve the license statistics available and installed?
I tried to recover them through the AXL API made available by cisco but without success.
I retrieve the license number through the following query
SELECT name,value FROM TABLE( FUNCTION LicenseTotals() )
(pkid,name,value,UserValue,DeviceValue)
but I can not recover the number of installed licenses, the number of available licenses and the state of licenses as shown in the administration panel of the Enterprise License Manager.
Thanks in advance
Solved! Go to Solution.
05-08-2018 09:24 PM
Hi Andrea
Just worked it out to a nodejs script to get the stats from api. Ping me via spark if any problem.
var request = require("request");
var options = { method: 'GET',
url: 'https://xxx.xxx.xxx.xxx/elm-resources/license/status',
headers:
{
'cache-control': 'no-cache',
authorization: 'Basic [Your username:password in base64 string]' } };
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
05-08-2018 09:24 PM
Hi Andrea
Just worked it out to a nodejs script to get the stats from api. Ping me via spark if any problem.
var request = require("request");
var options = { method: 'GET',
url: 'https://xxx.xxx.xxx.xxx/elm-resources/license/status',
headers:
{
'cache-control': 'no-cache',
authorization: 'Basic [Your username:password in base64 string]' } };
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
05-09-2018 11:53 PM
Thank you very much Bin, it works.
It was necessary enable Cisco Prime LM Resource Legacy API and Cisco Prime LM Resource API on the device
The PLM API services must be activeted in order to fix the issue.
Run the following commands from PLM CLI.
admin:utils service activate Cisco Prime LM Resource API
Service Manager is running
Cisco Prime LM Resource API[STARTED]
admin:utils service activate Cisco Prime LM Resource Legacy API
Service Manager is running
Cisco Prime LM Resource Legacy API[STARTED]
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide