Hi gavin,
On Thu Mar 04 08:24:26 2010, fatmcgav wrote:
Show quoted text> It would be useful if check_jmx4perl could accept multiple check
> options, so that several checks of the same area can all be checked at
> the same time.
>
> E.g Allow the check of HeapMemory in use, HeapMemory committed and
> HeapMemory max in one check. These results could then all be passed back
> to Nagios in the same result, along with the associated perf data.
The point here is, that a single check can only result a single result
for Nagios, even when multiple checks are combined internally. One could
use aggregate multiple attributes and tell the check to fail if a single
threshold is missed, but then, how do you visualize *which* attribute
fails. IMO its much cleaner and according to the Nagios philosophy to a
have one check per plugin configuration.
If you disagree, there is luckily another option with which you can
optimize the check performance.
JMX::Jmx4Perl provides to ways for so called 'bulk requests':
First you can give the JMX::Jmx4Perl->request() method multiple
JMX::Jmx4Perl::Request objects in which case you can a list of
JMX::Jm4Perl::Response objects as result. The request will be issued
with a single HTTP Request, though and dispatched on the server side.
With this you can call any supported JMX operation within a single
turnaround.
The second possibility has just been introduced for 0.65 (for which the
developer version 0.65 is downloadable) and allows for multiple
attribute reads with a single request. You can give an MBean pattern
(e.g. "java.lang:*") and/or a list of attribute names (e.g.
["HeapMemoryUsage","NonHeapMemoryUsage"]) which all will be fetched with
a single JMX::Jmx4Perl::Request. Please refer to the documentation of
JMX::Jmx4Perl::get_attribute for more details.
So, you are easily able to write your own custom Nagios Plugin with a
couple of Perl Lines with you specific requirement. Maybe I will add a
sample for a Nagios Plugin with fetching multiple attributes as once,
but I won't add it to check_jmx4perl for the reason I mentioned above.
...roland