JDBC Monitor

From OpenNMS

Contents

Overview

The JDBC monitor checks that it is able to connect to a given JDBC URL and that it is able to get the database catalog from that URL.

Configuration

The JDBC monitor takes the following parameters:

driver 
The JDBC driver to use. Defaults to "com.sybase.jdbc2.jdbc.SybDriver".
url 
The JDBC url to connect to. Defaults to "jdbc:sybase:Tds:host/tempdb".
user 
The username to connect as. Defaults to "sa".
password 
The password to connect with. Defaults to "".
timeout 
How long to wait for a connection in milliseconds. Defaults to "3000".
retries 
how many times to retry upon failure or timeout. Defaults to "0".

Example

Capsd Configuration

First, to be able to detect the database properly, you need to configure capsd-configuration.xml to find it, like so:

 <protocol-plugin protocol="Sybase-JDBC" class-name="org.opennms.netmgt.capsd.plugins.JDBCPlugin" scan="on">
   <property key="user" value="sa"/>
   <property key="password" value="XXXX"/>
   <property key="retry" value="3"/>
   <property key="timeout" value="5000"/>
   <property key="driver" value="com.sybase.jdbc2.jdbc.SybDriver"/>
   <property key="url" value="jdbc:sybase:Tds:OPENNMS_JDBC_HOSTNAME:4100/tempdb"/>
 </protocol-plugin>

(note, if you're on OpenNMS 1.2 or earlier, the JDBCPlugin is at "org.opennms.netmgt.capsd.JDBCPlugin" instead of "org.opennms.netmgt.capsd.plugins.JDBCPlugin".)

Poller Configuration

Then, to monitor it, you configure poller-configuration.xml like so:

 <service name=”Sybase-JDBC” user-defined=”false” interval=”6000″ status=”on”>
   <parameter key=”user” value=”sa”/>
   <parameter key=”password” value=”XXXX”/>
   <parameter key=”timeout” value=”3000″/>
   <parameter key=”driver” value=”com.sybase.jdbc2.jdbc.SybDriver”/>
   <!– jdbc:sybase:Tds::/ –>
   <parameter key=”url” value=”jdbc:sybase:Tds:OPENNMS_JDBC_HOSTNAME:4100/tempdb”/>
 </service>
 <monitor service=”Sybase-JDBC” class-name=”org.opennms.netmgt.poller.monitors.JDBCMonitor”/>

(and again, if you're on OpenNMS 1.2 or earlier, the JDBCMonitor is at "org.opennms.netmgt.poller.JDBCMonitor" instead of "org.opennms.netmgt.poller.monitors.JDBCMonitor".)

See Also

External Links

Version History/Availability

Personal tools
DevJam 2008 Sponsors
DevJam 2008 Sponsor: Google
DevJam 2008 Sponsor: Netregistry
DevJam 2008 Sponsor: Papa John's
NewEdge Networks
OpenNMS takes home the gold award!
Join the Free Software Foundation
Support This Project Commercial OpenNMS Support OpenNMS Italia Get OpenNMS at SourceForge.net. Fast, secure and Free Open Source software downloads Our Network Simulator Our Java Profiler