cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Extreme Management NBI Query Stacking

Extreme Management NBI Query Stacking

CSchneider-Weic
New Contributor

Hello,

 

I am trying to automat some processes for documentation with scripts. I am looking for a NBI query which gives back the model and Serial numbers of a Summit Stack. Can someone help me?

 

Kind regards

Christoph Schneider

1 ACCEPTED SOLUTION

StephanH
Valued Contributor III

Hello Christoph,

unfortunately there is no official guide for Python Scripting with XMC. But you can find many official examples under Task -> Scripts and Workflows not only the VLAN scripts.

More examples can also be found here: https://github.com/extremenetworks

For your concrete problem here a small example (quick and dirty) how to query a switch  (XOS only!) and then output the serial numbers.

 

import re


#Send CLI commands
def sendConfigCmds(cmds):
for cmd in cmds:
cli_results = emc_cli.send( cmd )
if cli_results.isSuccess() is False:
print 'CLI-ERROR: ' + cli_results.getError()
return False

return cli_results.getOutput()

#Use allways a main function in XMC
def main():
commands = []
commands.append("show version")


result = sendConfigCmds( commands )

if result:
result_lines = result.splitlines()


for line in result_lines:
match = re.search("Slot.*?:",line)
if match:
line_parts = line.split()
if len(line_parts) > 2:
print("Serial: " + line_parts[3])
#Start program
main()

Here is what you will see with ā€œshow versionā€:

Slot-1 sw001 # show version
Slot-1 : 800601-00-18 8914N-46722 Rev 18 BootROM: 1.0.2.1 IMG: 22.7.1.2
Slot-2 : 800601-00-18 8912N-46755 Rev 18 BootROM: 1.0.2.1 IMG: 22.7.1.2

 

Here is the output:

Serial: 8914N-46722

Serial: 8912N-46755

 

Hope that helps.

 

Regards Stephan

View solution in original post

11 REPLIES 11

StephanH
Valued Contributor III

Hello,

from the XMC point of view, a stack is just one device, no matter how many switches are attached to it. Therefore you won't find any information about stack members anywhere in the XMC (only if you create your own FlexViews and ask MIBs). Correspondingly also not in the NBI.

The only possibility, I see, is to ask the switches directly. You can simply create a script or a workflow that reads the information directly from the switches (stacks) via CLI. 

If you need the data externally, you can send it by mail or store it on a file on a network share that is connected to the XMC.

Surely not as nice as query this externally with the NBI. But it works.

 

Regards Stephan

Miguel-Angel_RO
Valued Contributor II

This is all youā€™ll be able to get from NBI.

Mig

CSchneider-Weic
New Contributor

Thanks again. But still only information over the primary node.

Miguel-Angel_RO
Valued Contributor II

Christoph,

 

I donā€™t have Summit stack to test it, check withthis if you find something:

{

  network{devices {

    id

    chassisId

    deviceData {

      addEnableAuthOnAccess

      addSyslogServer

      addToGroup

      addToNacGroup

      addToNetsight

      addToPolicyDomain

      addToSiteArchive

      addToSiteMap

      addTrapServer

      addZtpPlus

      apCount

      archiveId

      assetTag

      bootProm

      chassisId

      chassisMac

      checkRmaConfiguration

      companyName

      connectedIpAddress

      connector

      createDeviceTime

      currentlicenseKey

      defaultSiteId

      defaultSitePath

      details

      deviceASN

      deviceDisplayType

      deviceId

      deviceSitePrecedence

      disconnectPrecedence

      dnsServer

      dnsServer2

      dnsServer3

      dot1qMaxVlanId

      enableCollection

      enforceNeeded

      ezConfigComplete

      ezConfigCompleteError

      ezConfigCompleteOrPending

      ezConfigCompleteWithoutError

      ezConfigConfigFailed

      ezConfigConnect

      ezConfigImageUpgrade

      ezConfigPreReg

      ezConfigReadyToSendConfig

      ezConfigRma

      ezConfigRmaFailed

      ezConfigStaged

      ezConfigState

      ezconfig

      fabricAttachEnable

      fabricAttachRole

      fabricDvrDomainId

      fabricDvrRole

      fabricEnable

      fabricIpV4Shortcuts

      fabricIpV6Shortcuts

      fabricIsisIpSourceAddress

      fabricIsisIpV6SourceAddress

      fabricManualArea

      fabricMulticastEnable

      fabricName

      fabricNickName

      fabricPrimaryBVlan

      fabricSecondaryBVlan

      fabricSystemId

      fabricSystemName

      fabricTopologyType

      fabricType

      family

      firmware

      firstSeenTime

      gateway

      groupId

      hasVendorProfileChanges

      ipAddress

      jsonVendorProfile

      lacp

      lacpLogging

      lastEnforce

      lastEnforceUser

      lastLicenseUpdateTime

      lastSeenTime

      lastUpdate

      lldp

      lldpLogging

      macAddress

      mapId

      mgmtInterface

      mgmtInterfaceOutOfBand

      mgmtInterfaceVlan

      mvrp

      mvrpLogging

      nacApplianceGroup

      nacJsonParameters

      name

      newController

      nickname

      nosId

      note

      ntpServer

      ntpServer2

      ospf

      ospfLogging

      outOfService

      physicalPortCount

      poe

      poeLogging

      policyDomain

      pollGroup

      pollType

      prefix

      preregistrationCreator

      preregistrationTimestamp

      productName

      profileId

      profileName

      regionDomain

      registerSyslogReceiver

      registerTrapReceiver

      replacementSerialNumber

      rmaConfigured

      serialNumber

      siteId

      snmpRetry

      snmpTimeout

      source

      spanningTree

      spanningTreeLogging

      stacking

      stackingLogging

      statisticsCollectionLevel

      status

      subFamily

      syncChangedSnmpField

      syncDesiredFabricDvrLeafModeBoot

      syncDesiredVlansToCurrent

      sysContact

      sysDescr

      sysLocation

      sysName

      sysObjectId

      sysObjectIdName

      timesSeen

      topologyRole

      userData1

      userData2

      userData3

      userData4

      vendor

      vxlan

      vxlanLogging

      wirelessController

      ztpAllowComputeSite

      ztpCLIRecoveryModeOnly

      ztpConfigImport

      ztpDnsSearchSuffix

      ztpDomainName

      ztpLastPollIntervalInMs

      ztpPlusCachedConfigurationHashCode

      ztpPlusCachedFullConfigurationHashCode

      ztpPlusHttpEnabled

      ztpPlusHttpsEnabled

      ztpPlusLldpHoldTime

      ztpPlusRequestConfig

      ztpPlusSnmpEnabled

      ztpPlusSshEnabled

      ztpPlusTelnetEnabled

      ztpScheduledConfigureDate

      ztpScheduledConfigurePending

      ztpScheduledConfigureTime

      ztpScheduledConfigureType

      ztpScheduledDownloadDate

      ztpScheduledDownloadPending

      ztpScheduledDownloadTime

      ztpScheduledDownloadType

      ztpUseDiscoveredMode

    }

  }}

    }

Mig

CSchneider-Weic
New Contributor

Hello Mig,

 

thank you for your answer but this query only gives back the Information for the primary node of the stack.

 

Kind regards

Christoph Schneider

GTM-P2G8KFN