Get XMC licenses via script or Rest-API

  • 0
  • 1
  • Question
  • Updated 1 month ago
  • Answered
Hello,

is there a way to get the current licenses via script or REST-API?

I need the info how many End-Systems for NAC are licensed to proceed in another script.
If I can get the license string it's easy do find out that value.

Or is there another place where I can find the information how many end systems for NAC are licensed?

Best regards
Stephan
Photo of SH

SH

  • 4,112 Points 4k badge 2x thumb

Posted 1 month ago

  • 0
  • 1
Photo of Bharathiraja, Suresh

Bharathiraja, Suresh, Employee

  • 3,526 Points 3k badge 2x thumb
Hi SH,

Current ES count updated in NAC manager ---> configuration tab-->  license status.

if you right click on a appliance and go to web view ---> End system authentication status , where we can see how many ES are managed during last 24 horus.


Thanks,

Suresh.B




Photo of SH

SH

  • 4,112 Points 4k badge 2x thumb
Hello Suresh,

thank you for you fast replay. But I need the info in an script/python program, because of I will process the license information in an script.

Best regards
Stephan


Photo of Bharathiraja, Suresh

Bharathiraja, Suresh, Employee

  • 3,526 Points 3k badge 2x thumb
Hi Stephan,

Could you share your python script which will look for license file ? if you have one already.

The license file is located in below location but we have to use the pointer to locate below file.


root@xmc52.extremenetworks.com:/usr/local/Extreme_Networks/NetSight/appdata/license$ ls
NetSightEval.lic

Thanks,
Suresh.B





Photo of SH

SH

  • 4,112 Points 4k badge 2x thumb
Thank you very much Suresh,

that's what I need. I had forgotten that there is this file.

I have no python script up to now, because I needed first the info how I can get the license :-).
Photo of Bharathiraja, Suresh

Bharathiraja, Suresh, Employee

  • 3,526 Points 3k badge 2x thumb
Hi Stephan,

Sure ,

Please share us the status once you able to get the info by using Python.

Thanks,
Suresh.B


Photo of SH

SH

  • 4,112 Points 4k badge 2x thumb
Hello Suresh,

here a little Python script working for me:

Best regards
Stephan

import re
import sys


#open license file
try:
	f = open('/usr/local/Extreme_Networks/NetSight/appdata/license/NacEnterprise.lic', 'r')
except IOError:
    print "Can't open license file"
    sys.exit(0)

#sum single licenses	
licenses = 0

for x in f:
	reg = re.search(r"IA-ES-([13]|12)K", x)
	lic = reg.group(1)
	lic = int(lic) * 1000
	licenses = licenses + lic

#print sum of single licenses
print licenses
Photo of SH

SH

  • 4,112 Points 4k badge 2x thumb
Hello Alexander,

thank you for you hint.

I love the Rest(SOAP)-API but the report_web_services are quite complex (for me).
Because of you have to figure out the correct data types Therefore to read the license info from the mentioned file is much easier.

But you hint with GraphiQL is a good alternative.

Best regards
Stephan
Photo of James A

James A, Embassador

  • 6,962 Points 5k badge 2x thumb
Is there any documentation on the GraphiQL interface?
Photo of SH

SH

  • 4,112 Points 4k badge 2x thumb
Hello James,

I do not know a printed documentation. But I think all you need is here:

GraphiQL for testing and documentation

https://<xmc-ip-address>:8443/nbi/graphiql/index.html

GraphQL schema

https://<xmc-ip-address>:8443/nbi/graphql/schema.idl

GraphQL API

https://<xml-ip-address>:8443/nbi/graphql

Have fun!

Best regards
Stephan
Photo of Alexander Kurakin

Alexander Kurakin, Employee

  • 90 Points 75 badge 2x thumb
For the XMC version I use there are two links that gave me some intro into the GraphQL:

https://XMC:8443/nbi/graphql/schema.idl
https://XMC:8443/nbi/graphiql/index.html (make sure to open the panel on the right side):
https://i.snag.gy/l6txLk.jpg
(Edited)