Page 1 of 1

check_jmx state

Posted: Sun Sep 20, 2020 11:20 pm
by mansonli
What're possible states of check_jmx return? How to send out alert if state is changed except "connection refused"?

Re: check_jmx state

Posted: Mon Sep 21, 2020 3:10 pm
by cdienger
Nagios is only concerned with 4 states:

https://assets.nagios.com/downloads/nag ... inapi.html

"connection refused" is not a state but is output that a plugin can return with a state(exit code).

If you wish to change the state that is returned with a message, then you'd need to either modify the plugin or use a wrapper script to call the plugin, inspect the results, and make any necessary modifications. The /usr/local/nagios/libexec/negate plugin is an example plugin that can be used to change the state and output of a plugin, but it only does this based on the state returned by the called plugin and not by the output.