The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

check_jmx4perl - Nagios check using jmx4perl for accessing JMX information

SYNOPSIS

 # Check used heap memory for absolute values
 check_jmx4perl --url http://localhost:8888/j4p \
                --name memory_used \
                --mbean java.lang:type=Memory \
                --attribute HeapMemoryUsage \ 
                --path used \
                --critical 10000000 \
                --warning   5000000 

 # Check used heap memory for absolute values by using an alias
 check_jmx4perl --url http://localhost:8888/j4p \
                --alias MEMORY_HEAP_USED \
                --critical 10000000 \
                --warning   5000000 

 # Check that the used heap memory is below 80% of the available memory
 check_jmx4perl --url http://localhost:8888/j4p \
                --alias MEMORY_HEAP_USED \
                --base MEMORY_HEAP_MAX \ 
                --critical :80

 # Check that no more than 5 threads are started in a minute
 check_jmx4perl --url http://localhost:8888/j4p \
                --alias THREAD_COUNT_STARTED \
                --delta 60 \
                --critical 5

 # Execute a JMX operation on an MBean and use the return value for threshold
 check_jmx4perl --url http://localhost:8888/j4p \
                --mbean jmx4perl:type=Runtime \
                --operation getNrQueriesFor \
                --critical 10 \
                "operation" \
                "java.lang:type=Memory" \
                "gc" 

DESCRIPTION

Command for providing Nagios conmpliant output for JMX response fetched via JMX::Jmx4Perl. It knows about critical (via --critical) and warning (via --warning) thresholds.

Values obtained from the server can be interpreteted as relative values when --base is given. The argument provided here is first tried as an alias name or checked as an absolute, numeric value. Alterntatively, you can use a fulle MBean/Attribute/Path specification by using a / as separator, e.g.

  ... --base java.lang:type=Memory/HeapMemoryUsage/max ...

If one of these parts (the path is optional) contains a slash within it's name, the part must be URI encoded. I.e. all parts are URI decoded before usages as namng pattern. In any case, using an alias or direct MBean names, the base value is fetched first for calculating the relative value. For a numeric value given here this is of course not necessary.

--delta switches on incremental mode in which the difference between two following values is used. The optional argument are interpreted as seconds which are used for calculating the speed of growth. If not given, only the difference between the current and the latest value is taken. --delta doesn't work with --base.

With the option --operation a JMX operation is triggered and the return value used for threshold calculations. Additionally, if use an operation alias with --alias, you can ommit --operation and --mbean. Any arguments required for the operation need to be provided as additional arguments.

LICENSE

This file is part of jmx4perl.

Jmx4perl is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

jmx4perl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with jmx4perl. If not, see <http://www.gnu.org/licenses/>.

AUTHOR

roland@cpan.org