Using minion to connect to SQL DB

Hi all,

Was wondering if anyone has ver setup a minion to connect to a SQL DB. Here’s the proposed setup that we want to see is possible. Create a synthetic script that would run an SQL query against the DB then ingest the result of that query into NR.

I think building script would be the easy part but we would need to setup the minion to handle the connection between the DB and New Relic.

Anyone have any suggestions?

Thanks

1 Like

Why bother with the synthetic and the minion if you can simply script fetching the data with a cron job and submit it as events etc using the NR api’s?

There are valid reasons for using synthetics for this, but maybe you don’t need to?

Hi, @chris.molinas: This seems like an ideal application for the Flex integration.

Hi @philweber this could be a viable option.

So we’d need to have the infra agent on the DB and then we’d just need to put the SQL query in the config, correct?

Would you by any chance have a sample of what that would look like in the config?

Thanks

hi @philweber

Actually, now that I think about it. We could write a script for the query and then just use flex to run that script on the DB.

Am I on the right track?

Thanks

The Infrastructure agent does not have to run on the database server; it can run on any host that can connect to the database. Then yes, you can execute a query (or run a script) from the Flex integration. There are many examples in the github repo: https://github.com/newrelic/nri-flex/blob/master/docs/experimental/db.md.