SQL has ~32K limit on connections. Is there a built-in alarm that monitors the number of connections to a database instance?
we do not have a groovy tutorial, but you can find details about groovy on the groovy webpage.
We have some tutorials how to customize Foglight by creating your own dashboards, queries and/or reports, for example the web component guide and tutorial or the dashboard guide or the data model guide.
But I do not know if those will help you, you can have a quick look.
If you have a specific question and you cannot find anything in those docs, in our knowledge base or in another forum thread or blog post, I would recommend to raise new thread and describe exactly what you want to do. There are a lot of technical consultants following this forum and they will be able to provide the needed code snippet.
I hope this helps.