Reading host_name and address in .cfg from a database

hi everyone

I’ve just set up nagios and I already have an existing small database with registered hosts (not related with nagios!). Instead of writing configfiles in nagios for every host, I’m wondering if there is a possibility to read the hosts (name and address) from the existing database fields.

I think I have to refer the host_name to a perlscript to query the name, isn’t it? the same with the address.
but now, how can I query all entries like an array?

is anybody using this method?

thanks for your replies

regards
roland