From 866810dc0a409ce77ea604c262e9bb89623c07e2 Mon Sep 17 00:00:00 2001 From: Quentin Garnier Date: Sun, 27 Jul 2014 18:03:31 +0200 Subject: [PATCH] Add a closure --- centreon-plugins/centreon/plugins/values.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/centreon/plugins/values.pm b/centreon-plugins/centreon/plugins/values.pm index f2231a3af..fb7d360e0 100644 --- a/centreon-plugins/centreon/plugins/values.pm +++ b/centreon-plugins/centreon/plugins/values.pm @@ -118,8 +118,8 @@ sub calc { sub threshold_check { my ($self, %options) = @_; - if (defined($self->{closure_custom_threshpld})) { - return &{$self->{closure_custom_threshold}}($self); + if (defined($self->{closure_custom_threshpld_check})) { + return &{$self->{closure_custom_threshold_check}}($self, %options); } my $warn = defined($self->{threshold_warn}) ? $self->{threshold_warn} : 'warning-' . $self->{label}; @@ -174,6 +174,11 @@ sub output { sub perfdata { my ($self, %options) = @_; + + if (defined($self->{closure_custom_perfdata})) { + return &{$self->{closure_custom_perfdata}}($self, %options); + } + my $warn = defined($self->{threshold_warn}) ? $self->{threshold_warn} : 'warning-' . $self->{label}; my $crit = defined($self->{threshold_crit}) ? $self->{threshold_crit} : 'critical-' . $self->{label};