mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-23 05:35:01 +02:00
enh(collection): add sql collection mode, add functions for snmp collection (#3112)
This commit is contained in:
parent
706021089d
commit
aeadda8309
@ -130,10 +130,15 @@ sub new {
|
|||||||
$options{options}->add_options(arguments => {
|
$options{options}->add_options(arguments => {
|
||||||
'config:s' => { name => 'config' },
|
'config:s' => { name => 'config' },
|
||||||
'filter-selection:s%' => { name => 'filter_selection' },
|
'filter-selection:s%' => { name => 'filter_selection' },
|
||||||
|
'constant:s%' => { name => 'constant' }
|
||||||
});
|
});
|
||||||
|
|
||||||
$self->{safe} = Safe->new();
|
$self->{safe} = Safe->new();
|
||||||
$self->{safe}->share('$expand');
|
$self->{safe}->share('$expand');
|
||||||
|
|
||||||
|
$self->{safe_func} = Safe->new();
|
||||||
|
$self->{safe_func}->share('$assign_var');
|
||||||
|
|
||||||
$self->{snmp_cache} = centreon::plugins::statefile->new(%options);
|
$self->{snmp_cache} = centreon::plugins::statefile->new(%options);
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
@ -444,6 +449,15 @@ sub set_leef_variable {
|
|||||||
$self->{snmp_collected}->{leefs}->{ $options{name} } = $options{value};
|
$self->{snmp_collected}->{leefs}->{ $options{name} } = $options{value};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub get_table {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
return undef if (
|
||||||
|
!defined($self->{snmp_collected}->{tables}->{ $options{table} })
|
||||||
|
);
|
||||||
|
return $self->{snmp_collected}->{tables}->{ $options{table} };
|
||||||
|
}
|
||||||
|
|
||||||
sub get_table_instance {
|
sub get_table_instance {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
@ -483,6 +497,8 @@ sub get_special_variable_value {
|
|||||||
$data = $self->get_local_variable(name => $options{label});
|
$data = $self->get_local_variable(name => $options{label});
|
||||||
} elsif ($options{type} == 1) {
|
} elsif ($options{type} == 1) {
|
||||||
$data = $self->get_leef_variable(name => $options{label});
|
$data = $self->get_leef_variable(name => $options{label});
|
||||||
|
} elsif ($options{type} == 2) {
|
||||||
|
$data = $self->get_table(table => $options{table});
|
||||||
} elsif ($options{type} == 4) {
|
} elsif ($options{type} == 4) {
|
||||||
$data = $self->get_table_attribute_value(
|
$data = $self->get_table_attribute_value(
|
||||||
table => $options{table},
|
table => $options{table},
|
||||||
@ -746,6 +762,9 @@ sub set_constants {
|
|||||||
foreach (keys %{$self->{config}->{constants}}) {
|
foreach (keys %{$self->{config}->{constants}}) {
|
||||||
$constants->{'constants.' . $_} = $self->{config}->{constants}->{$_};
|
$constants->{'constants.' . $_} = $self->{config}->{constants}->{$_};
|
||||||
}
|
}
|
||||||
|
foreach (keys %{$self->{option_results}->{constant}}) {
|
||||||
|
$constants->{'constants.' . $_} = $self->{option_results}->{constant}->{$_};
|
||||||
|
}
|
||||||
|
|
||||||
return $constants;
|
return $constants;
|
||||||
}
|
}
|
||||||
@ -918,7 +937,7 @@ sub exec_func_date2epoch {
|
|||||||
if (!defined($self->{module_datetime_loaded})) {
|
if (!defined($self->{module_datetime_loaded})) {
|
||||||
centreon::plugins::misc::mymodule_load(
|
centreon::plugins::misc::mymodule_load(
|
||||||
module => 'DateTime',
|
module => 'DateTime',
|
||||||
error_msg => "Cannot load module 'DatTime'."
|
error_msg => "Cannot load module 'DateTime'."
|
||||||
);
|
);
|
||||||
$self->{module_datetime_loaded} = 1;
|
$self->{module_datetime_loaded} = 1;
|
||||||
}
|
}
|
||||||
@ -1014,7 +1033,7 @@ sub exec_func_epoch2date {
|
|||||||
if (!defined($self->{module_datetime_loaded})) {
|
if (!defined($self->{module_datetime_loaded})) {
|
||||||
centreon::plugins::misc::mymodule_load(
|
centreon::plugins::misc::mymodule_load(
|
||||||
module => 'DateTime',
|
module => 'DateTime',
|
||||||
error_msg => "Cannot load module 'DatTime'."
|
error_msg => "Cannot load module 'DateTime'."
|
||||||
);
|
);
|
||||||
$self->{module_datetime_loaded} = 1;
|
$self->{module_datetime_loaded} = 1;
|
||||||
}
|
}
|
||||||
@ -1057,6 +1076,107 @@ sub exec_func_epoch2date {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub exec_func_count {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
#{
|
||||||
|
# "type": "count",
|
||||||
|
# "src": "%(snmp.tables.test)",
|
||||||
|
# "save": "%(testCount)"
|
||||||
|
#}
|
||||||
|
if (!defined($options{src}) || $options{src} eq '') {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "$self->{current_section} please set src attribute");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
my $result = $self->parse_special_variable(chars => [split //, $options{src}], start => 0);
|
||||||
|
if ($result->{type} !~ /^2$/) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => $self->{current_section} . " special variable type not allowed in src attribute");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
my $data = $self->get_special_variable_value(%$result);
|
||||||
|
my $value = 0;
|
||||||
|
if (defined($data)) {
|
||||||
|
$value = scalar(keys %$data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defined($options{save}) && $options{save} ne '') {
|
||||||
|
my $save = $self->parse_special_variable(chars => [split //, $options{save}], start => 0);
|
||||||
|
if ($save->{type} !~ /^(?:0|1|4)$/) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => $self->{current_section} . " special variable type not allowed in save attribute");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
$self->set_special_variable_value(value => $value, %$save);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub exec_func_replace {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
#{
|
||||||
|
# "type": "replace",
|
||||||
|
# "src": "%(sql.tables.test)",
|
||||||
|
# "expression": "s/name/name is/"
|
||||||
|
#}
|
||||||
|
if (!defined($options{src}) || $options{src} eq '') {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "$self->{current_section} please set src attribute");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
if (!defined($options{expression}) || $options{expression} eq '') {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "$self->{current_section} please set expression attribute");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
my $result = $self->parse_special_variable(chars => [split //, $options{src}], start => 0);
|
||||||
|
if ($result->{type} !~ /^(?:0|4)$/) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => $self->{current_section} . " special variable type not allowed in src attribute");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
my $data = $self->get_special_variable_value(%$result);
|
||||||
|
|
||||||
|
if (defined($data)) {
|
||||||
|
my $expression = $self->substitute_string(value => $options{expression});
|
||||||
|
our $assign_var = $data;
|
||||||
|
$self->{safe_func}->reval("\$assign_var =~ $expression", 1);
|
||||||
|
if ($@) {
|
||||||
|
die 'Unsafe code evaluation: ' . $@;
|
||||||
|
}
|
||||||
|
$self->set_special_variable_value(value => $assign_var, %$result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub exec_func_assign {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
#{
|
||||||
|
# "type": "assign",
|
||||||
|
# "save": "%(sql.tables.test)",
|
||||||
|
# "expression": "'%(sql.tables.test)' . 'toto'"
|
||||||
|
#}
|
||||||
|
if (!defined($options{save}) || $options{save} eq '') {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "$self->{current_section} please set save attribute");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
if (!defined($options{expression}) || $options{expression} eq '') {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "$self->{current_section} please set expression attribute");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
my $result = $self->parse_special_variable(chars => [split //, $options{save}], start => 0);
|
||||||
|
if ($result->{type} !~ /^(?:0|4)$/) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => $self->{current_section} . " special variable type not allowed in src attribute");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
my $expression = $self->substitute_string(value => $options{expression});
|
||||||
|
our $assign_var;
|
||||||
|
$self->{safe_func}->reval("\$assign_var = $expression", 1);
|
||||||
|
if ($@) {
|
||||||
|
die 'Unsafe code evaluation: ' . $@;
|
||||||
|
}
|
||||||
|
$self->set_special_variable_value(value => $assign_var, %$result);
|
||||||
|
}
|
||||||
|
|
||||||
sub set_functions {
|
sub set_functions {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
@ -1078,6 +1198,12 @@ sub set_functions {
|
|||||||
$self->exec_func_date2epoch(%$_);
|
$self->exec_func_date2epoch(%$_);
|
||||||
} elsif (lc($_->{type}) eq 'epoch2date') {
|
} elsif (lc($_->{type}) eq 'epoch2date') {
|
||||||
$self->exec_func_epoch2date(%$_);
|
$self->exec_func_epoch2date(%$_);
|
||||||
|
} elsif (lc($_->{type}) eq 'count') {
|
||||||
|
$self->exec_func_count(%$_);
|
||||||
|
} elsif (lc($_->{type}) eq 'replace') {
|
||||||
|
$self->exec_func_replace(%$_);
|
||||||
|
} elsif (lc($_->{type}) eq 'assign') {
|
||||||
|
$self->exec_func_assign(%$_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1086,7 +1212,7 @@ sub prepare_variables {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
return undef if (!defined($options{value}));
|
return undef if (!defined($options{value}));
|
||||||
$options{value} =~ s/%\(([a-z-A-Z0-9\.]+?)\)/\$expand->{'$1'}/g;
|
$options{value} =~ s/%\(([a-zA-Z0-9\.]+?)\)/\$expand->{'$1'}/g;
|
||||||
return $options{value};
|
return $options{value};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1095,7 +1221,7 @@ sub check_filter {
|
|||||||
|
|
||||||
return 0 if (!defined($options{filter}) || $options{filter} eq '');
|
return 0 if (!defined($options{filter}) || $options{filter} eq '');
|
||||||
our $expand = $self->{expand};
|
our $expand = $self->{expand};
|
||||||
$options{filter} =~ s/%\(([a-z-A-Z0-9\.]+?)\)/\$expand->{'$1'}/g;
|
$options{filter} =~ s/%\(([a-zA-Z0-9\.]+?)\)/\$expand->{'$1'}/g;
|
||||||
my $result = $self->{safe}->reval("$options{filter}");
|
my $result = $self->{safe}->reval("$options{filter}");
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$self->{output}->add_option_msg(short_msg => 'Unsafe code evaluation: ' . $@);
|
$self->{output}->add_option_msg(short_msg => 'Unsafe code evaluation: ' . $@);
|
||||||
@ -1281,8 +1407,6 @@ sub manage_selection {
|
|||||||
|
|
||||||
# TODO:
|
# TODO:
|
||||||
# add some functions types:
|
# add some functions types:
|
||||||
# eval_equal (concatenate, math operation)
|
|
||||||
# regexp (regexp substitution, extract a pattern)
|
|
||||||
# decode snmp type: ipAddress
|
# decode snmp type: ipAddress
|
||||||
# can cache only some parts of snmp requests:
|
# can cache only some parts of snmp requests:
|
||||||
# use an array for "snmp" ?
|
# use an array for "snmp" ?
|
||||||
@ -1315,6 +1439,11 @@ Can be a file or json content.
|
|||||||
Filter selections.
|
Filter selections.
|
||||||
Eg: --filter-selection='name=test'
|
Eg: --filter-selection='name=test'
|
||||||
|
|
||||||
|
=item B<--constant>
|
||||||
|
|
||||||
|
Add a constant.
|
||||||
|
Eg: --constant='warning=30' --constant='critical=45'
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
1355
centreon/common/protocols/sql/mode/collection.pm
Normal file
1355
centreon/common/protocols/sql/mode/collection.pm
Normal file
File diff suppressed because it is too large
Load Diff
@ -32,8 +32,9 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '0.1';
|
$self->{version} = '0.1';
|
||||||
%{$self->{modes}} = (
|
$self->{modes}} = {
|
||||||
'archivelevel0' => 'database::informix::sql::mode::archivelevel0',
|
'archivelevel0' => 'database::informix::sql::mode::archivelevel0',
|
||||||
|
'collection' => 'centreon::common::protocols::sql::mode::collection',
|
||||||
'checkpoints' => 'database::informix::sql::mode::checkpoints',
|
'checkpoints' => 'database::informix::sql::mode::checkpoints',
|
||||||
'chunkstates' => 'database::informix::sql::mode::chunkstates',
|
'chunkstates' => 'database::informix::sql::mode::chunkstates',
|
||||||
'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime',
|
'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime',
|
||||||
@ -47,7 +48,7 @@ sub new {
|
|||||||
'sessions' => 'database::informix::sql::mode::sessions',
|
'sessions' => 'database::informix::sql::mode::sessions',
|
||||||
'table-locks' => 'database::informix::sql::mode::tablelocks',
|
'table-locks' => 'database::informix::sql::mode::tablelocks',
|
||||||
'sql' => 'centreon::common::protocols::sql::mode::sql',
|
'sql' => 'centreon::common::protocols::sql::mode::sql',
|
||||||
);
|
};
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ sub new {
|
|||||||
'backup-age' => 'database::mssql::mode::backupage',
|
'backup-age' => 'database::mssql::mode::backupage',
|
||||||
'blocked-processes' => 'database::mssql::mode::blockedprocesses',
|
'blocked-processes' => 'database::mssql::mode::blockedprocesses',
|
||||||
'cache-hitratio' => 'database::mssql::mode::cachehitratio',
|
'cache-hitratio' => 'database::mssql::mode::cachehitratio',
|
||||||
|
'collection' => 'centreon::common::protocols::sql::mode::collection',
|
||||||
'connected-users' => 'database::mssql::mode::connectedusers',
|
'connected-users' => 'database::mssql::mode::connectedusers',
|
||||||
'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime',
|
'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime',
|
||||||
'dead-locks' => 'database::mssql::mode::deadlocks',
|
'dead-locks' => 'database::mssql::mode::deadlocks',
|
||||||
|
@ -30,9 +30,10 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '0.1';
|
$self->{version} = '0.1';
|
||||||
%{$self->{modes}} = (
|
$self->{modes} = {
|
||||||
'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime',
|
|
||||||
'backup' => 'database::mysql::mode::backup',
|
'backup' => 'database::mysql::mode::backup',
|
||||||
|
'collection' => 'centreon::common::protocols::sql::mode::collection',
|
||||||
|
'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime',
|
||||||
'databases-size' => 'database::mysql::mode::databasessize',
|
'databases-size' => 'database::mysql::mode::databasessize',
|
||||||
'innodb-bufferpool-hitrate' => 'database::mysql::mode::innodbbufferpoolhitrate',
|
'innodb-bufferpool-hitrate' => 'database::mysql::mode::innodbbufferpoolhitrate',
|
||||||
'long-queries' => 'database::mysql::mode::longqueries',
|
'long-queries' => 'database::mysql::mode::longqueries',
|
||||||
@ -47,7 +48,7 @@ sub new {
|
|||||||
'sql-string' => 'centreon::common::protocols::sql::mode::sqlstring',
|
'sql-string' => 'centreon::common::protocols::sql::mode::sqlstring',
|
||||||
'threads-connected' => 'database::mysql::mode::threadsconnected',
|
'threads-connected' => 'database::mysql::mode::threadsconnected',
|
||||||
'uptime' => 'database::mysql::mode::uptime'
|
'uptime' => 'database::mysql::mode::uptime'
|
||||||
);
|
};
|
||||||
|
|
||||||
$self->{sql_modes}->{dbi} = 'database::mysql::dbi';
|
$self->{sql_modes}->{dbi} = 'database::mysql::dbi';
|
||||||
$self->{sql_modes}->{mysqlcmd} = 'database::mysql::mysqlcmd';
|
$self->{sql_modes}->{mysqlcmd} = 'database::mysql::mysqlcmd';
|
||||||
|
@ -31,8 +31,9 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '0.1';
|
$self->{version} = '0.1';
|
||||||
%{$self->{modes}} = (
|
$self->{modes} = {
|
||||||
'asm-diskgroup-usage' => 'database::oracle::mode::asmdiskgroupusage',
|
'asm-diskgroup-usage' => 'database::oracle::mode::asmdiskgroupusage',
|
||||||
|
'collection' => 'centreon::common::protocols::sql::mode::collection',
|
||||||
'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime',
|
'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime',
|
||||||
'connected-users' => 'database::oracle::mode::connectedusers',
|
'connected-users' => 'database::oracle::mode::connectedusers',
|
||||||
'corrupted-blocks' => 'database::oracle::mode::corruptedblocks',
|
'corrupted-blocks' => 'database::oracle::mode::corruptedblocks',
|
||||||
@ -59,7 +60,7 @@ sub new {
|
|||||||
'sql-string' => 'centreon::common::protocols::sql::mode::sqlstring',
|
'sql-string' => 'centreon::common::protocols::sql::mode::sqlstring',
|
||||||
'tablespace-usage' => 'database::oracle::mode::tablespaceusage',
|
'tablespace-usage' => 'database::oracle::mode::tablespaceusage',
|
||||||
'tnsping' => 'database::oracle::mode::tnsping'
|
'tnsping' => 'database::oracle::mode::tnsping'
|
||||||
);
|
};
|
||||||
|
|
||||||
$self->{sql_modes}->{dbi} = 'database::oracle::dbi';
|
$self->{sql_modes}->{dbi} = 'database::oracle::dbi';
|
||||||
$self->{sql_modes}->{sqlpluscmd} = 'database::oracle::sqlpluscmd';
|
$self->{sql_modes}->{sqlpluscmd} = 'database::oracle::sqlpluscmd';
|
||||||
|
@ -26,13 +26,13 @@ use base qw(centreon::plugins::script_sql);
|
|||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
|
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '0.1';
|
$self->{version} = '0.1';
|
||||||
%{$self->{modes}} = (
|
$self->{modes} = {
|
||||||
'backends' => 'database::postgres::mode::backends',
|
'backends' => 'database::postgres::mode::backends',
|
||||||
|
'collection' => 'centreon::common::protocols::sql::mode::collection',
|
||||||
'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime',
|
'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime',
|
||||||
'database-size' => 'database::postgres::mode::databasesize',
|
'database-size' => 'database::postgres::mode::databasesize',
|
||||||
'hitratio' => 'database::postgres::mode::hitratio',
|
'hitratio' => 'database::postgres::mode::hitratio',
|
||||||
@ -45,7 +45,7 @@ sub new {
|
|||||||
'tablespace' => 'database::postgres::mode::tablespace',
|
'tablespace' => 'database::postgres::mode::tablespace',
|
||||||
'timesync' => 'database::postgres::mode::timesync',
|
'timesync' => 'database::postgres::mode::timesync',
|
||||||
'vacuum' => 'database::postgres::mode::vacuum',
|
'vacuum' => 'database::postgres::mode::vacuum',
|
||||||
);
|
};
|
||||||
|
|
||||||
$self->{sql_modes}->{psqlcmd} = 'database::postgres::psqlcmd';
|
$self->{sql_modes}->{psqlcmd} = 'database::postgres::psqlcmd';
|
||||||
return $self;
|
return $self;
|
||||||
|
@ -31,16 +31,17 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '0.1';
|
$self->{version} = '0.1';
|
||||||
%{$self->{modes}} = (
|
$self->{modes} = {
|
||||||
'blocked-transactions' => 'database::sap::hana::mode::blockedtransactions',
|
'blocked-transactions' => 'database::sap::hana::mode::blockedtransactions',
|
||||||
|
'collection' => 'centreon::common::protocols::sql::mode::collection',
|
||||||
'connected-users' => 'database::sap::hana::mode::connectedusers',
|
'connected-users' => 'database::sap::hana::mode::connectedusers',
|
||||||
'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime',
|
'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime',
|
||||||
'disk-usage' => 'database::sap::hana::mode::diskusage',
|
'disk-usage' => 'database::sap::hana::mode::diskusage',
|
||||||
'host-memory' => 'database::sap::hana::mode::hostmemory',
|
'host-memory' => 'database::sap::hana::mode::hostmemory',
|
||||||
'host-cpu' => 'database::sap::hana::mode::hostcpu',
|
'host-cpu' => 'database::sap::hana::mode::hostcpu',
|
||||||
'sql' => 'centreon::common::protocols::sql::mode::sql',
|
'sql' => 'centreon::common::protocols::sql::mode::sql',
|
||||||
'volume-usage' => 'database::sap::hana::mode::volumeusage',
|
'volume-usage' => 'database::sap::hana::mode::volumeusage'
|
||||||
);
|
};
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
@ -52,7 +53,7 @@ sub init {
|
|||||||
arguments => {
|
arguments => {
|
||||||
'servernode:s@' => { name => 'servernode' },
|
'servernode:s@' => { name => 'servernode' },
|
||||||
'port:s@' => { name => 'port' },
|
'port:s@' => { name => 'port' },
|
||||||
'database:s' => { name => 'database' },
|
'database:s' => { name => 'database' }
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
$self->{options}->parse_options();
|
$self->{options}->parse_options();
|
||||||
|
@ -31,13 +31,14 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '0.1';
|
$self->{version} = '0.1';
|
||||||
%{$self->{modes}} = (
|
$self->{modes} = {
|
||||||
'blocked-processes' => 'database::sybase::mode::blockedprocesses',
|
'blocked-processes' => 'database::sybase::mode::blockedprocesses',
|
||||||
'connected-users' => 'database::sybase::mode::connectedusers',
|
'collection' => 'centreon::common::protocols::sql::mode::collection',
|
||||||
'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime',
|
'connected-users' => 'database::sybase::mode::connectedusers',
|
||||||
'databases-size' => 'database::sybase::mode::databasessize',
|
'connection-time' => 'centreon::common::protocols::sql::mode::connectiontime',
|
||||||
'sql' => 'centreon::common::protocols::sql::mode::sql',
|
'databases-size' => 'database::sybase::mode::databasessize',
|
||||||
);
|
'sql' => 'centreon::common::protocols::sql::mode::sql'
|
||||||
|
};
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
@ -50,7 +51,7 @@ sub init {
|
|||||||
'hostname:s@' => { name => 'hostname' },
|
'hostname:s@' => { name => 'hostname' },
|
||||||
'port:s@' => { name => 'port' },
|
'port:s@' => { name => 'port' },
|
||||||
'tds-level:s@' => { name => 'tds_level' },
|
'tds-level:s@' => { name => 'tds_level' },
|
||||||
'database:s' => { name => 'database' },
|
'database:s' => { name => 'database' }
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
$self->{options}->parse_options();
|
$self->{options}->parse_options();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user