Details
Assignee
UnassignedUnassignedReporter
Michael MichaelMichael MichaelLabels
Components
Affects versions
Priority
Major
Details
Details
Assignee
Unassigned
UnassignedReporter
Michael Michael
Michael MichaelLabels
Components
Affects versions
Priority
PagerDuty
PagerDuty
PagerDuty
Created September 20, 2010 at 11:35 AM
Updated September 21, 2021 at 6:24 PM
When configuring a jdbc-collection for the JdbcCollector, column names must be unique over all queries.
Thus, for queries of this type (needed for MySQL 5.0.x), the values are always persisted in the last mentiones jrb-file (jdbc-datacollection-config.xml):
<queries>
<query name="Uptime" ifType="all" >
<statement>
<queryString>show global status like 'Uptime'</queryString>
</statement>
<columns>
<column name="Value" data-source-name="Uptime" alias="MyUptime" type="GAUGE"/>
</columns>
</query>
<query name="Bytes_received" ifType="all" >
<statement>
<queryString>show global status like 'Bytes_received'</queryString>
</statement>
<columns>
<column name="Value" data-source-name="Bytes_received" alias="MyBytesReceived" type="COUNTER"/>
</columns>
</query>
The Uptime value will be tried to persist in Bytes_received.jrb, along with the real Bytes_received value.
I realize the JdbcCollector is not a part of the "normal" distribution of OpenNMS but it find it very useful and would like to propose the patch I am using to make it work for us. Also, the Component I selected for this Bug is obviously wrong, I had to choose one and chose the one I considered most closely related.
It consists in storing the configuration for the attribType configuration with the data-source-name as a key, falling back to the column name when no data-source-name is specified in the configuration. Part of the code was already in place and seemed to be intended for this use, I just made a small addition.
If this does not contradict intended use for the JdbcCollector, please do consider including the patch for source/features/jdbc-collector/src/main/java/org/opennms/netmgt/collectd/JdbcCollector.java . I made the patch against 1.8.3, but 1.9.1-1 of today seems to give the same result.