mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
fix vacuum postgres
This commit is contained in:
parent
3d9e702fa0
commit
043561ba9f
@ -30,11 +30,10 @@ sub new {
|
|||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
'warning:s' => { name => 'warning', default => '' },
|
||||||
"warning:s" => { name => 'warning', default => ''},
|
'critical:s' => { name => 'critical', default => '' },
|
||||||
"critical:s" => { name => 'critical', default => ''},
|
'tablespace:s' => { name => 'tablespace' } # tablespace name to check
|
||||||
"tablespace:s" => { name => 'tablespace', }, # tablespace name to check
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
@ -64,7 +63,7 @@ sub run {
|
|||||||
my $target_fields = undef;
|
my $target_fields = undef;
|
||||||
|
|
||||||
# Query to get tablespace size
|
# Query to get tablespace size
|
||||||
my $query = sprintf("SELECT pg_tablespace_size('%s') FROM pg_tablespace LIMIT 1;",$self->{option_results}->{tablespace});
|
my $query = sprintf("SELECT pg_tablespace_size('%s') FROM pg_tablespace LIMIT 1;", $self->{option_results}->{tablespace});
|
||||||
$self->{sql}->query(query => $query);
|
$self->{sql}->query(query => $query);
|
||||||
|
|
||||||
my $result = $self->{sql}->fetchrow_array();
|
my $result = $self->{sql}->fetchrow_array();
|
||||||
|
@ -48,7 +48,7 @@ sub check_options {
|
|||||||
}
|
}
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) {
|
if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
||||||
self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user