centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
311 stars 274 forks source link

[apps::java::solr::jmx::plugin] How to deploy the jolokia agent to solr #1602

Closed benhartwich closed 1 year ago

benhartwich commented 5 years ago

Hi,

I tried the solr jolokia command, but there is no suitable documentation how and where the jolokia agent has to be deployed to solr and what URL will be given by solr (for the parameter --url). Can anyone please help me out?

This is my check command:

./centreon_plugins.pl --plugin=apps::java::solr::jmx::plugin --mode=cache-usage --url=http://test.xy:8883/solr/jolokia --custommode=jolokia --username=jolokia --password='test123' --debug

Thanks and regards,

garnier-quentin commented 5 years ago

Your solr software is in standalone jvm, a tomcat,... ? You can find information in jolokia website.

benhartwich commented 5 years ago

Solr runs as standalone jvm. I´ve tried the following, but I get the error: can´t get a single value.

java -jar jolokia-jvm-1.6.2-agent.jar --verbose --protocol http --user jolokia --password test123 --host 1.1.1.1 start 27147

garnier-quentin commented 5 years ago

Could you try the mode list-attributes of jmx plugin ?

benhartwich commented 5 years ago

Thanks, but there is no mode list-attributes of the plugin: apps::java::solr::jmx::plugin - or do you mean another centreon plugin?

garnier-quentin commented 5 years ago

Yes. I mean apps::protocols::jmx

benhartwich commented 5 years ago

Thanks, List attributes returns many values and I can see many solr options like solr.default.confdir etc. Also I´m getting such values:

java.lang:type=Memory -- HeapMemoryUsage = {
      committed => 514523136,
      init => 536870912,
      max => 2058027008,
      used => 43158176
    }
garnier-quentin commented 5 years ago

For the heap memory, you should use tomcat for example.

benhartwich commented 5 years ago

I think, I will use the apps::protocols::jmx plugin as the solr plugin doesn´t seem to be compatible with that way. Is there any option to automatically start jolokia agent with solr_opts?

garnier-quentin commented 5 years ago

You can provide me your list attributes result ? Maybe java beans had changed in your solr version. What do you mean by " Is there any option to automatically start jolokia agent with solr_opts" ?

benhartwich commented 5 years ago

To 1) Please find it here: https://pastebin.com/Lw1m5gBT To 2) The jolokia agent needs to be started standalone and manually with the pid of solr like I´ve posted above. Is there any way to automatically start the jolokia agent with the solr itself?

garnier-quentin commented 5 years ago

You can add jolokia directly at the startup of your jvm (i think). I see only 800 lines in your pastebin. It seems too small no ? There is some data missing ?

benhartwich commented 5 years ago

These lines are the complete output of list-attributes. Is there any solr config, which needs to be enabled to get all jolokia values?

garnier-quentin commented 5 years ago

Maybe: https://lucene.apache.org/solr/guide/6_6/using-jmx-with-solr.html

benhartwich commented 5 years ago

Setting ENABLE_REMOTE_JMX_OPTS=true does the trick to enable more values, but it seems that the values of apps::java::solr::jmx::plugin aren´t fetched. The recorded values or too long as to post it anywhere. Can you please name me the attributes / mbeans, which are covered by the both modes of this plugin (apps::java::solr::jmx::plugin)?

garnier-quentin commented 5 years ago

Mbeans begins by 'solr/' Could you post it to wetransfer for example ? Or zip it and send me to my email.

benhartwich commented 5 years ago

I´ve sent you an email.

garnier-quentin commented 5 years ago

I think mbean had changed. The plugin is for version 6.4.2. It seems you are in version 7.3.x.

plugin:
solr/silverstone:id=org.apache.solr.search.LRUCache,type=documentCache -- cumulative_hits = 79
solr/complaints:id=org.apache.solr.search.LRUCache,type=documentCache -- cumulative_hits = 137

your:
solr:category=CACHE,dom1=core,dom2=containers,name=documentCache,scope=searcher -- cumulative_hits = 0
solr:category=CACHE,dom1=core,dom2=assets,name=documentCache,scope=searcher -- cumulative_hits = 0

For request, it had changed also:


plugin:
solr/silverstone:id=org.apache.solr.handler.UpdateRequestHandler,type=/update/csv -- 15minRateRequestsPerSecond = undef

your:
solr:category=UPDATE,dom1=core,dom2=tasks,name=requestTimes,scope=/update/csv -- FifteenMinuteRate = 0

Other mapping attributes:
Mean = avgTimePerRequest
MeanRate = avgRequestsPerSecond
Count = requests
benhartwich commented 5 years ago

Thanks for clarification - is there any chance to implement a version attribute, which can cover this? Or what would be the best option to get it working with solr 7?

garnier-quentin commented 5 years ago

I'm not sure if it's the same mbean:

in solr 6.4.x (there is 2):
solr/complaints:id=org.apache.solr.search.LRUCache,type=documentCache
solr:category=CACHE,dom1=core,dom2=complaints,name=org.apache.solr.search.LRUCache,reporter=_jmx_1036808050,scope=documentCache

in 7.3.x:
solr:category=CACHE,dom1=core,dom2=containers,name=documentCache,scope=searcher

But it seems so. I need to use the second mbean for 6.4.x.

benhartwich commented 5 years ago

OK, thanks - let me know if I should test / try something.

fmattesct commented 1 year ago

Hi, Thanks for your interest in Centreon. Requests for new features and enhancements must be suggested here. Troubleshooting and questions must now be asked here (cf our new issue template.

Thank you for your understanding.