sensu-plugins / sensu-plugins-java

Sensu Java Plugins
http://sensu-plugins.io
MIT License
5 stars 25 forks source link

Feature Request: supporting other jdks and pid sourcing #6

Closed brettswift closed 7 years ago

brettswift commented 8 years ago

I can't seem to use this as is to profile the heap on a Puppet Enterprise (2016.1.x) for two reasons.

  1. I need opendjk installed, and it could work if you configured an optional secondary jps command.
    • ex -j /opt/puppetlabs/server/apps/java/lib/jvm/java/bin/jps
    • or -j could be the java bin path.
  2. jps doesn't actually return something usable. There isn't a single process. For some reason they're all named "main" mostly, as you see below:
/opt/puppetlabs/server/apps/java/lib/jvm/java/bin/jps
11472 main
5584 main
4128 main
3539 activemq.jar
13525 Jps
27461 main

I could get the pid from a pid file optionally as well:

[root@devcorepptl918 ~]# cat /var/run/puppetlabs/puppetserver/puppetserver
27461

But this seems like a lot of conditionals just for the puppet master.

My question is - would you be open to some changes here? I'm new to using jps and jstat, so maybe you have an easier fix. My suggestions would complicate this file quite a bit - maybe beyond where I'd even want to take it.

It'd be easier for me to use your script and hack up a one-off, but thought I'd raise the question of a PR. :)

majormoses commented 7 years ago

closed per: #8