Graph data delivered by SCRIPTS or database QUERIES

On a server, a SCRIPT is executed in BASH and it returns data of my application; how can I store, graph and generate events with this data?.

In the same way I would like to be able to control the data that every time gives me a query about an Oracle/MySql database. How can I store, graph and generate events with this data?