Come join our live training webinar every other Wednesday at 11am PST and hear LogicMonitor experts explain best practices and answer common questions. We understand these are uncertain times, and we are here to help!
The JDBC Active Discovery method is used to detect whether databases are running on certain ports, and to filter them based on responses to SQL queries. It can also be used to create instances based on arbitrary SQL queries, that can be used to collect more detail about objects.
Once you set the Active Discovery method to JDBC, you’ll need to configure the following parameters:
If the Port # List parameter is not defined, then the port number will be retrieved from the device property
(where xxxx is mysql, mssql etc). If this device property is also not defined, then ActiveDiscovery will use these default ports:
Note: If you have not used a default port for your database instance, you must declare the port in this field.
Using the Attributes in Rows discovery type, database services discovered on ports in the port list will be returned as instances if the SQL statement can be executed against them. If filters are defined, only those instances that pass the filters are discovered as instances.
When using this discovery method, the Active Discovery wildvalue returned is the port number.
Assume for the following examples that this database is being discovered on port 3306:
If the JDBC Active Discovery parameters are configured as follows:
The SQL statement will result in a two column table:
One instance will be discovered with a wildvalue of 3306.
Assume that there is one filter defined, and that the Active Discovery parameters are specified as follows:
Since the first attribute meets the filter criteria, one instance is returned with wildvalue 3306.
Since the attributes returned do not meet the filter criteria, no instances will be returned.
Using the Attributes in Columns discovery type, a database service running on a port in the port list will be discovered as an instance if the SQL statement can be executed against it. If filters are defined, only those instances that meet the filter criteria are discovered as instances.
When using the Attributes in Columns discovery type, the Active Discovery wildvalue returned is the port number.
Continuing with the previous example database, assume that there are no filters, and that the Active Discovery parameters are specified as follows:
The SQL statement will result in a one column table:
Assume that there is one filter, and that the Active Discovery parameters are specified as follows:
Since the attribute meets the filter criteria, one instance is discovered with a wildvalue of 3306.
Since the attribute doesn’t meet the filter, no instances are discovered.
When using the database list discovery type, the Active Discovery wildvalue is:
port separator SQLstatementRowResult
Assume that there are two tables in our database:
| Tables_in_test |
| robin_test |
| robin_test_1 |
And you have configured the following Active Discovery parameters:
The following tables are discovered as instances, and they are named as follows:
When using the instance list discovery type, the Active Discovery wildvalue is the result of the SQL statement.
This method, like the database list method, creates instances using information returned from the SQL query and the query must return a single column table with each row value equaling an instance.
Consider the following SQL query:
And the following Active Discovery configuration:
The instances discovered would be 1 and 2.
The instance list discovery type can be used to find objects within a database that can then be further queried by the datasource.
This returns an instance for each entry in the customers table, on each host the datasource is applied to, that responds to the query on the default mysql port of 3306.
The datasource can then use this instance in the main JDBC collector, either in the connection string (if each customer has their own database), or in the query:
select count(orders) from customers where customers.name='##WILDVALUE##'
In This Article