TSQL for database size, data and log available size

What are our databases sizes in SQL Server? How much space is Available? How can I prevent the automatic auto growth of data and log files? How can I be notified if there is not enough space in the log file? It will be really good to consolidate all the SQL servers with their databases…

2