GithubHelp home page GithubHelp logo

ericbla / check_jstat Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 23.0 28 KB

A Nagios plugin to get memory statistics of a Java application using jstat

License: GNU Lesser General Public License v2.1

Shell 100.00%

check_jstat's People

Contributors

alexs77 avatar chrisbaldauf avatar easescript avatar ericbla avatar matsprea avatar matsuu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

check_jstat's Issues

/bin/bash instead /bin/sh

When /bin/sh used, script reports:

check_jstat.sh: 28: /usr/local/lib/nagios/plugins/check_jstat.sh: Syntax error: "(" unexpected

It should be '/bin/bash' in shebang.

Thanks.

Incorrect calc for Heapratio

When calculating the heapmx I believe the calculation should be adding $ygcmx + $ogcmx. When running this we are getting a false positive error stating we are using 147% of heap.

Wrong performance data format

It seems that performance data is not in the expected 'Nagios Plugins' format, which is:

'label'=value[UOM];[warn];[crit];[min];[max]

https://www.monitoring-plugins.org/doc/guidelines.html#AEN200
http://docs.icinga.org/latest/en/perfdata.html#formatperfdata

This makes it hard to graph performance data with 'standard' tools (like pnp4nagios).

I don't see a need for PID in performance data output, so I would suggest this format (split into lines here for better view):

heap=heap-size-used(Bytes)
heap_max=heap-max-size(Bytes)
heap_ratio=%ratio;warning-threshold-%ratio;critical-threshold-%ratio
perm=perm-size-used(Bytes)
perm_max=perm-max-size(Bytes)
perm_ratio=%ratio;warning-threshold-%ratio;critical-threshold-%ratio

JDK 8

In JDK 8, jstat display Metaspace's statistics, but not PermGen's.

monitor java service

Hi
i want to monitor just Java service ps -aux | grep java

when i tried to run this plugin i got this message plz help me out what is the complete command

plugins]# ./check_jstat.sh -s Java
/var/run/Java.pid not found

18.04 ubuntu problem

Locally on the host works ok. When running remotely via nrpe on the monitoring server, the nagiosa shows: CRITICAL: process pid [] seems not to be a JAVA application

cat /etc/nagios/nrpe.d/check_SupportedKafka_memory.cfg
command[check_supportedkafka]=/usr/bin/sudo /etc/nagios/check.d/check_jstat.sh -j SupportedKafka -w 85 -c 95

su - nagios -c "/usr/bin/sudo /etc/nagios/check.d/check_jstat.sh -j SupportedKafka -w 85 -c 95"
OK: jstat process SupportedKafka alive|pid=2979 heap=258802;2097152;12;85;95 perm=46930;1091584;4;85;95

i have in sudoers files
Defaults:nagios !requiretty
nagios ALL=(ALL) NOPASSWD: /etc/nagios/check.d/check_jstat.sh

a try
nagios ALL=(root) NOPASSWD: /etc/nagios/check.d/check_jstat.sh

and the same result :(

edit:
I did a simple test - a check calling jps only. Locally, with sudo, he gives everything. After nrpe remotely only PID jps.
Maybe something with java or a new ubuntu?

Does this still work?

Testing out the plugin and nagios is not accepting the input. Constantly getting 'CRITICAL: Can't get GC statistics' though I've edited the sudoers file. Any suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.