6 Replies Latest reply on Jan 10, 2020 4:43 AM by Brice-Emmanuel Loiseaux

    Discover Cisco Phones through REST.

    Nicholas Lane
      Share This:

      Hello all!

       

           Attached is a TPL that I created and tested in our DEV environment. The purpose of this TPL is to navigate via REST to the Cisco IP Phone's web interface and extract the table information to create a Network Device node.

       

      Now... normally for a network device node to be created you would and should need a DDD node to supply all necessary information. However, our environment does not allow for SNMP/SSH/ect.. access to these devices. This TPL is a way around that and is able to grab the serial number, mac address, IP address, vendor, model info, and any other information that would be displayed on the web interface (additional information would have to be set within the TPL to map to an attribute).

       

      Regex is used to extract table information for the left and right table info. There is logic in place to find a table value and count to find the array position to determine the corresponding value.

       

      e.g.

       

           find mac address in table and grab position

                          [serial, name, mac address, model, ip address]

       

           the number returned would be 2. The other table would have the corresponding values.

                          [aiu223589, phonename, MAC2389754285, cp-7820g, 192.168.1.1]

       

      the value 2 would be used to pull the index 2 from the array and link the two together.

       

      mac address  - MAC2389754285

       

      I don't want to go super in depth as the code is attached. However, if anyone has any questions... I would be happy to assist.

       

       

      The TPL is setup to not only create a network device node for the phones... It is also able to create both the IP address node as well as the network interface node and relate them correctly. These all have synced properly into the CMDB and have the correct relationships. The category, type, and tier is also setup to display properly. However, this TPL alone will not allow for the categorization to be mapped properly since the network device node was not intended for IP phones this way. The TPL CMDB.NetworkDevice_ComputerSystem will need to be modified to have this information

       

      56             elif device.type matches regex "IP Phone" then

      57

      58                 primary_capability := CDM_Capability_Type.IP_Phone;

       

       

      The TPL CMDB.Host_ComputerSystem will also need some tweaking as to ensure that your "IP Phone" text is all capitalized the same as all the other TPLs.