cancel
Showing results for 
Search instead for 
Did you mean: 

Device and port status querying XMC NBI

Device and port status querying XMC NBI

farmanni
New Contributor

Hi,

I just made a simple script using NBI explorer that gives back device name and status and port ID:

query {
  network {
    devices {
      up
      sysName
      deviceData {
        ports {
          portAdmin
          ifIndex
          }
      }
    }
  }
}

Now i would add port status (up/down), i tried with portAdmin, but it gives back the adiministrative status.

In the library there is a value IfOperStatus (like SNMP), but i dont know how to put this variable in the script, it is not accepted in any place of the structure.

Can anybody help me ? I’m a newby in programming..

1 ACCEPTED SOLUTION

yas1
New Contributor II

Hi farmanni,

Have a look into the DeviceEntityData. It provides the ifOperStatus and ifAdminStatus.

{
  network {
    devices {
      up
      sysName
      entityData {
        allPorts {
          ifIndex
          ifOperStatus
          ifAdminStatus
          ifSpeed
        }
      }
    }
  }
}

 

bfc4faf9b7ca49e7a684afed13b934af_f950efc0-a1ba-48c5-8adf-0fa316d0bdde.png

 

View solution in original post

2 REPLIES 2

farmanni
New Contributor

Thanks a lot, it works 

yas1
New Contributor II

Hi farmanni,

Have a look into the DeviceEntityData. It provides the ifOperStatus and ifAdminStatus.

{
  network {
    devices {
      up
      sysName
      entityData {
        allPorts {
          ifIndex
          ifOperStatus
          ifAdminStatus
          ifSpeed
        }
      }
    }
  }
}

 

bfc4faf9b7ca49e7a684afed13b934af_f950efc0-a1ba-48c5-8adf-0fa316d0bdde.png

 

GTM-P2G8KFN