JMX jrb filenames can contain spaces

Description

For a jmx datacollection of:

<mbean name="JVM Perm Memory" objectname="java.lang:type=MemoryPool,name=PS Perm Gen">
<comp-attrib name="Usage" type="Composite" alias="Usage">
<comp-member name="used" alias="PermUsed" type="gauge"/>
<comp-member name="max" alias="PermMax" type="gauge"/>
</comp-attrib>
</mbean>

The datacollection will succeed, but attempting to graph it will fail since the filename contains spaces:
java_lang_type_MemoryPool_name_PS Perm Gen.jrb

A potential fix would be to modify fixGroupName() in opennms-services/src/main/java/org/opennms/netmgt/collectd/JMXCollector.java and include a space as a character it replaces with an underscore.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Alejandro Galue November 3, 2013 at 8:55 AM

The revision c7cb8b8e223580480426d586d017c9734a544971 for 1.12 contains what I suggested and much more.

1.12.2 is going to have a new feature called "post-install/upgrade tools". It contains a tool for JMX designed to fix all the existing JRBs/RRDs as well as the JMX data collection configuration files and graph templates.

Even if the tools have JUnit tests and were properly tested with real migrations, please create a full backup of your configuration file and JRBs/RRDs prior upgrade.

Alejandro Galue October 7, 2013 at 10:45 AM

Thanks!

I agree, and it covers basically all possible corner cases by changing all non alphanumeric characters into "_" (which is used by the SnmpCollector).

Ron Roskens October 4, 2013 at 10:18 PM

I like the solution inside . I think that should be used instead of just adding \s to the conversion list.

Alejandro Galue October 4, 2013 at 3:28 PM

I've added a very detailed procedure that expose the naming problem on for review.

Of course, all the ideas about the external tool to fix the names (based on my proposal), and any additional idea or use case that I'm missing will be very welcome.

Alejandro Galue October 4, 2013 at 3:02 PM

This is going to fix one particular use case not all the use cases reported with the JMX collector for all possible combinations of RRD strategies.

My question for your solution is: what happen with the existing working JRBs/RRDs and all their combinations depending on storeByGroup ?

Here is why I'm asking:

On , I've provided a solution that fixes basically all possible problems, but requires to create an external tool to fix the current existing JRBs/RRDs to keep historic data. That's why I haven't committed the fix on our repo. On that issue (), I also attached the initial proposal for the JRB/RRD fix.

My fix also cover the following issues: , , , (this one), and

Actually, the proposal for the external tool also expose another problem: how to apply or execute post-install scripts to do non-db related stuff ? the JMX naming issue is one of them, the MAC on the SNMP Interfaces for 1.12 when upgrading from 1.10 is another use case.

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

PagerDuty

Created April 18, 2011 at 12:17 PM
Updated October 12, 2023 at 4:30 PM
Resolved October 4, 2013 at 2:18 PM