Sensu 检查 jvm 堆不工作

Sensu check for jvm heap not working

我遇到了 sensu-plugins-java 的问题。我已经在我们的服务器中安装了插件,我需要使用 check-java-heap-pcnt.rb 来监控我们服务器中的堆大小,但是当我尝试 [=19 时它没有显示正确的输出=] 本地检查。 这是我尝试 运行 在本地进行检查的方法:

# ./check-java-heap-pcnt.rb -n java -w 70 -c 85 -j /usr/java/defaults/bin/ -p

这是它生成的输出:

    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 -

从下载nagios插件 https://kb.op5.com/display/HOWTOs/Jboss+Monitoring+with+check_jmx

并与 sensu 一起使用。

姓名:- check_jmx

线程缠绕命令:-

./check_jmx -U service:jmx:rmi:///jndi/rmi://'servername':'port'/jmxrmi -O java.lang :type=线程-A ThreadCount -K 9200 -w 250 -c 300

对于堆内存:-

./check_jmx -U service:jmx:rmi:///jndi/rmi://'servername':'port'/jmxrmi -O java.lang :type=Memory -A HeapMemoryUsage -K 使用 -I HeapMemoryUsage -J 使用 -vvvv -w 102400 -c 81290