2017-02-23 7 views
2

Ich habe Probleme mit sensu-plugins-Java. Ich habe Plugin in unserem Server installiert und ich muss check-java-heap-pcnt.rb verwenden, um die Heap-Größe in unserem Server zu überwachen, aber es zeigt keine korrekte Ausgabe, wenn ich versuche, die Prüfung lokal auszuführen. Hier ist, wie ich versucht, die Kontrolle lokal auszuführen:Sensu check für jvm Heap funktioniert nicht

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

Hier ist die Ausgabe, die es erzeugt:

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 - 
+0

Welche Version von Jstat haben Sie installiert? – jaxxstorm

+0

@Frap Danke für die Antwort. Mit Jstat-Version meinst du die Java-Version? Wenn das der Fall ist, variiert meine aktuelle Java-Version von 1.8.0_25 bis 1.8.0_111. –

Antwort

0

die Nagios-Plugins herunterladen von https://kb.op5.com/display/HOWTOs/Jboss+Monitoring+with+check_jmx

und mit sensu verwenden.

Name: - check_jmx

Für Gewinde cound Befehl: -

./check_jmx -U Service: JMX: rmi: /// jndi/rmi: // 'Server': 'Hafen'/jmxrmi -O java.lang: type = Threading -A Thread -K 9200 -w 250 -c 300

für Heap-Speicher: -

./check_jmx -U Service: JMX: rmi: /// jndi/rmi: // 'Servername': 'Port'/jmxrmi -O java.lang: type = Speicher -A HeapMemoryUsage -K verwendet -I HeapMemoryUsage -J verwendet -vvvv -w 102400 -c 81290