Java jvm堆的Sensu检查不工作
我面临着sensu插件java的问题。我已经在服务器上安装了插件,我需要使用check-java-heap-pcnt.rb来监控服务器上的堆大小,但是当我尝试在本地运行检查时,它没有显示正确的输出。 以下是我如何尝试在本地运行检查:Java jvm堆的Sensu检查不工作,java,ruby-on-rails,jvm,sensu,Java,Ruby On Rails,Jvm,Sensu,我面临着sensu插件java的问题。我已经在服务器上安装了插件,我需要使用check-java-heap-pcnt.rb来监控服务器上的堆大小,但是当我尝试在本地运行检查时,它没有显示正确的输出。 以下是我如何尝试在本地运行检查: # ./check-java-heap-pcnt.rb -n java -w 70 -c 85 -j /usr/java/defaults/bin/ -p 以下是它生成的输出: invalid argument count Usage: jstat -he
# ./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 -
参数计数无效
用法:jstat-help |-options
jstat-[-t][-h][[]
定义:
由-options选项报告的选项
虚拟机标识符。vmid采用以下形式:
[@[:]]
其中是目标的本地vm标识符
Java虚拟机,通常是进程id;是
运行目标Java虚拟机的主机的名称;
和是上RMI注册表的端口号
目标主机。请参阅jvmstat文档以获取更完整的信息
虚拟机标识符的说明。
标题行之间的样本数。
采样间隔。允许使用以下表格:
[“ms”|“s”]
其中是一个整数,后缀将单位指定为
毫秒(“ms”)或秒(“s”)。默认单位为“ms”。
终止前要采集的样本数。
-J直接传递到运行时系统。
(标准_in)1:语法错误
未知成员-
从下载nagios插件
和感官一起使用
名称:-检查jmx
对于线程CONND命令:-
/检查jmx-U服务:jmx:rmi:///jndi/rmi://'servername':'port'/jmxrmi-ojava.lang:type=Threading-A ThreadCount-k9200-w250-c300
对于堆内存:-
/检查jmx-U服务:jmx:rmi:///jndi/rmi://'servername':'port'/jmxrmi-O java.lang:type=Memory-A HeapMemoryUsage-K used-I HeapMemoryUsage-J used-vvv-w 102400-c 81290您安装了什么版本的jstat?@Frap感谢您的回复。jstat版本是指java版本吗?如果是这种情况,那么我当前的java版本从1.8.0_25到1.8.0_111不等。