Permalink
Browse files

Bug fixes around perfdata

* Fixed for RT#47244 (https://rt.cpan.org/Public/Bug/Display.html?id=47244)
* Fixed for RT#54971 (https://rt.cpan.org/Public/Bug/Display.html?id=54971)
* Fixed for RT#43533 (https://rt.cpan.org/Public/Bug/Display.html?id=43533)
* Fixed for RT#56702 (https://rt.cpan.org/Public/Bug/Display.html?id=56702)
* Updated output so that nagios can show what the current value of a given
  check is rather than displaying "NG"
  • Loading branch information...
1 parent 77c2415 commit ef84fa2a46c2a2d0e030a07fcd9089736e66a387 @justino committed Jul 20, 2012
Showing with 21 additions and 468 deletions.
  1. +8 −0 Changes
  2. +13 −9 lib/Nagios/Plugins/Memcached.pm
  3. +0 −459 lib/Nagios/Plugins/Memcached.pm-new
View
@@ -1,5 +1,13 @@
Revision history for Nagios-Plugins-Memcached
+0.03 2012-07-20 14:38
+ * Fixed for RT#47244 (https://rt.cpan.org/Public/Bug/Display.html?id=47244)
+ * Fixed for RT#54971 (https://rt.cpan.org/Public/Bug/Display.html?id=54971)
+ * Fixed for RT#43533 (https://rt.cpan.org/Public/Bug/Display.html?id=43533)
+ * Fixed for RT#56702 (https://rt.cpan.org/Public/Bug/Display.html?id=56702)
+ * Updated output so that nagios can show what the current value of a given
+ check is rather than displaying "NG"
+
0.02 2007-12-11 17:04
* Fixed for RT#31354 (http://rt.cpan.org//Ticket/Display.html?id=31354)
* Fixed for RT#29894 (http://rt.cpan.org/Public/Bug/Display.html?id=29894)
@@ -16,11 +16,11 @@ Nagios::Plugins::Memcached - Nagios plugin to observe memcached.
=head1 VERSION
-version 0.02
+version 0.03
=cut
-our $VERSION = '0.02';
+our $VERSION = '0.03';
=head1 SYNOPSIS
@@ -48,7 +48,7 @@ Please setup your nagios config.
### check cache hit ratio(get_hits/cmd_get[%]) for memcached
define command {
command_name check_memcached_hit
- command_line /usr/bin/check_memcached -H $HOSTADDRESS$ --hit-warning 40 --size-critical 20
+ command_line /usr/bin/check_memcached -H $HOSTADDRESS$ --hit-warning 40 --hit-critical 20
}
This plugin can execute with all threshold options together.
@@ -267,12 +267,12 @@ sub check_time {
critical => $args->{critical}
);
- $self->add_message( $code, "Time checked: NG" ) if ( $code > OK );
+ $self->add_message( $code, "Time checked: " . sprintf( "%.4f", $stats->{time} * 1000 ) . 'ms') if ( $code > OK );
$self->add_perfdata(
label => 'time',
value => sprintf( "%.4f", $stats->{time} * 1000 ),
- uom => '[msec]',
+ uom => 'ms',
threshold => $self->threshold
);
}
@@ -300,13 +300,13 @@ sub check_size {
critical => $args->{critical}
);
- $self->add_message( $code, "Size checked: NG - at $host" )
+ $self->add_message( $code, "Size checked: " . sprintf( "%.2f", $use_size ) . "% - at $host" )
if ( $code > OK );
$self->add_perfdata(
label => 'size',
value => sprintf( "%.2f", $use_size ),
- uom => '[%]',
+ uom => '%',
threshold => $self->threshold
);
}
@@ -341,13 +341,13 @@ sub check_hit {
critical => sprintf( '@0:%d', $args->{critical} )
);
- $self->add_message( $code, "Hit checked: NG - at $host" )
+ $self->add_message( $code, "Hit checked: " . sprintf( "%.2f", $hits ) . " hits - at $host" )
if ( $code > OK );
$self->add_perfdata(
label => 'hits',
value => sprintf( "%.2f", $hits ),
- uom => '[%]',
+ uom => '%',
threshold => $self->threshold
);
}
@@ -437,6 +437,10 @@ sub normalize_host {
Toru Yamaguchi, C<< <zigorou@cpan.org> >>
+=head1 CONTRIBUTORS
+
+Justin La Sotten, C<< <justinl@cpan.org> >>
+
=head1 BUGS
Please report any bugs or feature requests to
Oops, something went wrong.

0 comments on commit ef84fa2

Please sign in to comment.