sensu-plugins / sensu-plugins-java

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

Sensu check for jvm heap not working #14

Closed rohan1202 closed 6 years ago

rohan1202 commented 7 years ago

I am facing issues with sensu-plugins-java. I have installed plugin in our server and I need to use check-java-heap-pcnt.rb to monitor the heap size in our server, but it is not showing proper output when I try to run the check locally. Here's how I tried to run the check locally:

# ./check-java-heap-pcnt.rb -n java -w 70 -c 85 -j /usr/java/defaults/bin/ -p Here's the output it generated:

    invalid argument count
Usage: jstat -help|-options
       jstat -<option> [-t] [-h<lines>] <vmid> [<interval> [<count>]]

Definitions:
  <option>      An option reported by the -options option
  <vmid>        Virtual Machine Identifier. A vmid takes the following form:
                     <lvmid>[@<hostname>[:<port>]]
                Where <lvmid> is the local vm identifier for the target
                Java virtual machine, typically a process id; <hostname>is
                the name of the host running the target Java virtual machine;
                and <port> is the port number for the rmiregistry on the
                target host. See the jvmstat documentation for a more complete
                description of the Virtual Machine Identifier.
  <lines>       Number of samples between header lines.
  <interval>    Sampling interval. The following forms are allowed:
                    <n>["ms"|"s"]
                Where <n> is an integer and the suffix specifies the units as 
                milliseconds("ms") or seconds("s"). The default units are "ms".
  <count>       Number of samples to take before terminating.
  -J<flag>      Pass <flag> directly to the runtime system. 
(standard_in) 1: syntax error 
MEM UNKNOWN -

Maybe I am not using the correct syntax pattern. Please guide me as i need to monitor the jvm heap size for my production server.

majormoses commented 7 years ago

@rohan1202 what version of java (jstat) are you using?

majormoses commented 7 years ago

also looks like you specified -p without actually giving the process id, is that a copy/paste error?

majormoses commented 7 years ago

We just merged and release a bunch of changes, can you please use the latest and confirm this does not fix your issue?

majormoses commented 6 years ago

closing due to inactivity.