I have it working again for version 1.06. Here is my new 'diff -u'
--- SingleCheck.pm.old 2012-11-02 14:35:31.000000000 -0400
+++ SingleCheck.pm.new 2012-11-02 14:39:38.000000000 -0400
@@ -194,10 +194,12 @@
# Performance data. Convert to absolute values before
my ($critical,$warning) =
$self->_convert_relative_to_absolute($base_value,$self->critical,$self->warning);
- $np->add_perfdata(label => $label,value => $value,
+ if ( $label ne "__NONE__" ) {
+ $np->add_perfdata(label => $label,value => $value,
critical => $critical,warning => $warning,
min => 0,max => $base_value,
$self->unit ? (uom => $self->unit) : ());
+ }
# Do the real check.
my ($code,$mode) = $self->_check_threshold($rel_value);
# For Multichecks, we remember the label of a currently failed check
@@ -209,9 +211,11 @@
} else {
# Performance data
$value = $self->_sanitize_value($value);
- $np->add_perfdata(label => $label,
+ if ( $label ne "__NONE__" ) {
+ $np->add_perfdata(label => $label,
critical => $self->critical, warning =>
$self->warning,
value => $value,$self->unit ? (uom => $self->unit)
: ());
+ }
# Do the real check.
my ($code,$mode) = $self->_check_threshold($value);
@@ -228,6 +232,7 @@
my $code = shift;
my $label = $self->{config}->{name} || $self->{config}->{key};
+ if ($label eq "__NONE__") { $label = $self->{config}->{key}; }
if ($label) {
my $arr = $error_stat->{$code} || [];
push @$arr,$label;
Paul Dubuc wrote:
Show quoted text> Hello Roland,
> Is there a new way to specify no performance data output in version 1.06? I'm
> testing that version. I tried adding this change that I used in version 0.91
> and it works but the label "__NONE__" is also printed on the plugin (status line) output
> line for the check when there is an error. So this is not a good solution
> anymore.
>
> Thanks,
> Paul Dubuc
>
> Paul Dubuc wrote:
>> Roland,
>> I made a small change to SingleCheck.pm of version 0.91 to implement this
>> feature and it has been working fine. Here is the diff:
>>
>> 161c161,162
>> < $np->add_perfdata(label => $label,value => $value,
>> ---
>> > if ( $label ne "__NONE__" ) {
>> > $np->add_perfdata(label => $label,value => $value,
>> 164a166
>> > }
>> 175c177,178
>> < $np->add_perfdata(label => $label,
>> ---
>> > if ( $label ne "__NONE__" ) {
>> > $np->add_perfdata(label => $label,
>> 177a181
>> > }
>>
>> If you choose to do it a different way in the next version, I will change my
>> configs. But I would like to upgrade to the latest jmx4perl so we can use the
>> newer version of jolokia.
>>
>> Thanks,
>> Paul Dubuc
>>
>> Roland Huss via RT wrote:
>>> <URL:
https://rt.cpan.org/Ticket/Display.html?id=75062 >
>>>
>>> You are right, this sounds like a useful addition. There will be probably a
>>> 'NoPerformanceData' directive or so for single checks (or as you suggest a
>>> specific label value for indicating to skip performance data which would have
>>> the advantage that it can be used with placeholders).
>>>
>>> I will consider this for 1.0.5
>>>
>>> Thanks ....
>>> ... roland
>>> On Thu Feb 16 11:05:50 2012, PMDubuc wrote:
>>>> A great feature of the check_jmx4perl plugin is the use of
>>>> Multichecks.
>>>> Multiple checks can be done with one run of the plugin and status and
>>>> alerting
>>>> is done for all at once. Performance data is also output for each
>>>> check. I
>>>> think there should be some way to specify in the Check configuration
>>>> that the
>>>> performance data not be output. This is so that data collection and
>>>> graphing
>>>> utilities will not collect and try to store graph unwanted data. Not
>>>> all
>>>> performance data is equally valuable like thread deadlock checks or
>>>> other
>>>> binary failure conditions but the plugin prints performance data for
>>>> all.
>>>>
>>>> One good way to implement this feature might be to set the "Name" of
>>>> the
>>>> performance data to some value like "__NONE__" to specify that no
>>>> performance
>>>> data should be output for the check.
>>>>
>>>> I am using jmx4perl 0.91 with perl 5.10.0. on SuSE Linux:
>>>> Linux mrldev36 2.6.32.46-0.3-default #1 SMP 2011-09-29 17:49:31 +0200
>>>> x86_64
>>>> x86_64 x86_64 GNU/Linux
>>>>
>>>> Thank you,
>>>> Paul Dubuc
>>>
>>
>