Morten_hyperic
Contributor
Contributor

Adding DB2 drivers to sqlquery-plugin.jar

Is it feasible to add the DB2 JDBC drivers to the sqlquery-plugin.jar, change the hq-plugin.xml file to include the DB2 driver, rename the service and deploy as a new plugin in a hq-plugins directory. I am not exactly sure what is in the SQLQueryMeasurementPlugin.class but it is probably generic jdbc database access setup, so as long as you pass it the driver name and it can be found by the DriverManager things should work.

I am guessing that plugins are loaded by their own classloader and only service name has to be unique to aviod conflict
0 Kudos
1 Reply
dougm_hyperic
VMware Employee
VMware Employee

We will look into bundling the db2 driver with sqlquery-plugin.jar,
it should be straightforward just as you described.
In the meantime, there is a way you can do this without modifying the
existing plugin.
First, drop the DB2 driver.jar into the agent's pdk/lib/ directory.
Then, based on these docs:
http://support.hyperic.com/confluence/display/DOCSHQ27/SQL+Query+Plugin

You can configure the default jdbcDriver like so:
<config>
<option name="jdbcDriver"
default="com.ibm.db2.jcc.DB2Driver"
description="JDBC Driver Class Name"/>
</option>

<option name="jdbcUrl"
description="JDBC Connection URL"/>
default="jdbc:db2://<host>:<port50000>/<database>"/>

<option name="jdbcUser"
description="JDBC User"/>

<option name="jdbcPassword"
type="secret"
optional="true"
description="JDBC Password"/>
</config>

I'll see if we can get sqlquery-plugin.jar to include DB2.

On Nov 14, 2006, at 8:21 PM, Morten wrote:

> Is it feasible to add the DB2 JDBC drivers to the sqlquery-
> plugin.jar, change the hq-plugin.xml file to include the DB2
> driver, rename the service and deploy as a new plugin in a hq-
> plugins directory. I am not exactly sure what is in the
> SQLQueryMeasurementPlugin.class but it is probably generic jdbc
> database access setup, so as long as you pass it the driver name
> and it can be found by the DriverManager things should work.
>
> I am guessing that plugins are loaded by their own classloader and
> only service name has to be unique to aviod conflict


0 Kudos