From 77c8a4678beac844ac2be26f53e760e77f07eff4 Mon Sep 17 00:00:00 2001 From: Quentin Garnier Date: Thu, 12 Mar 2015 13:11:23 +1100 Subject: [PATCH] Fix new mode --- apps/centreon/mysql/mode/countnotifications.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/centreon/mysql/mode/countnotifications.pm b/apps/centreon/mysql/mode/countnotifications.pm index c658dd4c5..eb0acc587 100644 --- a/apps/centreon/mysql/mode/countnotifications.pm +++ b/apps/centreon/mysql/mode/countnotifications.pm @@ -75,10 +75,10 @@ sub check_options { } sub execute { - my ($self, %options) = @ + my ($self, %options) = @_; $self->{sql}->connect(); - $self->{sql}->query(query => "SELECT count(*) as num FROM " . $self->{option_results}->{centreon_storage} . ".logs WHERE ctime > " . $options{time} . " AND msg_type IN ('2', '3')"); + $self->{sql}->query(query => "SELECT count(*) as num FROM " . $self->{option_results}->{centreon_storage_database} . ".logs WHERE ctime > " . $options{time} . " AND msg_type IN ('2', '3')"); my $row = $self->{sql}->fetchrow_hashref(); my $exit_code = $self->{perfdata}->threshold_check(value => $row->{num}, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); @@ -98,7 +98,7 @@ sub run { $self->{statefile_cache}->read(statefile => 'mysql_' . $self->{mode} . '_' . $self->{sql}->get_unique_id4save()); my $old_timestamp = $self->{statefile_cache}->get(name => 'last_timestamp'); - $new_datas->{last_timestamp} = time(); + my $new_datas = { last_timestamp => time() }; $self->{statefile_cache}->write(data => $new_datas); if (!defined($old_timestamp)) {