diff --git a/centreon-plugins/database/postgres/mode/vacuum.pm b/centreon-plugins/database/postgres/mode/vacuum.pm index 754adc888..7e362d047 100644 --- a/centreon-plugins/database/postgres/mode/vacuum.pm +++ b/centreon-plugins/database/postgres/mode/vacuum.pm @@ -67,6 +67,10 @@ sub check_options { $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); $self->{output}->option_exit(); } + if (($self->{perfdata}->threshold_validate(label => 'dbname', value => $self->{option_results}->{dbname})) eq 'postgres') { + $self->{output}->add_option_msg(short_msg => "Invalid db."); + $self->{output}->option_exit(); + } } @@ -85,6 +89,9 @@ sub run { if ($1 eq 'postgres') { $self->{output}->add_option_msg(short_msg => "Cannot use system 'postgres' database ; you must use a real database."); $self->{output}->option_exit(); + } elsif ($1 eq '') { + $self->{output}->add_option_msg(short_msg => "Database must be specified."); + $self->{output}->option_exit(); } } else { $self->{output}->add_option_msg(short_msg => "Need to specify database argument.");