This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

DHCP Scope Options

Hello everyone,

I would like to create a report that delivers a list of all DHCP Scopes and the scope options:

Capture.JPG

Can anyone please help me with the query? The output should contain the name of the DHCP Server, the name and address range of the Scope and the Scope Options

  • So, i tried the following:

    select dhcp.FriendlyName as 'DHCP Server', g.FriendlyName as 'Subnet Name', scope.* from IPAM_Group g

    left outer join [IPAM_DhcpScopeDetails] scope on  (g.GroupId = scope.SubnetId)

    left outer join IPAM_DhcpServerDetails DHCPServer on (DHCPServer.NodeId = scope.NodeId)

    left outer join IPAM_Group dhcp on (DHCPServer.GroupId=dhcp.GroupId)

    left outer join IPAM_GroupAttrData d on (g.GroupId=d.GroupId)

    where g.GroupType in ('8');

    This gives me a list of Subnets + DHCP Server + all from IPAM_DHCPScopeDetails - but the output doesn't contain any of the DHCP scope optiones

    emoticons_sad.png

  • UPDATE: So i found out the name of the table is IPAM_DhcpOptionsValue, so i did this:

    select dhcp.FriendlyName as 'DHCP Server', g.FriendlyName as 'Subnet Name',g.Address,g.CIDR, opt.Code as 'ScopeOptionCode', opt.Value as 'ScopeOption'

    from IPAM_Group g

    left outer join [IPAM_DhcpScopeDetails] scope on  (g.GroupId = scope.SubnetId)

    left outer join IPAM_DhcpServerDetails DHCPServer on (DHCPServer.NodeId = scope.NodeId)

    left outer join IPAM_Group dhcp on (DHCPServer.GroupId=dhcp.GroupId)

    join IPAM_DhcpOptionsValue opt on (scope.OptionId=opt.OptionId)

    where g.GroupType in ('8')

    order by g.FriendlyName;

    which offers the desired output of Server -+ Subnet + Scope Options

  • This helped me a lot. Thanks!

    For anyone interested, I have modified it to SWQL:

    select dhcp.FriendlyName as [DHCP Server], g.FriendlyName as [Subnet Name] from IPAM.GroupNode g

    left outer join IPAM.DhcpScope scope on (g.GroupId = scope.SubnetId)
    left outer join IPAM.DhcpServer DHCPServer on (DHCPServer.NodeId = scope.NodeId)
    left outer join IPAM.GroupNode dhcp on (DHCPServer.GroupId=dhcp.GroupId)
    left outer join IPAM.GroupNodeAttr d on (g.GroupId=d.GroupId)

    where g.GroupType in ('8');