Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_java_threads

Rating
0 votes
Favoured:
0
Current Version
1.0
Last Release Date
2015-08-14
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI
Owner
License
GPL
Hits
10285
Files:
FileDescription
check_java_threads.pyThe plugin file
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
This plugin is meant to analyze every java process running locally and take metrics about which state each thread of this process has. It can (or can not) output a nagios-like output formatting for chart creation, and can also save automatically the thread dump to a file in case a determined type of thread is detected.
LONG DESCRIPTION:

This plugin is meant to analyze every java process running locally and take
metrics about which state each thread of this process has. It can (or can not)
output a nagios-like output formatting for chart creation, and can also save
automatically the thread dump to a file in case a determined type of thread
is detected.

- usage: check_java_threads.py [options]

IMPORTANT: As java process thread dumping must be done by the process owner, this plugin relies on the "su - login" shell feature. This said, you must either run it as root or with sudo privileges, otherwise you possibly won't get the expected behavior.

If must at least set where your JAVA_HOME is and which login is the JAVA_OWNER of the desired java process to monitor. You should also define the thread state (stat_alert, default: STUCK) which you want to alert you and the minimum number of thread occurences for that alert (min_stat_alert, default: 0) for acting as a threshold.

You can supress the nagios output format (the after '|' vars) with the -q or --quiet option. For saving a thread dump every time a interesting state is detected use the -c or --capture option.

If your JDK is not supported by this plugin, feel free for editing it and getting it to work. Any upgrade/improvement/suggestion is really welcomed.

SHORT DESCRIPTION:

Run this plugin for nagios metrics and alerts when you have one or more stuck threads on a running java process. Use -c/--capture for saving a thread dump when a threshold is reached and -q if you don't want nagios chart creation.

Compatibilities:
* GNU/Linux
* JRockit (any up to 1.6.x)
* Hotspot (any up to 1.8.x)
* Python (2.4 or bigger up to 2.x)

Author: Marcelo Varge
(marcelo.varge@gmail.com)