Advertisement
flwkjlwekjfs

Untitled

Jun 28th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. select
  2. o.name as name,
  3. o.id as object_id,
  4. o.objtype_id as object_tid,
  5. group_concat(INET_NTOA(i.ip))
  6. from
  7. Object as o
  8. inner join
  9. IPv4Allocation as i
  10. on o.id = i.object_id
  11. where
  12. # the object does not have an fqdn
  13. ( select count(object_id) from AttributeValue where attr_id = 3 and object_id = o.id) =0
  14. and
  15. # the object has an ip assigned
  16. ( select count(ip) from IPv4Allocation where object_id = o.id) > 0
  17. and
  18. # the object is a server, vm or switch
  19. ( o.objtype_id = 4 or o.objtype_id = 8 or o.objtype_id = 1504 )
  20. group by
  21. o.id
  22. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement