Connected probes

Many probes can share a common connection to get values. For example, JDBC probes use a single connection to the database and do all requests using the same socket, to reduce the load on the server. So when jrds launch a collect, the connection is established once, and each probe will re-use it. The connection is closed at the end of the collect. It's also useful for problem detection. If the connection failed, none all the probes will run.

Each connection is created using the following declaration

<connection type="Class name" >
    <attr name="bean name">value</attr>
    ...
</connection>

For example, to declare a SNMP connection:

<connection type="jrds.snmp.SnmpConnection">
    <attr name="community">public</attr>
    <attr name="port">161</attr>
    <attr name="version">2</attr>
</connection>

It might be necessary to make many connection of the same kind on a server, for example when there is many data base instance on the same server. The attribut name can be given to a connection and the probe will then use it using the connection attribute. For example:

<connection type="jrds.probe.jdbc.JdbcConnection" name="mysql">
    <attr name="user">monitor</attr>
    <attr name="password">password</attr>
    <attr name="url">jdbc:mysql://server</attr>
</connection>
<connection type="jrds.probe.jdbc.JdbcConnection" name="postgres">
    <attr name="user">monitor</attr>
    <attr name="password">password</attr>
    <attr name="url">jdbc:postgresql://server</attr>
</connection>
<probe type="MySqlStatusGeneric" connection="mysql" />
<probe type="PgStatDatabase" connection="postgres">
    <attr name="index">xwiki</attr>
</probe>
 
connectedprobes.txt · Last modified: 2013/04/03 21:26 by root     Back to top