2 Replies Latest reply on Sep 18, 2015 2:46 AM by storniga

    DHCP Scope Options

    storniga

      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

        • Re: DHCP Scope Options
          storniga

          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

           

           

          • Re: DHCP Scope Options
            storniga

            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