Forum Discussion

lionx's avatar
lionx
Icon for Helper I rankHelper I
3 years ago

How to get data from Cisco Switches?

Hi everyone,

I am trying to find out a way for getting data from Cisco Switches, but there is not much information for this.

I'm not sure whether I can create a data gateway for this.

Would you give me any solutions or suggestions?

I'm really appreciate your time and support.

3 Replies

    • lionx's avatar
      lionx
      Icon for Helper I rankHelper I

      amitchandak  Thank you for your response.

      I have seen any available API even I have tried to get through de API Documents from Cisco Cisco API Documentation - Cisco DevNet

      Are there any other solutions like directly connecting to database? 

      What I need to do is extracted the data "Resorce Utilization" & "System Health" from Cisco Switch 

       

    • lionx's avatar
      lionx
      Icon for Helper I rankHelper I

      Hi amitchandak 

      I have found that I can access data I need through Cisco Rest API. I have set up and tested the API. The API work well when I try query with Curl. The syntax as follows:

      curl -X GET https://30.10.543.65/api/v2/nodes -H "Accept: application/json" -H "Authorization: Bearer eyJwMyYiJ9.eyJpclciI6I30.lkAwbsfmNzA"

       

      Now I try to create a Power Query Connector using Json Web Token (JWT) for authentication. The Curl snippet for query data is:
      curl -k -H "Authorization: Bearer SIGNED_JWT" "https://30.10.543.65/api/v2/nodes/?fields=/system-state/basic&page=0&size=20&sort=ip,asc&type=Device&hostname=switch8"

       

      However, I don't know how to work with JWT Authentication in Power Query. would you help me with this please? My power query connector starts as follows:

       

      // This file contains your Data Connector logic
      section CiscoSwitch;

      [DataSource.Kind="CiscoSwitch", Publish="CiscoSwitch.Publish"]
      shared CiscoSwitch.Contents = Web.Contents("https://30.10.543.65", [ApiKeyName="api_key"])

      // Data Source Kind description
      CiscoSwitch = [
      Authentication = [
      // Key = [],
      // UsernamePassword = [],
      // Windows = [],
      Implicit = []
      ],
      Label = Extension.LoadString("DataSourceLabel")
      ];