Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- o.name as name,
- o.id as object_id,
- o.objtype_id as object_tid,
- group_concat(INET_NTOA(i.ip))
- from
- Object as o
- inner join
- IPv4Allocation as i
- on o.id = i.object_id
- where
- # the object does not have an fqdn
- ( select count(object_id) from AttributeValue where attr_id = 3 and object_id = o.id) =0
- and
- # the object has an ip assigned
- ( select count(ip) from IPv4Allocation where object_id = o.id) > 0
- and
- # the object is a server, vm or switch
- ( o.objtype_id = 4 or o.objtype_id = 8 or o.objtype_id = 1504 )
- group by
- o.id
- ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement