Install JDBC Driver on Horizon Core
To detect, poll, or collect any JDBC service, you must install the appropriate JDBC driver.
-
Download the JDBC driver JAR file from a repository (for example, a public Maven repository) or from the database vendor.
-
Install the JAR file in
${OPENNMS_HOME}/lib/
. -
Restart Horizon.
Test an installed JDBC driver
Connect to the Karaf shell
ssh -p 8101 admin@localhost
Attempt an ad hoc collection using the database driver
collect org.opennms.netmgt.collectd.JdbcCollector 127.0.0.1 driver=org.mysql.jdbc.Driver collection=MySQL-Global-Stats-51 url=jdbc:mysql://OPENNMS_JDBC_HOSTNAME:3306/test
If the JDBC driver is not available or the driver classname is incorrect, the collect command returns an error
Collect failed with: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unable to load driver class: java.lang.ClassNotFoundException: org.mariadb.jdbc.Driver