mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
enh(f5-bigip-snmp): switch to metric v2 + add tests (#4656)
Co-authored-by: sfarouq-ext <116093375+sfarouq-ext@users.noreply.github.com> Refs: MON-20991 Refs: CTOR-427
This commit is contained in:
parent
5d10adc39b
commit
edd04d213c
@ -26,6 +26,24 @@ use strict;
|
||||
use warnings;
|
||||
use Digest::MD5 qw(md5_hex);
|
||||
|
||||
sub prefix_vs_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
return "Virtual server '" . $options{instance_value}->{display} . "' : ";
|
||||
}
|
||||
|
||||
sub vs_long_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
return "checking virtual server '" . $options{instance_value}->{display} . "'";
|
||||
}
|
||||
|
||||
sub prefix_ap_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
return "access profile '" . $options{instance_value}->{display} . "' ";
|
||||
}
|
||||
|
||||
sub set_counters {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
@ -93,24 +111,6 @@ sub set_counters {
|
||||
];
|
||||
}
|
||||
|
||||
sub prefix_vs_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
return "Virtual server '" . $options{instance_value}->{display} . "' : ";
|
||||
}
|
||||
|
||||
sub vs_long_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
return "checking virtual server '" . $options{instance_value}->{display} . "'";
|
||||
}
|
||||
|
||||
sub prefix_ap_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
return "access profile '" . $options{instance_value}->{display} . "' ";
|
||||
}
|
||||
|
||||
sub new {
|
||||
my ($class, %options) = @_;
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1, statefile => 1);
|
||||
@ -214,12 +214,54 @@ Filter virtual server name (can be a regexp).
|
||||
|
||||
Filter access profile name (can be a regexp).
|
||||
|
||||
=item B<--warning-*> B<--critical-*>
|
||||
=item B<--warning-sessions-created>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-sessions-created>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-sessions-active>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-sessions-active>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-sessions-pending>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-sessions-pending>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-ap-sessions-created>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-ap-sessions-created>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-ap-sessions-active>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-ap-sessions-active>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-ap-sessions-pending>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-ap-sessions-pending>
|
||||
|
||||
Thresholds.
|
||||
Can be: 'sessions-created', 'sessions-active', 'sessions-pending',
|
||||
'ap-sessions-created', 'ap-sessions-active', 'ap-sessions-pending'.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
=cut
|
@ -59,25 +59,37 @@ sub check {
|
||||
|
||||
$self->{components}->{fan}->{total}++;
|
||||
|
||||
$self->{output}->output_add(long_msg => sprintf("fan '%s' status is '%s' [instance: %s, speed: %s].",
|
||||
$instance, $result->{sysChassisFanStatus}, $instance,
|
||||
defined($result->{sysChassisFanSpeed}) ? $result->{sysChassisFanSpeed} : '-'));
|
||||
$self->{output}->output_add(
|
||||
long_msg => sprintf(
|
||||
"fan '%s' status is '%s' [instance: %s, speed: %s].",
|
||||
$instance, $result->{sysChassisFanStatus}, $instance,
|
||||
defined($result->{sysChassisFanSpeed}) ? $result->{sysChassisFanSpeed} : '-'
|
||||
)
|
||||
);
|
||||
|
||||
my $exit = $self->get_severity(section => 'fan', value => $result->{sysChassisFanStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("Fan '%s' status is '%s'",
|
||||
$instance, $result->{sysChassisFanStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"Fan '%s' status is '%s'",
|
||||
$instance, $result->{sysChassisFanStatus}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (defined($result->{sysChassisFanSpeed}) && $result->{sysChassisFanSpeed} =~ /[0-9]/) {
|
||||
my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'fan', instance => $instance, value => $result->{sysChassisFanSpeed});
|
||||
if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit2,
|
||||
short_msg => sprintf("fan speed '%s' is %s rpm", $instance, $result->{sysChassisFanSpeed}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit2,
|
||||
short_msg => sprintf("fan speed '%s' is %s rpm", $instance, $result->{sysChassisFanSpeed})
|
||||
);
|
||||
}
|
||||
|
||||
$self->{output}->perfdata_add(
|
||||
label => "fan", unit => 'rpm',
|
||||
nlabel => 'hardware.fan.speed.rpm',
|
||||
unit => 'rpm',
|
||||
instances => $instance,
|
||||
value => $result->{sysChassisFanSpeed},
|
||||
warning => $warn,
|
||||
|
@ -57,14 +57,22 @@ sub check {
|
||||
|
||||
$self->{components}->{psu}->{total}++;
|
||||
|
||||
$self->{output}->output_add(long_msg => sprintf("power supply '%s' status is '%s' [instance: %s].",
|
||||
$instance, $result->{sysChassisPowerSupplyStatus}, $instance
|
||||
));
|
||||
$self->{output}->output_add(
|
||||
long_msg => sprintf(
|
||||
"power supply '%s' status is '%s' [instance: %s].",
|
||||
$instance, $result->{sysChassisPowerSupplyStatus}, $instance
|
||||
)
|
||||
);
|
||||
|
||||
my $exit = $self->get_severity(section => 'psu', value => $result->{sysChassisPowerSupplyStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("Power supply '%s' status is '%s'",
|
||||
$instance, $result->{sysChassisPowerSupplyStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"Power supply '%s' status is '%s'",
|
||||
$instance, $result->{sysChassisPowerSupplyStatus}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,19 +48,25 @@ sub check {
|
||||
next if ($self->check_filter(section => 'temperature', instance => $instance));
|
||||
|
||||
$self->{components}->{temperature}->{total}++;
|
||||
$self->{output}->output_add(long_msg => sprintf("temperature '%s' is %.2f C [instance: %s].",
|
||||
$instance, $result->{sysChassisTempTemperature}, $instance
|
||||
));
|
||||
$self->{output}->output_add(
|
||||
long_msg => sprintf(
|
||||
"temperature '%s' is %.2f C [instance: %s].",
|
||||
$instance, $result->{sysChassisTempTemperature}, $instance
|
||||
)
|
||||
);
|
||||
|
||||
if (defined($result->{sysChassisTempTemperature}) && $result->{sysChassisTempTemperature} =~ /[0-9]/) {
|
||||
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{sysChassisTempTemperature});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("Temperature '%s' is %.2f C", $instance, $result->{sysChassisTempTemperature}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf("Temperature '%s' is %.2f C", $instance, $result->{sysChassisTempTemperature})
|
||||
);
|
||||
}
|
||||
|
||||
$self->{output}->perfdata_add(
|
||||
label => "temp", unit => 'C',
|
||||
nlabel => 'hardware.temperature.celsius',
|
||||
unit => 'C',
|
||||
instances => $instance,
|
||||
value => sprintf("%.2f", $result->{sysChassisTempTemperature}),
|
||||
warning => $warn,
|
||||
|
@ -42,67 +42,69 @@ sub set_counters {
|
||||
$self->{maps_counters_type} = [
|
||||
{ name => 'global', type => 0 },
|
||||
];
|
||||
|
||||
$self->{maps_counters}->{global} = [
|
||||
{ label => 'client', set => {
|
||||
{ label => 'client', nlabel => 'connections.client.current.count', set => {
|
||||
key_values => [ { name => 'client' } ],
|
||||
output_template => 'Current client connections : %s',
|
||||
perfdatas => [
|
||||
{ label => 'Client', template => '%s', min => 0, unit => 'con' },
|
||||
],
|
||||
{ template => '%s', min => 0 }
|
||||
]
|
||||
}
|
||||
},
|
||||
{ label => 'client-ssl', set => {
|
||||
{ label => 'client-ssl', nlabel => 'connections.client.ssl.current.count', set => {
|
||||
key_values => [ { name => 'client_ssl' } ],
|
||||
output_template => 'Current client SSL connections : %s',
|
||||
perfdatas => [
|
||||
{ label => 'ClientSSL', template => '%s', min => 0, unit => 'con' },
|
||||
],
|
||||
{ template => '%s', min => 0 }
|
||||
]
|
||||
}
|
||||
},
|
||||
{ label => 'client-ssl-tps', set => {
|
||||
{ label => 'client-ssl-tps', nlabel => 'connections.client.ssl.persecond', set => {
|
||||
key_values => [ { name => 'client_ssl_tot_native', diff => 1 }, { name => 'client_ssl_tot_compat', diff => 1 } ],
|
||||
output_template => 'TPS client SSL connections : %.2f', threshold_use => 'client_ssl_tps', output_use => 'client_ssl_tps',
|
||||
output_template => 'TPS client SSL connections : %.2f',
|
||||
threshold_use => 'client_ssl_tps',
|
||||
output_use => 'client_ssl_tps',
|
||||
closure_custom_calc => $self->can('custom_client_tps_calc'),
|
||||
perfdatas => [
|
||||
{ label => 'ClientSSL_Tps', value => 'client_ssl_tps', template => '%.2f',
|
||||
unit => 'tps', min => 0 },
|
||||
],
|
||||
{ value => 'client_ssl_tps', template => '%.2f', min => 0 }
|
||||
]
|
||||
}
|
||||
},
|
||||
{ label => 'server', set => {
|
||||
{ label => 'server', nlabel => 'connections.server.current.count', set => {
|
||||
key_values => [ { name => 'server' } ],
|
||||
output_template => 'Current server connections: %s',
|
||||
perfdatas => [
|
||||
{ label => 'Server', template => '%s', min => 0, unit => 'con' },
|
||||
],
|
||||
{ template => '%s', min => 0 }
|
||||
]
|
||||
}
|
||||
},
|
||||
{ label => 'server-ssl', set => {
|
||||
{ label => 'server-ssl', nlabel => 'connections.server.ssl.current.count', set => {
|
||||
key_values => [ { name => 'server_ssl' } ],
|
||||
output_template => 'Current server SSL connections : %s',
|
||||
perfdatas => [
|
||||
{ label => 'ServerSSL', template => '%s', min => 0, unit => 'con' },
|
||||
],
|
||||
{ template => '%s', min => 0 }
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
sub new {
|
||||
my ($class, %options) = @_;
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1);
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1, force_new_perfdata => 1);
|
||||
bless $self, $class;
|
||||
|
||||
|
||||
$options{options}->add_options(arguments => {
|
||||
});
|
||||
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub manage_selection {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{cache_name} = "f5_bipgip_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' .
|
||||
$self->{cache_name} = 'f5_bipgip_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' .
|
||||
(defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all'));
|
||||
|
||||
my $oid_sysStatClientCurConns = '.1.3.6.1.4.1.3375.2.1.1.2.1.8.0';
|
||||
@ -111,12 +113,12 @@ sub manage_selection {
|
||||
my $oid_sysServersslStatCurConns = '.1.3.6.1.4.1.3375.2.1.1.2.10.2.0';
|
||||
my $oid_sysClientsslStatTotNativeConns = '.1.3.6.1.4.1.3375.2.1.1.2.9.6.0';
|
||||
my $oid_sysClientsslStatTotCompatConns = '.1.3.6.1.4.1.3375.2.1.1.2.9.9.0';
|
||||
|
||||
|
||||
if ($options{snmp}->is_snmpv1()) {
|
||||
$self->{output}->add_option_msg(short_msg => "Need to use SNMP v2c or v3.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
||||
|
||||
my $result = $options{snmp}->get_leef(
|
||||
oids => [
|
||||
$oid_sysStatClientCurConns, $oid_sysStatServerCurConns,
|
||||
@ -125,13 +127,14 @@ sub manage_selection {
|
||||
],
|
||||
nothing_quit => 1
|
||||
);
|
||||
|
||||
$self->{global} = {
|
||||
client => $result->{$oid_sysStatClientCurConns},
|
||||
client_ssl => $result->{$oid_sysClientsslStatCurConns},
|
||||
client_ssl_tot_native => $result->{$oid_sysClientsslStatTotNativeConns},
|
||||
client_ssl_tot_compat => $result->{$oid_sysClientsslStatTotCompatConns},
|
||||
server => $result->{$oid_sysStatServerCurConns},
|
||||
server_ssl => $result->{$oid_sysServersslStatCurConns},
|
||||
server_ssl => $result->{$oid_sysServersslStatCurConns}
|
||||
};
|
||||
}
|
||||
|
||||
@ -150,15 +153,45 @@ Check current connections on F5 BIG IP device.
|
||||
Only display some counters (regexp can be used).
|
||||
Example to check SSL connections only : --filter-counters='^client-ssl|server-ssl$'
|
||||
|
||||
=item B<--warning-*>
|
||||
=item B<--warning-client>
|
||||
|
||||
Warning threshold.
|
||||
Can be: 'client', 'server', 'client-ssl', 'server-ssl', 'client-ssl-tps'.
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-*>
|
||||
=item B<--critical-client>
|
||||
|
||||
Critical threshold.
|
||||
Can be: 'client', 'server', 'client-ssl', 'server-ssl', 'client-ssl-tps'.
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-server>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-server>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-client-ssl>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-client-ssl>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-server-ssl>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-server-ssl>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-client-ssl-tps>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-client-ssl-tps>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=back
|
||||
|
||||
|
@ -24,7 +24,19 @@ use base qw(centreon::plugins::templates::counter);
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold);
|
||||
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
|
||||
|
||||
sub custom_syncstatus_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
return "Sync status is '" . $self->{result_values}->{syncstatus} . "'";
|
||||
}
|
||||
|
||||
sub custom_failoverstatus_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
return "Failover status is '" . $self->{result_values}->{failoverstatus} . "'";
|
||||
}
|
||||
|
||||
sub set_counters {
|
||||
my ($self, %options) = @_;
|
||||
@ -34,78 +46,36 @@ sub set_counters {
|
||||
];
|
||||
|
||||
$self->{maps_counters}->{global} = [
|
||||
{ label => 'sync-status', threshold => 0, set => {
|
||||
{ label => 'sync-status', type => 2, critical_default => '%{syncstatus} =~ /unknown|syncFailed|syncDisconnected|incompatibleVersion/', set => {
|
||||
key_values => [ { name => 'syncstatus' } ],
|
||||
closure_custom_calc => \&custom_syncstatus_calc,
|
||||
closure_custom_output => \&custom_syncstatus_output,
|
||||
closure_custom_perfdata => sub { return 0; },
|
||||
closure_custom_threshold_check => \&catalog_status_threshold,
|
||||
closure_custom_threshold_check => \&catalog_status_threshold_ng
|
||||
}
|
||||
},
|
||||
{ label => 'failover-status', threshold => 0, set => {
|
||||
{ label => 'failover-status', type => 2, critical_default => '%{failoverstatus} =~ /unknown/', set => {
|
||||
key_values => [ { name => 'failoverstatus' } ],
|
||||
closure_custom_calc => \&custom_failoverstatus_calc,
|
||||
closure_custom_output => \&custom_failoverstatus_output,
|
||||
closure_custom_perfdata => sub { return 0; },
|
||||
closure_custom_threshold_check => \&catalog_status_threshold,
|
||||
closure_custom_threshold_check => \&catalog_status_threshold_ng
|
||||
}
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
sub custom_syncstatus_output {
|
||||
my ($self, %options) = @_;
|
||||
my $msg = "Sync status is '" . $self->{result_values}->{syncstatus} . "'";
|
||||
|
||||
return $msg;
|
||||
}
|
||||
|
||||
sub custom_syncstatus_calc {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{result_values}->{syncstatus} = $options{new_datas}->{$self->{instance} . '_syncstatus'};
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub custom_failoverstatus_output {
|
||||
my ($self, %options) = @_;
|
||||
my $msg = "Failover status is '" . $self->{result_values}->{failoverstatus} . "'";
|
||||
|
||||
return $msg;
|
||||
}
|
||||
|
||||
sub custom_failoverstatus_calc {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{result_values}->{failoverstatus} = $options{new_datas}->{$self->{instance} . '_failoverstatus'};
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub new {
|
||||
my ($class, %options) = @_;
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||
bless $self, $class;
|
||||
|
||||
$options{options}->add_options(arguments => {
|
||||
'warning-sync-status:s' => { name => 'warning_sync_status', default => '' },
|
||||
'critical-sync-status:s' => { name => 'critical_sync_status', default => '%{syncstatus} =~ /unknown|syncFailed|syncDisconnected|incompatibleVersion/' },
|
||||
'warning-failover-status:s' => { name => 'warning_failover_status', default => '' },
|
||||
'critical-failover-status:s' => { name => 'critical_failover_status', default => '%{failoverstatus} =~ /unknown/' },
|
||||
});
|
||||
$options{options}->add_options(arguments => {});
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub check_options {
|
||||
my ($self, %options) = @_;
|
||||
$self->SUPER::check_options(%options);
|
||||
|
||||
$self->change_macros(macros => ['warning_sync_status', 'critical_sync_status', 'warning_failover_status', 'critical_failover_status']);
|
||||
}
|
||||
|
||||
my %map_boolean = (
|
||||
0 => 'false',
|
||||
1 => 'true',
|
||||
1 => 'true'
|
||||
);
|
||||
my %map_sync_status = (
|
||||
0 => 'unknown',
|
||||
@ -117,21 +87,21 @@ my %map_sync_status = (
|
||||
6 => 'standalone',
|
||||
7 => 'awaitingInitialSync',
|
||||
8 => 'incompatibleVersion',
|
||||
9 => 'partialSync',
|
||||
9 => 'partialSync'
|
||||
);
|
||||
my %map_failover_status = (
|
||||
0 => 'unknown',
|
||||
1 => 'offline',
|
||||
2 => 'forcedOffline',
|
||||
3 => 'standby',
|
||||
4 => 'active',
|
||||
4 => 'active'
|
||||
);
|
||||
|
||||
my $mapping = {
|
||||
sysAttrFailoverIsRedundant => { oid => '.1.3.6.1.4.1.3375.2.1.1.1.1.13', map => \%map_boolean },
|
||||
sysAttrModeMaint => { oid => '.1.3.6.1.4.1.3375.2.1.1.1.1.21', map => \%map_boolean },
|
||||
sysCmSyncStatusId => { oid => '.1.3.6.1.4.1.3375.2.1.14.1.1', map => \%map_sync_status },
|
||||
sysCmFailoverStatusId => { oid => '.1.3.6.1.4.1.3375.2.1.14.3.1', map => \%map_failover_status },
|
||||
sysCmFailoverStatusId => { oid => '.1.3.6.1.4.1.3375.2.1.14.3.1', map => \%map_failover_status }
|
||||
};
|
||||
|
||||
sub manage_selection {
|
||||
@ -164,7 +134,7 @@ sub manage_selection {
|
||||
$self->{output}->display();
|
||||
$self->{output}->exit();
|
||||
}
|
||||
|
||||
|
||||
$self->{global} = {
|
||||
syncstatus => $result->{sysCmSyncStatusId},
|
||||
failoverstatus => $result->{sysCmFailoverStatusId},
|
||||
@ -187,22 +157,22 @@ Only display some counters (regexp can be used).
|
||||
|
||||
=item B<--warning-sync-status>
|
||||
|
||||
Set warning threshold for sync status
|
||||
Define the conditions to match for the status to be WARNING.
|
||||
You can use the following variables: %{syncstatus}
|
||||
|
||||
=item B<--critical-sync-status>
|
||||
|
||||
Set critical threshold for sync status (default: '%{syncstatus} =~ /unknown|syncFailed|syncDisconnected|incompatibleVersion/').
|
||||
Define the conditions to match for the status to be CRITICAL (default: '%{syncstatus} =~ /unknown|syncFailed|syncDisconnected|incompatibleVersion/').
|
||||
You can use the following variables: %{syncstatus}
|
||||
|
||||
=item B<--warning-failover-status>
|
||||
|
||||
Set warning threshold for failover status
|
||||
Define the conditions to match for the status to be WARNING.
|
||||
You can use the following variables: %{failoverstatus}
|
||||
|
||||
=item B<--critical-failover-status>
|
||||
|
||||
Set critical threshold for failover status (default: '%{failoverstatus} =~ /unknown/').
|
||||
Define the conditions to match for the status to be CRITICAL (Default: '%{failoverstatus} =~ /unknown/').
|
||||
You can use the following variables: %{failoverstatus}
|
||||
|
||||
=back
|
||||
|
@ -58,7 +58,7 @@ sub snmp_execute {
|
||||
|
||||
sub new {
|
||||
my ($class, %options) = @_;
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
|
||||
bless $self, $class;
|
||||
|
||||
$options{options}->add_options(arguments => {});
|
||||
|
@ -103,8 +103,10 @@ sub run {
|
||||
);
|
||||
}
|
||||
|
||||
$self->{output}->output_add(severity => 'OK',
|
||||
short_msg => 'List nodes:');
|
||||
$self->{output}->output_add(
|
||||
severity => 'OK',
|
||||
short_msg => 'List nodes:'
|
||||
);
|
||||
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
||||
$self->{output}->exit();
|
||||
}
|
||||
|
@ -106,8 +106,10 @@ sub run {
|
||||
);
|
||||
}
|
||||
|
||||
$self->{output}->output_add(severity => 'OK',
|
||||
short_msg => 'List pools:');
|
||||
$self->{output}->output_add(
|
||||
severity => 'OK',
|
||||
short_msg => 'List pools:'
|
||||
);
|
||||
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
||||
$self->{output}->exit();
|
||||
}
|
||||
|
@ -122,8 +122,10 @@ sub run {
|
||||
);
|
||||
}
|
||||
|
||||
$self->{output}->output_add(severity => 'OK',
|
||||
short_msg => 'List virtual servers:');
|
||||
$self->{output}->output_add(
|
||||
severity => 'OK',
|
||||
short_msg => 'List virtual servers:'
|
||||
);
|
||||
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
||||
$self->{output}->exit();
|
||||
}
|
||||
|
@ -64,12 +64,11 @@ sub set_counters {
|
||||
closure_custom_threshold_check => \&catalog_status_threshold_ng
|
||||
}
|
||||
},
|
||||
{ label => 'current-server-connections', set => {
|
||||
{ label => 'current-server-connections', nlabel => 'node.connections.server.current.count', set => {
|
||||
key_values => [ { name => 'ltmNodeAddrStatServerCurConns' }, { name => 'display' } ],
|
||||
output_template => 'current server connections : %s',
|
||||
perfdatas => [
|
||||
{ label => 'current_server_connections', template => '%s',
|
||||
min => 0, label_extra_instance => 1, instance_use => 'display' }
|
||||
{ template => '%s', min => 0, label_extra_instance => 1, instance_use => 'display' }
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -78,7 +77,7 @@ sub set_counters {
|
||||
|
||||
sub new {
|
||||
my ($class, %options) = @_;
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
|
||||
bless $self, $class;
|
||||
|
||||
$options{options}->add_options(arguments => {
|
||||
@ -135,7 +134,7 @@ sub manage_selection {
|
||||
foreach my $oid (keys %{$snmp_result->{$branch_name}}) {
|
||||
$oid =~ /^$branch_name\.(.*?)\.(.*)$/;
|
||||
my ($num, $index) = ($1, $2);
|
||||
|
||||
|
||||
my $result = $options{snmp}->map_instance(mapping => $mapping->{$map}, results => $snmp_result->{$branch_name}, instance => $num . '.' . $index);
|
||||
my $name = $self->{output}->decode(join('', map(chr($_), split(/\./, $index))));
|
||||
|
||||
@ -207,10 +206,13 @@ You can use the following variables: %{state}, %{status}, %{display}
|
||||
Define the conditions to match for the status to be CRITICAL (default: '%{state} eq "enabled" and %{status} eq "red"').
|
||||
You can use the following variables: %{state}, %{status}, %{display}
|
||||
|
||||
=item B<--warning-*> B<--critical-*>
|
||||
=item B<--warning-current-server-connections>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-current-server-connections>
|
||||
|
||||
Thresholds.
|
||||
Can be: 'current-server-connections'.
|
||||
|
||||
=back
|
||||
|
||||
|
@ -91,7 +91,7 @@ sub set_counters {
|
||||
];
|
||||
|
||||
$self->{maps_counters}->{pool_connections} = [
|
||||
{ label => 'current-server-connections', nlabel => 'pool.connections.server.count', set => {
|
||||
{ label => 'current-server-connections', nlabel => 'pool.connections.server.current.count', set => {
|
||||
key_values => [ { name => 'ltmPoolStatServerCurConns' }, { name => 'display' } ],
|
||||
output_template => 'current server connections: %s',
|
||||
perfdatas => [
|
||||
@ -360,10 +360,29 @@ You can use the following variables: %{state}, %{status}, %{poolName}, %{nodeNam
|
||||
Define the conditions to match for the status to be CRITICAL.
|
||||
You can use the following variables: %{state}, %{status}, %{poolName}, %{nodeName}
|
||||
|
||||
=item B<--warning-*> B<--critical-*>
|
||||
=item B<--warning-current-server-connections>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-current-server-connections>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-current-active-members>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-current-active-members>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-current-total-members>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-current-total-members>
|
||||
|
||||
Thresholds.
|
||||
Can be: 'current-server-connections', 'current-active-members', 'current-total-members'.
|
||||
|
||||
=back
|
||||
|
||||
|
@ -30,8 +30,9 @@ sub custom_usage_perfdata {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{output}->perfdata_add(
|
||||
label => 'memory_used', unit => 'B',
|
||||
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
|
||||
nlabel => $self->{nlabel},
|
||||
unit => 'B',
|
||||
instances => $self->{result_values}->{display},
|
||||
value => $self->{result_values}->{used},
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}, total => $self->{result_values}->{total}, cast_int => 1),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}, total => $self->{result_values}->{total}, cast_int => 1),
|
||||
@ -53,11 +54,12 @@ sub custom_usage_output {
|
||||
my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used});
|
||||
my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free});
|
||||
|
||||
my $msg = sprintf("Memory Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)",
|
||||
$total_size_value . " " . $total_size_unit,
|
||||
$total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used},
|
||||
$total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free});
|
||||
return $msg;
|
||||
return sprintf(
|
||||
"Memory Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)",
|
||||
$total_size_value . " " . $total_size_unit,
|
||||
$total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used},
|
||||
$total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}
|
||||
);
|
||||
}
|
||||
|
||||
sub custom_usage_calc {
|
||||
@ -73,6 +75,12 @@ sub custom_usage_calc {
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub prefix_tmm_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
return "TMM '" . $options{instance_value}->{display} . "' ";
|
||||
}
|
||||
|
||||
sub set_counters {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
@ -81,84 +89,73 @@ sub set_counters {
|
||||
];
|
||||
|
||||
$self->{maps_counters}->{tmm} = [
|
||||
{ label => 'memory-usage', set => {
|
||||
{ label => 'memory-usage', nlabel => 'tmm.memory.usage.bytes', set => {
|
||||
key_values => [ { name => 'display' }, { name => 'sysTmmStatMemoryTotal' }, { name => 'sysTmmStatMemoryUsed' } ],
|
||||
closure_custom_calc => $self->can('custom_usage_calc'),
|
||||
closure_custom_output => $self->can('custom_usage_output'),
|
||||
closure_custom_perfdata => $self->can('custom_usage_perfdata'),
|
||||
closure_custom_threshold_check => $self->can('custom_usage_threshold'),
|
||||
closure_custom_threshold_check => $self->can('custom_usage_threshold')
|
||||
}
|
||||
},
|
||||
{ label => 'cpu-1m', set => {
|
||||
{ label => 'cpu-1m', nlabel => 'tmm.cpu.utilization.1m.percentage', set => {
|
||||
key_values => [ { name => 'sysTmmStatTmUsageRatio1m' }, { name => 'display' } ],
|
||||
output_template => 'CPU Usage 1min : %s %%', output_error_template => "CPU Usage 1min : %s",
|
||||
perfdatas => [
|
||||
{ label => 'cpu_1m', value => 'sysTmmStatTmUsageRatio1m', template => '%s',
|
||||
unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display' },
|
||||
],
|
||||
{ template => '%s', unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display' }
|
||||
]
|
||||
}
|
||||
},
|
||||
{ label => 'cpu-5m', set => {
|
||||
{ label => 'cpu-5m', nlabel => 'tmm.cpu.utilization.5m.percentage', set => {
|
||||
key_values => [ { name => 'sysTmmStatTmUsageRatio5m' }, { name => 'display' } ],
|
||||
output_template => 'CPU Usage 5min : %s %%', output_error_template => "CPU Usage 5min : %s",
|
||||
perfdatas => [
|
||||
{ label => 'cpu_5m', value => 'sysTmmStatTmUsageRatio5m', template => '%s',
|
||||
unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display' },
|
||||
],
|
||||
{ template => '%s', unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display' }
|
||||
]
|
||||
}
|
||||
},
|
||||
{ label => 'current-client-connections', set => {
|
||||
{ label => 'current-client-connections', nlabel => 'tmm.connections.client.curent.count', set => {
|
||||
key_values => [ { name => 'sysTmmStatClientCurConns' }, { name => 'display' } ],
|
||||
output_template => 'Current Client Connections : %s', output_error_template => "Current Client Connections : %s",
|
||||
perfdatas => [
|
||||
{ label => 'current_client_connections', value => 'sysTmmStatClientCurConns', template => '%s',
|
||||
min => 0, label_extra_instance => 1, instance_use => 'display' },
|
||||
],
|
||||
{ label => 'current_client_connections', template => '%s',
|
||||
min => 0, label_extra_instance => 1, instance_use => 'display' }
|
||||
]
|
||||
}
|
||||
},
|
||||
{ label => 'total-client-connections', set => {
|
||||
{ label => 'total-client-connections', nlabel => 'tmm.connections.client.total.count', set => {
|
||||
key_values => [ { name => 'sysTmmStatClientTotConns', diff => 1 }, { name => 'display' } ],
|
||||
output_template => 'Total Client Connections : %s', output_error_template => "Total Client Connections : %s",
|
||||
perfdatas => [
|
||||
{ label => 'total_client_connections', value => 'sysTmmStatClientTotConns', template => '%s',
|
||||
min => 0, label_extra_instance => 1, instance_use => 'display' },
|
||||
],
|
||||
{ template => '%s', min => 0, label_extra_instance => 1, instance_use => 'display' }
|
||||
]
|
||||
}
|
||||
},
|
||||
{ label => 'current-server-connections', set => {
|
||||
{ label => 'current-server-connections', nlabel => 'tmm.connections.server.current.count', set => {
|
||||
key_values => [ { name => 'sysTmmStatServerCurConns' }, { name => 'display' } ],
|
||||
output_template => 'Current Server Connections : %s', output_error_template => "Current Server Connections : %s",
|
||||
perfdatas => [
|
||||
{ label => 'current_server_connections', value => 'sysTmmStatServerCurConns', template => '%s',
|
||||
min => 0, label_extra_instance => 1, instance_use => 'display' },
|
||||
],
|
||||
{ template => '%s', min => 0, label_extra_instance => 1, instance_use => 'display' }
|
||||
]
|
||||
}
|
||||
},
|
||||
{ label => 'total-server-connections', set => {
|
||||
{ label => 'total-server-connections', nlabel => 'tmm.connections.server.total.count', set => {
|
||||
key_values => [ { name => 'sysTmmStatServerTotConns', diff => 1 }, { name => 'display' } ],
|
||||
output_template => 'Total Server Connections : %s', output_error_template => "Total Server Connections : %s",
|
||||
perfdatas => [
|
||||
{ label => 'total_server_connections', value => 'sysTmmStatServerTotConns', template => '%s',
|
||||
min => 0, label_extra_instance => 1, instance_use => 'display' },
|
||||
],
|
||||
{ template => '%s', min => 0, label_extra_instance => 1, instance_use => 'display' }
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
sub prefix_tmm_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
return "TMM '" . $options{instance_value}->{display} . "' ";
|
||||
}
|
||||
|
||||
sub new {
|
||||
my ($class, %options) = @_;
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1);
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1, force_new_perfdata => 1);
|
||||
bless $self, $class;
|
||||
|
||||
$options{options}->add_options(arguments => {
|
||||
'filter-name:s' => { name => 'filter_name' },
|
||||
'filter-name:s' => { name => 'filter_name' }
|
||||
});
|
||||
|
||||
return $self;
|
||||
@ -207,12 +204,12 @@ sub manage_selection {
|
||||
%$result
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
if (scalar(keys %{$self->{tmm}}) <= 0) {
|
||||
$self->{output}->add_option_msg(short_msg => "No TMM found.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
||||
|
||||
$self->{cache_name} = "f5_bipgip_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' .
|
||||
(defined($self->{option_results}->{filter_name}) ? md5_hex($self->{option_results}->{filter_name}) : md5_hex('all')) . '_' .
|
||||
(defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all'));
|
||||
@ -224,7 +221,7 @@ __END__
|
||||
|
||||
=head1 MODE
|
||||
|
||||
Check TMM usages.
|
||||
Check TMM (Traffic Management Microkernel) usages.
|
||||
|
||||
=over 8
|
||||
|
||||
@ -235,19 +232,63 @@ Example : --filter-counters='^memory-usage$'
|
||||
|
||||
=item B<--filter-name>
|
||||
|
||||
Filter by TMM name (regexp can be used).
|
||||
Filter by TMM (Traffic Management Microkernel) name (regexp can be used).
|
||||
|
||||
=item B<--warning-*>
|
||||
=item B<--warning-cpu-1m>
|
||||
|
||||
Warning threshold.
|
||||
Can be: 'cpu-1m', 'cpu-5m', 'memory-usage' (%), 'total-client-connections', 'current-client-connections',
|
||||
'total-server-connections', 'current-server-connections'.
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-*>
|
||||
=item B<--critical-cpu-1m>
|
||||
|
||||
Critical threshold.
|
||||
Can be: 'cpu-1m', 'cpu-5m', 'memory-usage' (%), 'total-client-connections', 'current-client-connections',
|
||||
'total-server-connections', 'current-server-connections'.
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-cpu-5m>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-cpu-5m>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-memory-usage>
|
||||
|
||||
Thresholds in %.
|
||||
|
||||
=item B<--critical-memory-usage>
|
||||
|
||||
Thresholds in %.
|
||||
|
||||
=item B<--warning-total-client-connections>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-total-client-connections>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-current-client-connections>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-current-client-connections>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-total-server-connections>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-total-server-connections>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-current-server-connections>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-current-server-connections>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=back
|
||||
|
||||
|
@ -42,8 +42,9 @@ sub custom_traffic_perfdata {
|
||||
my $speed = $self->{result_values}->{speed} > 0 ? $self->{result_values}->{speed} : undef;
|
||||
|
||||
$self->{output}->perfdata_add(
|
||||
label => 'traffic_' . $self->{result_values}->{label}, unit => 'b/s',
|
||||
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
|
||||
nlabel => $self->{nlabel},
|
||||
unit => 'b/s',
|
||||
instances => $self->{result_values}->{display},
|
||||
value => sprintf("%.2f", $self->{result_values}->{traffic_per_seconds}),
|
||||
warning => $warning,
|
||||
critical => $critical,
|
||||
@ -101,8 +102,9 @@ sub custom_errors_perfdata {
|
||||
my $critical = $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel});
|
||||
|
||||
$self->{output}->perfdata_add(
|
||||
label => 'packets_error_' . $self->{result_values}->{label}, unit => '%',
|
||||
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
|
||||
nlabel => $self->{nlabel},
|
||||
unit => '%',
|
||||
instances => $self->{result_values}->{display},
|
||||
value => sprintf("%.2f", $self->{result_values}->{errors_prct}),
|
||||
warning => $warning,
|
||||
critical => $critical,
|
||||
@ -150,8 +152,9 @@ sub custom_drops_perfdata {
|
||||
my $critical = $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel});
|
||||
|
||||
$self->{output}->perfdata_add(
|
||||
label => 'packets_drop_' . $self->{result_values}->{label}, unit => '%',
|
||||
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
|
||||
nlabel => $self->{nlabel},
|
||||
unit => '%',
|
||||
instances => $self->{result_values}->{display},
|
||||
value => sprintf("%.2f", $self->{result_values}->{drops_prct}),
|
||||
warning => $warning,
|
||||
critical => $critical,
|
||||
@ -233,7 +236,7 @@ sub set_counters {
|
||||
closure_custom_threshold_check => \&catalog_status_threshold_ng
|
||||
}
|
||||
},
|
||||
{ label => 'traffic-in', set => {
|
||||
{ label => 'traffic-in', nlabel => 'trunk.traffic.in.bitspersecond', set => {
|
||||
key_values => [ { name => 'sysTrunkStatBytesIn', diff => 1 }, { name => 'sysTrunkOperBw', diff => 1 }, { name => 'display' } ],
|
||||
closure_custom_calc => $self->can('custom_traffic_calc'),
|
||||
closure_custom_calc_extra_options => { label_ref => 'sysTrunkStatBytesIn', speed => 'sysTrunkOperBw', label => 'in' },
|
||||
@ -242,7 +245,7 @@ sub set_counters {
|
||||
closure_custom_threshold_check => $self->can('custom_traffic_threshold')
|
||||
}
|
||||
},
|
||||
{ label => 'traffic-out', set => {
|
||||
{ label => 'traffic-out', nlabel => 'trunk.traffic.out.bitspersecond', set => {
|
||||
key_values => [ { name => 'sysTrunkStatBytesOut', diff => 1 }, { name => 'sysTrunkOperBw', diff => 1 }, { name => 'display' } ],
|
||||
closure_custom_calc => $self->can('custom_traffic_calc'),
|
||||
closure_custom_calc_extra_options => { label_ref => 'sysTrunkStatBytesOut', speed => 'sysTrunkOperBw', label => 'out' },
|
||||
@ -251,7 +254,7 @@ sub set_counters {
|
||||
closure_custom_threshold_check => $self->can('custom_traffic_threshold')
|
||||
}
|
||||
},
|
||||
{ label => 'packets-error-in', set => {
|
||||
{ label => 'packets-error-in', nlabel => 'trunk.packets.in.error.percentage', set => {
|
||||
key_values => [ { name => 'sysTrunkStatErrorsIn', diff => 1 }, { name => 'sysTrunkStatPktsIn', diff => 1 }, { name => 'display' } ],
|
||||
closure_custom_calc => $self->can('custom_errors_calc'),
|
||||
closure_custom_calc_extra_options => { errors => 'sysTrunkStatErrorsIn', packets => 'sysTrunkStatPktsIn', label => 'in' },
|
||||
@ -260,7 +263,7 @@ sub set_counters {
|
||||
closure_custom_threshold_check => $self->can('custom_errors_threshold')
|
||||
}
|
||||
},
|
||||
{ label => 'packets-error-out', set => {
|
||||
{ label => 'packets-error-out', nlabel => 'trunk.packets.out.error.percentage', set => {
|
||||
key_values => [ { name => 'sysTrunkStatErrorsOut', diff => 1 }, { name => 'sysTrunkStatPktsOut', diff => 1 }, { name => 'display' } ],
|
||||
closure_custom_calc => $self->can('custom_errors_calc'),
|
||||
closure_custom_calc_extra_options => { errors => 'sysTrunkStatErrorsOut', packets => 'sysTrunkStatPktsOut', label => 'out' },
|
||||
@ -269,7 +272,7 @@ sub set_counters {
|
||||
closure_custom_threshold_check => $self->can('custom_errors_threshold')
|
||||
}
|
||||
},
|
||||
{ label => 'packets-drop-in', set => {
|
||||
{ label => 'packets-drop-in', nlabel => 'trunk.packets.in.dropped.percentage', set => {
|
||||
key_values => [ { name => 'sysTrunkStatDropsIn', diff => 1 }, { name => 'sysTrunkStatPktsIn', diff => 1 }, { name => 'display' } ],
|
||||
closure_custom_calc => $self->can('custom_drops_calc'),
|
||||
closure_custom_calc_extra_options => { drops => 'sysTrunkStatDropsIn', packets => 'sysTrunkStatPktsIn', label => 'in' },
|
||||
@ -278,7 +281,7 @@ sub set_counters {
|
||||
closure_custom_threshold_check => $self->can('custom_drops_threshold')
|
||||
}
|
||||
},
|
||||
{ label => 'packets-drop-out', set => {
|
||||
{ label => 'packets-drop-out', nlabel => 'trunk.packets.out.dropped.percentage', set => {
|
||||
key_values => [ { name => 'sysTrunkStatDropsOut', diff => 1 }, { name => 'sysTrunkStatPktsOut', diff => 1 }, { name => 'display' } ],
|
||||
closure_custom_calc => $self->can('custom_drops_calc'),
|
||||
closure_custom_calc_extra_options => { drops => 'sysTrunkStatDropsOut', packets => 'sysTrunkStatPktsOut', label => 'out' },
|
||||
@ -291,7 +294,7 @@ sub set_counters {
|
||||
key_values => [ { name => 'total_interfaces' }, { name => 'display' } ],
|
||||
output_template => 'total interfaces: %s',
|
||||
perfdatas => [
|
||||
{ label => 'total_interfaces', template => '%d', min => 0, label_extra_instance => 1 }
|
||||
{ template => '%d', min => 0, label_extra_instance => 1 }
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -310,7 +313,7 @@ sub set_counters {
|
||||
|
||||
sub new {
|
||||
my ($class, %options) = @_;
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1);
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1, force_new_perfdata => 1);
|
||||
bless $self, $class;
|
||||
|
||||
$options{options}->add_options(arguments => {
|
||||
@ -465,8 +468,8 @@ Units of thresholds for the traffic (default: '%') ('%', 'b/s').
|
||||
|
||||
=item B<--speed>
|
||||
|
||||
Set trunk speed in Mbps (default: sysTrunkOperBw).
|
||||
If not set and sysTrunkOperBw OID value is 0,
|
||||
Set trunk speed in Mbps (default: C<sysTrunkOperBw>).
|
||||
If not set and C<sysTrunkOperBw> OID value is 0,
|
||||
percentage thresholds will not be applied on traffic metrics.
|
||||
|
||||
=item B<--add-interfaces>
|
||||
@ -503,12 +506,61 @@ You can use the following variables: %{status}, %{display}
|
||||
Define the conditions to match for the status to be CRITICAL.
|
||||
You can use the following variables: %{status}, %{display}
|
||||
|
||||
=item B<--warning-*> B<--critical-*>
|
||||
=item B<--warning-traffic-in>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-traffic-in>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-traffic-out>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-traffic-out>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--warning-packets-error-in>
|
||||
|
||||
Thresholds in %.
|
||||
|
||||
=item B<--critical-packets-error-in>
|
||||
|
||||
Thresholds in %.
|
||||
|
||||
=item B<--warning-packets-error-out>
|
||||
|
||||
Thresholds in %.
|
||||
|
||||
=item B<--critical-packets-error-out>
|
||||
|
||||
Thresholds in %.
|
||||
|
||||
=item B<--warning-packets-drop-in>
|
||||
|
||||
Thresholds in %.
|
||||
|
||||
=item B<--critical-packets-drop-in>
|
||||
|
||||
Thresholds in %.
|
||||
|
||||
=item B<--warning-packets-drop-out>
|
||||
|
||||
Thresholds in %.
|
||||
|
||||
=item B<--critical-packets-drop-out>
|
||||
|
||||
Thresholds in %.
|
||||
|
||||
=item B<--warning-total-interfaces>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-total-interfaces>
|
||||
|
||||
Thresholds.
|
||||
Can be: 'traffic-in', 'traffic-out', 'packets-error-in' (%),
|
||||
'packets-error-out' (%), 'packets-drop-in' (%), 'packets-drop-out' (%),
|
||||
'total-interfaces'.
|
||||
|
||||
=back
|
||||
|
||||
|
@ -197,10 +197,13 @@ You can use the following variables: %{state}, %{status}, %{display}
|
||||
Define the conditions to match for the status to be CRITICAL (default: '%{state} eq "enabled" and %{status} eq "red"').
|
||||
You can use the following variables: %{state}, %{status}, %{display}
|
||||
|
||||
=item B<--warning-*> B<--critical-*>
|
||||
=item B<--warning-current-client-connections>
|
||||
|
||||
Thresholds.
|
||||
|
||||
=item B<--critical-current-client-connections>
|
||||
|
||||
Thresholds.
|
||||
Can be: 'current-client-connections'.
|
||||
|
||||
=back
|
||||
|
||||
|
@ -29,7 +29,6 @@ sub new {
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||
bless $self, $class;
|
||||
|
||||
$self->{version} = '1.0';
|
||||
$self->{modes} = {
|
||||
'apm' => 'network::f5::bigip::snmp::mode::apm',
|
||||
'connections' => 'network::f5::bigip::snmp::mode::connections',
|
||||
|
31
tests/network/f5/bigip/snmp/apm.robot
Normal file
31
tests/network/f5/bigip/snmp/apm.robot
Normal file
@ -0,0 +1,31 @@
|
||||
*** Settings ***
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Ctn Generic Suite Setup
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::f5::bigip::snmp::plugin
|
||||
|
||||
*** Test Cases ***
|
||||
apm ${tc}
|
||||
[Tags] network
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=apm
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/f5/bigip/snmp/slim-f5-bigip
|
||||
... ${extra_options}
|
||||
|
||||
Ctn Verify Command Output ${command} ${expected_result}
|
||||
|
||||
Examples: tc extra_options expected_result --
|
||||
... 1 ${EMPTY} OK: sessions-created : Buffer creation, active sessions: 3724, pending sessions: 146 - All virtual servers are ok
|
||||
... 2 ${EMPTY} OK: created sessions: 0, active sessions: 3724, pending sessions: 146 - All virtual servers are ok | 'system.sessions.created.count'=0;;;0; 'system.sessions.active.count'=3724;;;0; 'system.sessions.pending.count'=146;;;0;
|
||||
... 3 --filter-ap='toto' UNKNOWN: No virtual server found.
|
||||
... 4 --warning-sessions-active=3000 --critical-sessions-active=4000 WARNING: active sessions: 3724 | 'system.sessions.created.count'=0;;;0; 'system.sessions.active.count'=3724;0:3000;0:4000;0; 'system.sessions.pending.count'=146;;;0;
|
||||
... 5 --warning-sessions-pending=100 --critical-sessions-pending=140 CRITICAL: pending sessions: 146 | 'system.sessions.created.count'=0;;;0; 'system.sessions.active.count'=3724;;;0; 'system.sessions.pending.count'=146;0:100;0:140;0;
|
30
tests/network/f5/bigip/snmp/connections.robot
Normal file
30
tests/network/f5/bigip/snmp/connections.robot
Normal file
@ -0,0 +1,30 @@
|
||||
*** Settings ***
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Ctn Generic Suite Setup
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::f5::bigip::snmp::plugin
|
||||
|
||||
*** Test Cases ***
|
||||
connections ${tc}
|
||||
[Tags] network
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=connections
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/f5/bigip/snmp/slim-f5-bigip
|
||||
... ${extra_options}
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc extra_options expected_result --
|
||||
... 1 ${EMPTY} OK: Current client connections : 5395, Current client SSL connections : 0, client-ssl-tps : Buffer creation, Current server connections: 5242, Current server SSL connections : 4574 | 'connections.client.current.count'=5395;;;0; 'connections.client.ssl.current.count'=0;;;0; 'connections.server.current.count'=5242;;;0; 'connections.server.ssl.current.count'=4574;;;0;
|
||||
... 2 --filter-counters='^client-ssl|server-ssl$' OK: Current client SSL connections : 0, client-ssl-tps : Buffer creation, Current server SSL connections : 4574 | 'connections.client.ssl.current.count'=0;;;0; 'connections.server.ssl.current.count'=4574;;;0;
|
||||
... 3 --warning-client=25 WARNING: Current client connections : 5395 | 'connections.client.current.count'=5395;0:25;;0; 'connections.client.ssl.current.count'=0;;;0; 'connections.client.ssl.persecond'=0.00;;;0; 'connections.server.current.count'=5242;;;0; 'connections.server.ssl.current.count'=4574;;;0;
|
||||
... 4 --critical-client=25 CRITICAL: Current client connections : 5395 | 'connections.client.current.count'=5395;;0:25;0; 'connections.client.ssl.current.count'=0;;;0; 'connections.client.ssl.persecond'=0.00;;;0; 'connections.server.current.count'=5242;;;0; 'connections.server.ssl.current.count'=4574;;;0;
|
32
tests/network/f5/bigip/snmp/failover.robot
Normal file
32
tests/network/f5/bigip/snmp/failover.robot
Normal file
@ -0,0 +1,32 @@
|
||||
*** Settings ***
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Ctn Generic Suite Setup
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::f5::bigip::snmp::plugin
|
||||
|
||||
*** Test Cases ***
|
||||
failover ${tc}
|
||||
[Tags] network
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=failover
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/f5/bigip/snmp/slim-f5-bigip
|
||||
... ${extra_options}
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc extra_options expected_result --
|
||||
... 1 ${EMPTY} OK: Sync status is 'inSync' - Failover status is 'active'
|
||||
... 2 --filter-counters='.*' OK: Sync status is 'inSync' - Failover status is 'active'
|
||||
... 3 --warning-sync-status='\\\%{syncstatus} eq "inSync"' WARNING: Sync status is 'inSync'
|
||||
... 4 --critical-sync-status='\\\%{syncstatus} =~ /inSync/' CRITICAL: Sync status is 'inSync'
|
||||
... 5 --warning-failover-status='\\\%{failoverstatus} eq "active"' WARNING: Failover status is 'active'
|
||||
... 6 --critical-failover-status='\\\%{failoverstatus} =~ /active/' CRITICAL: Failover status is 'active'
|
32
tests/network/f5/bigip/snmp/hardware.robot
Normal file
32
tests/network/f5/bigip/snmp/hardware.robot
Normal file
@ -0,0 +1,32 @@
|
||||
*** Settings ***
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Ctn Generic Suite Setup
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::f5::bigip::snmp::plugin
|
||||
... --mode=hardware
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/f5/bigip/snmp/slim-f5-bigip
|
||||
|
||||
*** Test Cases ***
|
||||
hardware ${tc}
|
||||
[Tags] network
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... ${extra_options}
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc extra_options expected_result --
|
||||
... 1 ${EMPTY} OK: All 7 components are ok [4/4 fans, 2/2 psus, 1/1 temperatures]. | '1#hardware.fan.speed.rpm'=0rpm;;;0; '2#hardware.fan.speed.rpm'=0rpm;;;0; '3#hardware.fan.speed.rpm'=0rpm;;;0; '4#hardware.fan.speed.rpm'=0rpm;;;0; '1#hardware.temperature.celsius'=18.00C;;;; 'hardware.fan.count'=4;;;; 'hardware.psu.count'=2;;;; 'hardware.temperature.count'=1;;;;
|
||||
... 2 --filter='.*' --no-component=CRITICAL CRITICAL: No components are checked.
|
||||
... 3 --component='temperature' OK: All 1 components are ok [1/1 temperatures]. | '1#hardware.temperature.celsius'=18.00C;;;; 'hardware.temperature.count'=1;;;;
|
||||
... 4 --threshold-overload='fan,CRITICAL,^good$' CRITICAL: Fan '1' status is 'good' - Fan '2' status is 'good' - Fan '3' status is 'good' - Fan '4' status is 'good' | '1#hardware.fan.speed.rpm'=0rpm;;;0; '2#hardware.fan.speed.rpm'=0rpm;;;0; '3#hardware.fan.speed.rpm'=0rpm;;;0; '4#hardware.fan.speed.rpm'=0rpm;;;0; '1#hardware.temperature.celsius'=18.00C;;;; 'hardware.fan.count'=4;;;; 'hardware.psu.count'=2;;;; 'hardware.temperature.count'=1;;;;
|
||||
... 5 --warning='temperature,.*,20:22' WARNING: Temperature '1' is 18.00 C | '1#hardware.fan.speed.rpm'=0rpm;;;0; '2#hardware.fan.speed.rpm'=0rpm;;;0; '3#hardware.fan.speed.rpm'=0rpm;;;0; '4#hardware.fan.speed.rpm'=0rpm;;;0; '1#hardware.temperature.celsius'=18.00C;20:22;;; 'hardware.fan.count'=4;;;; 'hardware.psu.count'=2;;;; 'hardware.temperature.count'=1;;;;
|
||||
... 6 --critical='temperature,.*,19:25' --warning='temperature,.*,20:22' CRITICAL: Temperature '1' is 18.00 C | '1#hardware.fan.speed.rpm'=0rpm;;;0; '2#hardware.fan.speed.rpm'=0rpm;;;0; '3#hardware.fan.speed.rpm'=0rpm;;;0; '4#hardware.fan.speed.rpm'=0rpm;;;0; '1#hardware.temperature.celsius'=18.00C;20:22;19:25;; 'hardware.fan.count'=4;;;; 'hardware.psu.count'=2;;;; 'hardware.temperature.count'=1;;;;
|
28
tests/network/f5/bigip/snmp/list-trunks.robot
Normal file
28
tests/network/f5/bigip/snmp/list-trunks.robot
Normal file
@ -0,0 +1,28 @@
|
||||
*** Settings ***
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Ctn Generic Suite Setup
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::f5::bigip::snmp::plugin
|
||||
|
||||
*** Test Cases ***
|
||||
list-trunks ${tc}
|
||||
[Tags] network
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=list-trunks
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/f5/bigip/snmp/slim-f5-bigip
|
||||
... ${extra_options}
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc extra_options expected_result --
|
||||
... 1 ${EMPTY} List trunks: 'Anonymized 234' [status: up] [speed: 20000]
|
||||
... 2 --filter-name='toto' List trunks: 'Anonymized 234' [status: up] [speed: 20000] #filter not working
|
28
tests/network/f5/bigip/snmp/list-virtualservers.robot
Normal file
28
tests/network/f5/bigip/snmp/list-virtualservers.robot
Normal file
@ -0,0 +1,28 @@
|
||||
*** Settings ***
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Ctn Generic Suite Setup
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::f5::bigip::snmp::plugin
|
||||
|
||||
*** Test Cases ***
|
||||
list-virtualservers ${tc}
|
||||
[Tags] network
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=list-virtualservers
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/f5/bigip/snmp/slim-f5-bigip
|
||||
... ${extra_options}
|
||||
|
||||
Ctn Verify Command Output ${command} ${expected_result}
|
||||
|
||||
Examples: tc extra_options expected_result --
|
||||
... 1 ${EMPTY} List virtual servers: [name: /Common/ActiveSync.app/ActiveSync_combined_http] [status: blue] [state: enabled] [name: /Common/ActiveSync.app/ActiveSync_combined_https] [status: green] [state: enabled]
|
||||
... 2 --filter-name='toto' List virtual servers:
|
28
tests/network/f5/bigip/snmp/listnodes.robot
Normal file
28
tests/network/f5/bigip/snmp/listnodes.robot
Normal file
@ -0,0 +1,28 @@
|
||||
*** Settings ***
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Ctn Generic Suite Setup
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::f5::bigip::snmp::plugin
|
||||
|
||||
*** Test Cases ***
|
||||
list-nodes ${tc}
|
||||
[Tags] network
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=list-nodes
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/f5/bigip/snmp/slim-f5-bigip
|
||||
... ${extra_options}
|
||||
|
||||
Ctn Verify Command Output ${command} ${expected_result}
|
||||
|
||||
Examples: tc extra_options expected_result --
|
||||
... 1 ${EMPTY} List nodes: [name: /Common/172.20.15.202] [status: blue] [state: enabled] [name: /Common/172.20.2.117] [status: blue] [state: enabled] [name: /Common/172.20.2.127] [status: blue] [state: enabled] [name: /Common/172.20.2.132] [status: blue] [state: enabled]
|
||||
... 2 --filter-name='toto' List nodes:
|
28
tests/network/f5/bigip/snmp/listpools.robot
Normal file
28
tests/network/f5/bigip/snmp/listpools.robot
Normal file
@ -0,0 +1,28 @@
|
||||
*** Settings ***
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Ctn Generic Suite Setup
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::f5::bigip::snmp::plugin
|
||||
|
||||
*** Test Cases ***
|
||||
list-pools ${tc}
|
||||
[Tags] network
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=list-pools
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/f5/bigip/snmp/slim-f5-bigip
|
||||
... ${extra_options}
|
||||
|
||||
Ctn Verify Command Output ${command} ${expected_result}
|
||||
|
||||
Examples: tc extra_options expected_result --
|
||||
... 1 ${EMPTY} List pools: [name: /Common/AN-577_pool] [status: green] [state: enabled] [name: /Common/ActiveDirectory_pool] [status: green] [state: enabled] [name: /Common/ActiveSync.app/ActiveSync_as_pool7] [status: green] [state: enabled] [name: /Common/ActiveSync_cert.app/ActiveSync_cert_as_pool7] [status: green] [state: enabled]
|
||||
... 2 --filter-name='/Common/AN-577_pool' List pools: [name: /Common/AN-577_pool] [status: green] [state: enabled]
|
32
tests/network/f5/bigip/snmp/node-status.robot
Normal file
32
tests/network/f5/bigip/snmp/node-status.robot
Normal file
@ -0,0 +1,32 @@
|
||||
*** Settings ***
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Ctn Generic Suite Setup
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::f5::bigip::snmp::plugin
|
||||
|
||||
*** Test Cases ***
|
||||
node-status ${tc}
|
||||
[Tags] network
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=node-status
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/f5/bigip/snmp/slim-f5-bigip
|
||||
... ${extra_options}
|
||||
|
||||
Ctn Verify Command Output ${command} ${expected_result}
|
||||
|
||||
Examples: tc extra_options expected_result --
|
||||
... 1 ${EMPTY} OK: All nodes are ok | '/Common/delco#node.connections.server.current.count'=0;;;0;
|
||||
... 2 --filter-name='/Common/owa-vip' OK: Node '/Common/owa-vip' status: blue [state: enabled] [reason: Anonymized 164], current server connections : 0 | '/Common/owa-vip#node.connections.server.current.count'=0;;;0;
|
||||
... 3 --unknown-status='\\\%{state} eq "enabled"' UNKNOWN: Node '/Common/delco' status: blue [state: enabled] [reason: Anonymized 027] - Node '/Common/owa-vip' status: blue [state: enabled] [reason: Anonymized 164]
|
||||
... 4 --critical-status='\\\%{state} eq "enabled"' CRITICAL: Node '/Common/delco' status: blue [state: enabled] [reason: Anonymized 027] - Node '/Common/owa-vip' status: blue [state: enabled] [reason: Anonymized 164]
|
||||
... 5 --warning-status='\\\%{state} eq "enabled"' WARNING: Node '/Common/delco' status: blue [state: enabled] [reason: Anonymized 027] - Node '/Common/owa-vip' status: blue [state: enabled] [reason: Anonymized 164]
|
||||
... 6 --warning-current-server-connections=10 --critical-current-server-connections=5 CRITICAL: Node '/Common/172.20.25.4' current server connections : 59 - Node '/Common/eloi-prod-vs' current server connections : 15 - Node '/Common/ibcm-prd-app1'
|
32
tests/network/f5/bigip/snmp/pool-status.robot
Normal file
32
tests/network/f5/bigip/snmp/pool-status.robot
Normal file
@ -0,0 +1,32 @@
|
||||
*** Settings ***
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Ctn Generic Suite Setup
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::f5::bigip::snmp::plugin
|
||||
|
||||
*** Test Cases ***
|
||||
pool-status ${tc}
|
||||
[Tags] network
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=pool-status
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/f5/bigip/snmp/slim-f5-bigip
|
||||
... ${extra_options}
|
||||
|
||||
Ctn Verify Command Output ${command} ${expected_result}
|
||||
|
||||
Examples: tc extra_options expected_result --
|
||||
... 1 ${EMPTY} OK: All pools are ok | '/Common/IDM_pool#pool.connections.server.current.count'=0;;;0; '/Common/IDM_pool#pool.members.active.count'=0;;;0;
|
||||
... 2 --filter-name='/Common/IDM_pool' OK: Pool '/Common/IDM_pool' status: blue [state: enabled] [reason: Anonymized 149] - current server connections: 0, current active members: 0 | '/Common/IDM_pool#pool.connections.server.current.count'=0;;;0; '/Common/IDM_pool#pool.members.active.count'=0;;;0; '/Common/IDM_pool#pool.members.total.count'=1;;;0;
|
||||
... 3 --unknown-status='\\\%{state} eq "enabled"' UNKNOWN: Pool '/Common/IDM_pool' status: blue [state: enabled] [reason: Anonymized 149] - Pool '/Common/OWA_pool' status: green [state: enabled] [reason: Anonymized 183]
|
||||
... 4 --critical-status='\\\%{state} eq "enabled"' CRITICAL: Pool '/Common/IDM_pool' status: blue [state: enabled] [reason: Anonymized 149] - Pool '/Common/OWA_pool' status: green [state: enabled] [reason: Anonymized 183]
|
||||
... 5 --warning-status='\\\%{state} eq "enabled"' WARNING: Pool '/Common/IDM_pool' status: blue [state: enabled] [reason: Anonymized 149] - Pool '/Common/OWA_pool' status: green [state: enabled] [reason: Anonymized 183]
|
||||
... 6 --warning-current-server-connections=10 --critical-current-server-connections=5 CRITICAL: Pool '/Common/Eloi_pool' current server connections: 10 - Pool '/Common/Portan_pool' current server connections: 6
|
20700
tests/network/f5/bigip/snmp/slim-f5-bigip.snmpwalk
Normal file
20700
tests/network/f5/bigip/snmp/slim-f5-bigip.snmpwalk
Normal file
File diff suppressed because it is too large
Load Diff
31
tests/network/f5/bigip/snmp/tmm-usage.robot
Normal file
31
tests/network/f5/bigip/snmp/tmm-usage.robot
Normal file
@ -0,0 +1,31 @@
|
||||
*** Settings ***
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Ctn Generic Suite Setup
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::f5::bigip::snmp::plugin
|
||||
|
||||
*** Test Cases ***
|
||||
tmm-usage ${tc}
|
||||
[Tags] network
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=tmm-usage
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/f5/bigip/snmp/slim-f5-bigip
|
||||
... ${extra_options}
|
||||
|
||||
Ctn Verify Command Output ${command} ${expected_result}
|
||||
|
||||
Examples: tc extra_options expected_result --
|
||||
... 1 ${EMPTY} OK: All TMM are ok | '0.0#tmm.memory.usage.bytes'=2175382320B;;;0;22695378944 '0.0#tmm.cpu.utilization.1m.percentage'=15%;;;0;100 '0.0#tmm.cpu.utilization.5m.percentage'=15%;;;0;100 '0.0#tmm.connections.client.curent.count'=1324;;;0; '0.0#tmm.connections.server.current.count'=1303;;;0; '0.2#tmm.cpu.utilization.1m.percentage'=12%;;;0;100 '0.2#tmm.cpu.utilization.5m.percentage'=11%;;;0;100 '0.2#tmm.connections.client.curent.count'=1368;;;0; '0.2#tmm.connections.server.current.count'=1291;;;0; '0.4#tmm.cpu.utilization.1m.percentage'=11%;;;0;100 '0.4#tmm.cpu.utilization.5m.percentage'=10%;;;0;100 '0.4#tmm.connections.client.curent.count'=1369;;;0; '0.4#tmm.connections.server.current.count'=1331;;;0; '0.6#tmm.cpu.utilization.1m.percentage'=18%;;;0;100 '0.6#tmm.cpu.utilization.5m.percentage'=12%;;;0;100 '0.6#tmm.connections.client.curent.count'=1331;;;0; '0.6#tmm.connections.server.current.count'=1324;;;0;
|
||||
... 2 --filter-counters='' OK: All TMM are ok
|
||||
... 3 --filter-name='TMM' UNKNOWN: No TMM found.
|
||||
... 4 --critical-cpu-1m=12 CRITICAL: TMM '0.0' CPU Usage 1min : 15 % - TMM '0.6' CPU Usage 1min : 18 % | '0.0#tmm.memory.usage.bytes'=2175382320B;;;0;22695378944
|
||||
... 5 --warning-cpu-5m=10 WARNING: TMM '0.0' CPU Usage 5min : 15 % - TMM '0.2' CPU Usage 5min : 11 % - TMM '0.6' CPU Usage 5min : 12 % | '0.0#tmm.memory.usage.bytes'=2175382320B;;;0;22695378944
|
32
tests/network/f5/bigip/snmp/trunks.robot
Normal file
32
tests/network/f5/bigip/snmp/trunks.robot
Normal file
@ -0,0 +1,32 @@
|
||||
*** Settings ***
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Ctn Generic Suite Setup
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::f5::bigip::snmp::plugin
|
||||
|
||||
*** Test Cases ***
|
||||
trunks ${tc}
|
||||
[Tags] network
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=trunks
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/f5/bigip/snmp/slim-f5-bigip
|
||||
... ${extra_options}
|
||||
|
||||
Ctn Verify Command Output ${command} ${expected_result}
|
||||
|
||||
Examples: tc extra_options expected_result --
|
||||
... 1 ${EMPTY} OK: Trunk 'Anonymized 234' status is 'up', traffic in: Buffer creation, traffic out: Buffer creation, packets in error: Buffer creation, packets out error: Buffer creation, packets in drop: Buffer creation, packets out drop: Buffer creation
|
||||
... 2 --filter-name='Anonymized 234' OK: Trunk 'Anonymized 234' status is 'up', traffic in: Buffer creation, traffic out: Buffer creation, packets in error: Buffer creation, packets out error: Buffer creation, packets in drop: Buffer creation, packets out drop: Buffer creation
|
||||
... 3 --warning-status='\\\%{status} eq "up"' WARNING: Trunk 'Anonymized 234' status is 'up' | 'Anonymized 234#trunk.traffic.in.bitspersecond'=0.00b/s;;;0;20000000000 'Anonymized 234#trunk.traffic.out.bitspersecond'=0.00b/s;;;0;20000000000 'Anonymized 234#trunk.packets.in.error.percentage'=0.00%;;;0;100
|
||||
... 4 --critical-status='\\\%{status} eq "up"' CRITICAL: Trunk 'Anonymized 234' status is 'up' | 'Anonymized 234#trunk.traffic.in.bitspersecond'=0.00b/s;;;0;20000000000 'Anonymized 234#trunk.traffic.out.bitspersecond'=0.00b/s;;;0;20000000000 'Anonymized 234#trunk.packets.in.error.percentage'=0.00%;;;0;100
|
||||
... 5 --unknown-status='\\\%{status} eq "up"' UNKNOWN: Trunk 'Anonymized 234' status is 'up' | 'Anonymized 234#trunk.traffic.in.bitspersecond'=0.00b/s;;;0;20000000000 'Anonymized 234#trunk.traffic.out.bitspersecond'=0.00b/s;;;0;20000000000 'Anonymized 234#trunk.packets.in.error.percentage'=0.00%;;;0;100
|
||||
... 6 --warning-packets-error-in=50 --critical-packets-error-in=100 OK: Trunk 'Anonymized 234' status is 'up', traffic in: 0.00b/s (0.00%), traffic out: 0.00b/s (0.00%), packets in error: 0.00%, packets out error: 0.00%,
|
32
tests/network/f5/bigip/snmp/virtualserver-status.robot
Normal file
32
tests/network/f5/bigip/snmp/virtualserver-status.robot
Normal file
@ -0,0 +1,32 @@
|
||||
*** Settings ***
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Ctn Generic Suite Setup
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::f5::bigip::snmp::plugin
|
||||
|
||||
*** Test Cases ***
|
||||
virtualserver-status ${tc}
|
||||
[Tags] network
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=virtualserver-status
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/f5/bigip/snmp/slim-f5-bigip
|
||||
... ${extra_options}
|
||||
|
||||
Ctn Verify Command Output ${command} ${expected_result}
|
||||
|
||||
Examples: tc extra_options expected_result --
|
||||
... 1 ${EMPTY} OK: All virtual servers are ok | '/Common/OWA_vs#virtualserver.connections.client.current.count'=0;;;0; '/Common/Ibcm_vs#virtualserver.connections.client.current.count'=22;;;0; '/Common/SAML_vs#virtualserver.connections.client.current.count'=22;;;0; '/Common/Wtop_vs#virtualserver.connections.client.current.count'=0;;;0;
|
||||
... 2 --filter-name='toto' UNKNOWN: No entry found.
|
||||
... 3 --warning-status='\\\%{state} eq "enabled"' WARNING: Virtual server '/Common/Ibcm_vs' status: green [state: enabled] [reason: Anonymized 251] - Virtual server '/Common/SAML_vs' status: blue [state: enabled] [reason: Anonymized 107]
|
||||
... 4 --critical-status='\\\%{state} eq "enabled"' CRITICAL: Virtual server '/Common/Ibcm_vs' status: green [state: enabled] [reason: Anonymized 251] - Virtual server '/Common/SAML_vs' status: blue [state: enabled] [reason: Anonymized 107]
|
||||
... 5 --unknown-status='\\\%{state} eq "enabled"' UNKNOWN: Virtual server '/Common/Ibcm_vs' status: green [state: enabled] [reason: Anonymized 251] - Virtual server '/Common/SAML_vs' status: blue [state: enabled] [reason: Anonymized 107]
|
||||
... 6 --warning-current-client-connections=42 --critical-current-client-connections=50 CRITICAL: Virtual server '/Common/ws-prd-ds_vs' current client connections: 111 - Virtual server '/Common/SSO_portail_vs' current client connections: 236
|
@ -75,6 +75,8 @@ ESX
|
||||
eth
|
||||
Exense
|
||||
ext4
|
||||
F5
|
||||
failover
|
||||
fanspeed
|
||||
FCCapacity
|
||||
fibre
|
||||
@ -117,9 +119,9 @@ io-cards
|
||||
iops
|
||||
IpAddr
|
||||
ip-label
|
||||
ipsec
|
||||
ipv4
|
||||
ipv6
|
||||
ipsec
|
||||
ISAM
|
||||
Iwsva
|
||||
jmeter
|
||||
@ -150,6 +152,7 @@ memBuffer
|
||||
memTotalReal
|
||||
Meraki
|
||||
MIB
|
||||
Microkernel
|
||||
module-cellradio-csq
|
||||
module-cellradio-rscp
|
||||
module-cellradio-rsrp
|
||||
@ -250,6 +253,7 @@ teampass
|
||||
Teldat
|
||||
timeframe
|
||||
TiMOS
|
||||
TMM
|
||||
tmnxSasAlarmInputDescription
|
||||
topic-messages-inflighted
|
||||
total-offline-prct
|
||||
@ -278,8 +282,8 @@ VeloCloud
|
||||
VM
|
||||
VMware
|
||||
VMWARE
|
||||
VPN
|
||||
vpn
|
||||
VPN
|
||||
vSAN
|
||||
Vserver
|
||||
vSphere
|
||||
|
Loading…
x
Reference in New Issue
Block a user