Mk_jolokia question

I am using version 1.2.8p26, and the mk_jolokia plugin that was included with that version.

The mk_jolokia plugin only seems to pass default values to CMK. I have successfully added other checks, and they do showup when I run mk_jolokia command line on the remote server. However, the data does not get imported into CMK, and I am not seeing how to make that happen.

For example, below is one of the custom values to be returned by the plugin, but it does not show up in CMK. Is there something that needs to be configured in CMK to grab this value? Any help appreciated.

<<<jolokia_metrics>>>

8080,java.lang:type=OperatingSystem OpenFileDescriptorCount 134

If anyone is interested… I couldn’t get 1.2.8p26 to work correctly. However, I did get 1.6.0p23.cre to work.

Clearly there are some undocumented tricks. You can do 2 types of searches from the config file.

The normal is just for 1 Attribute like this:
(‘java.lang:type=OperatingSystem’, ‘OpenFileDescriptorCount’, ‘Open File Descriptors’, , False, ‘number’ ),

but you can also do a ‘search’ for matching Attributes

The items in the were the the same from the mk_jolokia.py file - [“path”, “context”]
And I used that example to make it work in the config file:
“tomcat”: [
(“:type=Manager,”, “activeSessions,maxActiveSessions”, None, [“path”, “context”], False),

One issue I encountered was that my ObjectName had 2 “/” in it, and it wouldn’t work calling out a direct attribute, but the search worked. That left me with a really ugly name that was passed to CMK.

So I ended up adding a few search and replace lines in the “def _process_queries(inst, queries):” sub of the mk_jolokia.py file.

def _process_queries(inst, queries):
for mbean_path, title, itemspec in queries:
try:
for item, out_title, value in fetch_metric(inst, mbean_path, title, itemspec):

             item = item.replace(r'TEXT-OUTPUT-YOU-HATE', ' SOME-OTHER-TEXT-OUTPUT')

            yield item, out_title, value
    except (IOError, socket.timeout):
        raise SkipInstance()
    except SkipMBean:
        continue
    except () if DEBUG else Exception:
        continue

Kinda of a hack, but seems to work good.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.