THE GAME HAS CHANGED

Introducing Infoblox Universal DDI ManagementTM

Watch the launch to discover the new era of management for critical network services. Watch Now

API & Integration, DevOps,NetOps,SecOps

Reply

Get discoverd MAC-ADDRES through WAPI

New Member
Posts: 4
6859     0

Hello,

 

I need to get the Discovered-MAC-ADDRESS parameter through a WAPI query.

I'm using the followoing:   https://172.27.33.10/wapi/v2.7/ipv4address?network=160.220.98.0/24&status=USED&_return_type=xml-pret...

 

but it will return only the mac-address of "MANAGED" networks, I need to get the Discovered-MAC-Address field which is fed by our Network Insight module.

 

I now I need to use the "_return_fields+" option, but I havn't find out which is the xxxx value the get the discovered-MAC-Address, something like

 

https://172.27.33.10/wapi/v2.7/ipv4address?network=160.220.98.0/24&status=USED&_return_type=xml-pret...

 

Thank you

Filippo

 

Re: Get discoverd MAC-ADDRES through WAPI

Moderator
Moderator
Posts: 321
6860     0

The discovered MAC address (along with all the other discovered data) is stored in the discovered_data field  You need to have it return the entire discovered_data field to view the discovered MAC address.

 

Try this one:

 

https://172.27.33.10/wapi/v2.7/ipv4address?network=160.220.98.0/24&status=USED&_return_type=xml-pretty&_max_results=5000&_return_fields%2b=discovered_data

 

 

Re: Get discoverd MAC-ADDRES through WAPI

New Member
Posts: 2
6860     0

Hello, 

 

How can I get all informations on the infoblox based on mac address ? 
( I m using WAPI ) 

I try this one : wapi/v1.2/search -d objtype=lease -d search_string:=00:c0:e4:00:e1:48

 

But It's not working Smiley Sad 

 

Any help please ? 

Re: Get discoverd MAC-ADDRES through WAPI

Moderator
Moderator
Posts: 321
6860     0

Can you elaborate on "all information".  Do you want all lease information, or do you also want to include DNS & DHCP records, or IPAM discovery information?

 

A search request gives lightweight responses and is best when there are lots of responses. 

 

If you know you are looking for a single lease and you have the exact MAC address, you can do a more targeted search for leases.  When you request a specific recorrd type you can also request additional fields to be returned with the results.

 

Below is a curl example that returns more lease information and also Network Insight discovery information.

 

Note that if you're using DHCP Failover you will see two leases per MAC address, that's becaue there's a lease stored for each appliance in the failover assocation.

 

Also I recommend using the most recent API version that is supported in your Infoblox environment.  v1.2 is pretty old and will not support many modern features. WAPI v2.8 is supported on NIOS 8.3 and newer.

 

This search:

 

curl -k -u admin:infoblox -X GET 'https://192.168.1.2/wapi/v2.8/lease?hardware=24:a2:e1:ab:cd:ef&_return_fields%2b=address,network,starts,ends,tstp,binding_state,hardware,uid,discovered_data'

yields this response:

 

[
    {
        "_ref": "lease/ZG5zLmxlYXNlJDAvMTAuOS4xNi4xNC8wLw:192.168.7.14/default",
        "address": "192.168.7.14",
        "binding_state": "STATIC",
        "discovered_data": {
            "device_type": "NetBSD",
            "discovered_name": "my-nas.example.com",
            "discoverer": "Network Insight",
            "first_discovered": 1436552550,
            "last_discovered": 1586205859,
            "mac_address": "24:a2:e1:ab:cd:ef",
            "mgmt_ip_address": "192.168.7.14",
            "netbios_name": "my-nas   ",
            "network_component_description": "Cisco IOS Software, C3560 Software (C3560-IPSERVICESK9-M), Version 12.2(58)SE2, RELEASE SOFTWARE (fc1)  Technical Support: http://www.cisco.com/techsupport  Copyright (c) 1986-2011 by Cisco Systems, Inc.  Compiled Thu 21-Jul-11 01:44 by prod_rel_team",
            "network_component_ip": "192.168.7.27",
            "network_component_model": "catalyst356048PS",
            "network_component_name": "cisco.example.com",
            "network_component_port_description": "FastEthernet0/48",
            "network_component_port_name": "Fa0/48",
            "network_component_port_number": 52,
            "network_component_type": "Switch",
            "network_component_vendor": "Cisco",
            "open_ports": "TCP:139 UDP:",
            "os": "NetBSD 5.0 - 5.99.5",
            "port_duplex": "Full",
            "port_link_status": "Connected",
            "port_speed": "100M",
            "port_status": "Up",
            "port_type": "ethernet-csmacd",
            "port_vlan_name": "default",
            "port_vlan_number": 1
        },
        "ends": 1585389356,
        "hardware": "24:a2:e1:ab:cd:ef",
        "network": "192.168.7.0/24",
        "network_view": "default",
        "starts": 1585346156
    },
    {
        "_ref": "lease/ZG5zLmxlYXNlJDcvMTAuOS4xNi4xNC8wLw:192.168.7.14/default",
        "address": "192.168.7.14",
        "binding_state": "STATIC",
        "discovered_data": {
            "device_type": "NetBSD",
            "discovered_name": "my-nas.example.com",
            "discoverer": "Network Insight",
            "first_discovered": 1436552550,
            "last_discovered": 1586205859,
            "mac_address": "24:a2:e1:ab:cd:ef",
            "mgmt_ip_address": "192.168.7.14",
            "netbios_name": "my-nas   ",
            "network_component_description": "Cisco IOS Software, C3560 Software (C3560-IPSERVICESK9-M), Version 12.2(58)SE2, RELEASE SOFTWARE (fc1)  Technical Support: http://www.cisco.com/techsupport  Copyright (c) 1986-2011 by Cisco Systems, Inc.  Compiled Thu 21-Jul-11 01:44 by prod_rel_team",
            "network_component_ip": "192.168.7.27",
            "network_component_model": "catalyst356048PS",
            "network_component_name": "cisco.example.com",
            "network_component_port_description": "FastEthernet0/48",
            "network_component_port_name": "Fa0/48",
            "network_component_port_number": 52,
            "network_component_type": "Switch",
            "network_component_vendor": "Cisco",
            "open_ports": "TCP:139 UDP:",
            "os": "NetBSD 5.0 - 5.99.5",
            "port_duplex": "Full",
            "port_link_status": "Connected",
            "port_speed": "100M",
            "port_status": "Up",
            "port_type": "ethernet-csmacd",
            "port_vlan_name": "default",
            "port_vlan_number": 1
        },
        "ends": 1585351543,
        "hardware": "24:a2:e1:ab:cd:ef",
        "network": "192.168.7.0/24",
        "network_view": "default",
        "starts": 1585308343
    }
]

 

Re: Get discoverd MAC-ADDRES through WAPI

New Member
Posts: 2
6860     0

Perfect This is what I need. 
Thanks for your help

Showing results for 
Search instead for 
Did you mean: 

Recommended for You