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:
qgarnier 2025-04-01 18:06:41 +02:00 committed by GitHub
parent 5d10adc39b
commit edd04d213c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
31 changed files with 21520 additions and 227 deletions

View File

@ -26,6 +26,24 @@ use strict;
use warnings; use warnings;
use Digest::MD5 qw(md5_hex); 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 { sub set_counters {
my ($self, %options) = @_; 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 { sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1, statefile => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1, statefile => 1);
@ -214,11 +214,53 @@ Filter virtual server name (can be a regexp).
Filter access profile 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. Thresholds.
Can be: 'sessions-created', 'sessions-active', 'sessions-pending',
'ap-sessions-created', 'ap-sessions-active', 'ap-sessions-pending'.
=back =back

View File

@ -59,25 +59,37 @@ sub check {
$self->{components}->{fan}->{total}++; $self->{components}->{fan}->{total}++;
$self->{output}->output_add(long_msg => sprintf("fan '%s' status is '%s' [instance: %s, speed: %s].", $self->{output}->output_add(
$instance, $result->{sysChassisFanStatus}, $instance, long_msg => sprintf(
defined($result->{sysChassisFanSpeed}) ? $result->{sysChassisFanSpeed} : '-')); "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}); my $exit = $self->get_severity(section => 'fan', value => $result->{sysChassisFanStatus});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("Fan '%s' status is '%s'", severity => $exit,
$instance, $result->{sysChassisFanStatus})); short_msg => sprintf(
"Fan '%s' status is '%s'",
$instance, $result->{sysChassisFanStatus}
)
);
} }
if (defined($result->{sysChassisFanSpeed}) && $result->{sysChassisFanSpeed} =~ /[0-9]/) { if (defined($result->{sysChassisFanSpeed}) && $result->{sysChassisFanSpeed} =~ /[0-9]/) {
my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'fan', instance => $instance, value => $result->{sysChassisFanSpeed}); 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)) { if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit2, $self->{output}->output_add(
short_msg => sprintf("fan speed '%s' is %s rpm", $instance, $result->{sysChassisFanSpeed})); severity => $exit2,
short_msg => sprintf("fan speed '%s' is %s rpm", $instance, $result->{sysChassisFanSpeed})
);
} }
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => "fan", unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm', nlabel => 'hardware.fan.speed.rpm',
unit => 'rpm',
instances => $instance, instances => $instance,
value => $result->{sysChassisFanSpeed}, value => $result->{sysChassisFanSpeed},
warning => $warn, warning => $warn,

View File

@ -57,14 +57,22 @@ sub check {
$self->{components}->{psu}->{total}++; $self->{components}->{psu}->{total}++;
$self->{output}->output_add(long_msg => sprintf("power supply '%s' status is '%s' [instance: %s].", $self->{output}->output_add(
$instance, $result->{sysChassisPowerSupplyStatus}, $instance 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}); my $exit = $self->get_severity(section => 'psu', value => $result->{sysChassisPowerSupplyStatus});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("Power supply '%s' status is '%s'", severity => $exit,
$instance, $result->{sysChassisPowerSupplyStatus})); short_msg => sprintf(
"Power supply '%s' status is '%s'",
$instance, $result->{sysChassisPowerSupplyStatus}
)
);
} }
} }
} }

View File

@ -48,19 +48,25 @@ sub check {
next if ($self->check_filter(section => 'temperature', instance => $instance)); next if ($self->check_filter(section => 'temperature', instance => $instance));
$self->{components}->{temperature}->{total}++; $self->{components}->{temperature}->{total}++;
$self->{output}->output_add(long_msg => sprintf("temperature '%s' is %.2f C [instance: %s].", $self->{output}->output_add(
$instance, $result->{sysChassisTempTemperature}, $instance long_msg => sprintf(
)); "temperature '%s' is %.2f C [instance: %s].",
$instance, $result->{sysChassisTempTemperature}, $instance
)
);
if (defined($result->{sysChassisTempTemperature}) && $result->{sysChassisTempTemperature} =~ /[0-9]/) { if (defined($result->{sysChassisTempTemperature}) && $result->{sysChassisTempTemperature} =~ /[0-9]/) {
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{sysChassisTempTemperature}); 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)) { if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("Temperature '%s' is %.2f C", $instance, $result->{sysChassisTempTemperature})); severity => $exit,
short_msg => sprintf("Temperature '%s' is %.2f C", $instance, $result->{sysChassisTempTemperature})
);
} }
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => "temp", unit => 'C',
nlabel => 'hardware.temperature.celsius', nlabel => 'hardware.temperature.celsius',
unit => 'C',
instances => $instance, instances => $instance,
value => sprintf("%.2f", $result->{sysChassisTempTemperature}), value => sprintf("%.2f", $result->{sysChassisTempTemperature}),
warning => $warn, warning => $warn,

View File

@ -42,55 +42,57 @@ sub set_counters {
$self->{maps_counters_type} = [ $self->{maps_counters_type} = [
{ name => 'global', type => 0 }, { name => 'global', type => 0 },
]; ];
$self->{maps_counters}->{global} = [ $self->{maps_counters}->{global} = [
{ label => 'client', set => { { label => 'client', nlabel => 'connections.client.current.count', set => {
key_values => [ { name => 'client' } ], key_values => [ { name => 'client' } ],
output_template => 'Current client connections : %s', output_template => 'Current client connections : %s',
perfdatas => [ 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' } ], key_values => [ { name => 'client_ssl' } ],
output_template => 'Current client SSL connections : %s', output_template => 'Current client SSL connections : %s',
perfdatas => [ 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 } ], 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'), closure_custom_calc => $self->can('custom_client_tps_calc'),
perfdatas => [ perfdatas => [
{ label => 'ClientSSL_Tps', value => 'client_ssl_tps', template => '%.2f', { value => 'client_ssl_tps', template => '%.2f', min => 0 }
unit => 'tps', min => 0 }, ]
],
} }
}, },
{ label => 'server', set => { { label => 'server', nlabel => 'connections.server.current.count', set => {
key_values => [ { name => 'server' } ], key_values => [ { name => 'server' } ],
output_template => 'Current server connections: %s', output_template => 'Current server connections: %s',
perfdatas => [ 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' } ], key_values => [ { name => 'server_ssl' } ],
output_template => 'Current server SSL connections : %s', output_template => 'Current server SSL connections : %s',
perfdatas => [ perfdatas => [
{ label => 'ServerSSL', template => '%s', min => 0, unit => 'con' }, { template => '%s', min => 0 }
], ]
} }
}, }
]; ];
} }
sub new { sub new {
my ($class, %options) = @_; 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; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
@ -102,7 +104,7 @@ sub new {
sub manage_selection { sub manage_selection {
my ($self, %options) = @_; 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')); (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'; my $oid_sysStatClientCurConns = '.1.3.6.1.4.1.3375.2.1.1.2.1.8.0';
@ -125,13 +127,14 @@ sub manage_selection {
], ],
nothing_quit => 1 nothing_quit => 1
); );
$self->{global} = { $self->{global} = {
client => $result->{$oid_sysStatClientCurConns}, client => $result->{$oid_sysStatClientCurConns},
client_ssl => $result->{$oid_sysClientsslStatCurConns}, client_ssl => $result->{$oid_sysClientsslStatCurConns},
client_ssl_tot_native => $result->{$oid_sysClientsslStatTotNativeConns}, client_ssl_tot_native => $result->{$oid_sysClientsslStatTotNativeConns},
client_ssl_tot_compat => $result->{$oid_sysClientsslStatTotCompatConns}, client_ssl_tot_compat => $result->{$oid_sysClientsslStatTotCompatConns},
server => $result->{$oid_sysStatServerCurConns}, 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). Only display some counters (regexp can be used).
Example to check SSL connections only : --filter-counters='^client-ssl|server-ssl$' Example to check SSL connections only : --filter-counters='^client-ssl|server-ssl$'
=item B<--warning-*> =item B<--warning-client>
Warning threshold. Thresholds.
Can be: 'client', 'server', 'client-ssl', 'server-ssl', 'client-ssl-tps'.
=item B<--critical-*> =item B<--critical-client>
Critical threshold. Thresholds.
Can be: 'client', 'server', 'client-ssl', 'server-ssl', 'client-ssl-tps'.
=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 =back

View File

@ -24,7 +24,19 @@ use base qw(centreon::plugins::templates::counter);
use strict; use strict;
use warnings; 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 { sub set_counters {
my ($self, %options) = @_; my ($self, %options) = @_;
@ -34,78 +46,36 @@ sub set_counters {
]; ];
$self->{maps_counters}->{global} = [ $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' } ], key_values => [ { name => 'syncstatus' } ],
closure_custom_calc => \&custom_syncstatus_calc,
closure_custom_output => \&custom_syncstatus_output, closure_custom_output => \&custom_syncstatus_output,
closure_custom_perfdata => sub { return 0; }, 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' } ], key_values => [ { name => 'failoverstatus' } ],
closure_custom_calc => \&custom_failoverstatus_calc,
closure_custom_output => \&custom_failoverstatus_output, closure_custom_output => \&custom_failoverstatus_output,
closure_custom_perfdata => sub { return 0; }, 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 { 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;
$options{options}->add_options(arguments => { $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/' },
});
return $self; 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 = ( my %map_boolean = (
0 => 'false', 0 => 'false',
1 => 'true', 1 => 'true'
); );
my %map_sync_status = ( my %map_sync_status = (
0 => 'unknown', 0 => 'unknown',
@ -117,21 +87,21 @@ my %map_sync_status = (
6 => 'standalone', 6 => 'standalone',
7 => 'awaitingInitialSync', 7 => 'awaitingInitialSync',
8 => 'incompatibleVersion', 8 => 'incompatibleVersion',
9 => 'partialSync', 9 => 'partialSync'
); );
my %map_failover_status = ( my %map_failover_status = (
0 => 'unknown', 0 => 'unknown',
1 => 'offline', 1 => 'offline',
2 => 'forcedOffline', 2 => 'forcedOffline',
3 => 'standby', 3 => 'standby',
4 => 'active', 4 => 'active'
); );
my $mapping = { my $mapping = {
sysAttrFailoverIsRedundant => { oid => '.1.3.6.1.4.1.3375.2.1.1.1.1.13', map => \%map_boolean }, 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 }, 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 }, 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 { sub manage_selection {
@ -187,22 +157,22 @@ Only display some counters (regexp can be used).
=item B<--warning-sync-status> =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} You can use the following variables: %{syncstatus}
=item B<--critical-sync-status> =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} You can use the following variables: %{syncstatus}
=item B<--warning-failover-status> =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} You can use the following variables: %{failoverstatus}
=item B<--critical-failover-status> =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} You can use the following variables: %{failoverstatus}
=back =back

View File

@ -58,7 +58,7 @@ sub snmp_execute {
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, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => {}); $options{options}->add_options(arguments => {});

View File

@ -103,8 +103,10 @@ sub run {
); );
} }
$self->{output}->output_add(severity => 'OK', $self->{output}->output_add(
short_msg => 'List nodes:'); severity => 'OK',
short_msg => 'List nodes:'
);
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
$self->{output}->exit(); $self->{output}->exit();
} }

View File

@ -106,8 +106,10 @@ sub run {
); );
} }
$self->{output}->output_add(severity => 'OK', $self->{output}->output_add(
short_msg => 'List pools:'); severity => 'OK',
short_msg => 'List pools:'
);
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
$self->{output}->exit(); $self->{output}->exit();
} }

View File

@ -122,8 +122,10 @@ sub run {
); );
} }
$self->{output}->output_add(severity => 'OK', $self->{output}->output_add(
short_msg => 'List virtual servers:'); severity => 'OK',
short_msg => 'List virtual servers:'
);
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1); $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
$self->{output}->exit(); $self->{output}->exit();
} }

View File

@ -64,12 +64,11 @@ sub set_counters {
closure_custom_threshold_check => \&catalog_status_threshold_ng 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' } ], key_values => [ { name => 'ltmNodeAddrStatServerCurConns' }, { name => 'display' } ],
output_template => 'current server connections : %s', output_template => 'current server connections : %s',
perfdatas => [ perfdatas => [
{ label => 'current_server_connections', template => '%s', { template => '%s', min => 0, label_extra_instance => 1, instance_use => 'display' }
min => 0, label_extra_instance => 1, instance_use => 'display' }
] ]
} }
} }
@ -78,7 +77,7 @@ sub set_counters {
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, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
@ -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"'). 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} 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. Thresholds.
Can be: 'current-server-connections'.
=back =back

View File

@ -91,7 +91,7 @@ sub set_counters {
]; ];
$self->{maps_counters}->{pool_connections} = [ $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' } ], key_values => [ { name => 'ltmPoolStatServerCurConns' }, { name => 'display' } ],
output_template => 'current server connections: %s', output_template => 'current server connections: %s',
perfdatas => [ 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. Define the conditions to match for the status to be CRITICAL.
You can use the following variables: %{state}, %{status}, %{poolName}, %{nodeName} 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. Thresholds.
Can be: 'current-server-connections', 'current-active-members', 'current-total-members'.
=back =back

View File

@ -30,8 +30,9 @@ sub custom_usage_perfdata {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'memory_used', unit => 'B', nlabel => $self->{nlabel},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, unit => 'B',
instances => $self->{result_values}->{display},
value => $self->{result_values}->{used}, value => $self->{result_values}->{used},
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}, total => $self->{result_values}->{total}, cast_int => 1), 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), 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_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 ($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%%)", return sprintf(
$total_size_value . " " . $total_size_unit, "Memory Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)",
$total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used}, $total_size_value . " " . $total_size_unit,
$total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}); $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used},
return $msg; $total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}
);
} }
sub custom_usage_calc { sub custom_usage_calc {
@ -73,6 +75,12 @@ sub custom_usage_calc {
return 0; return 0;
} }
sub prefix_tmm_output {
my ($self, %options) = @_;
return "TMM '" . $options{instance_value}->{display} . "' ";
}
sub set_counters { sub set_counters {
my ($self, %options) = @_; my ($self, %options) = @_;
@ -81,84 +89,73 @@ sub set_counters {
]; ];
$self->{maps_counters}->{tmm} = [ $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' } ], key_values => [ { name => 'display' }, { name => 'sysTmmStatMemoryTotal' }, { name => 'sysTmmStatMemoryUsed' } ],
closure_custom_calc => $self->can('custom_usage_calc'), closure_custom_calc => $self->can('custom_usage_calc'),
closure_custom_output => $self->can('custom_usage_output'), closure_custom_output => $self->can('custom_usage_output'),
closure_custom_perfdata => $self->can('custom_usage_perfdata'), 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' } ], key_values => [ { name => 'sysTmmStatTmUsageRatio1m' }, { name => 'display' } ],
output_template => 'CPU Usage 1min : %s %%', output_error_template => "CPU Usage 1min : %s", output_template => 'CPU Usage 1min : %s %%', output_error_template => "CPU Usage 1min : %s",
perfdatas => [ perfdatas => [
{ label => 'cpu_1m', value => 'sysTmmStatTmUsageRatio1m', template => '%s', { template => '%s', unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display' }
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' } ], key_values => [ { name => 'sysTmmStatTmUsageRatio5m' }, { name => 'display' } ],
output_template => 'CPU Usage 5min : %s %%', output_error_template => "CPU Usage 5min : %s", output_template => 'CPU Usage 5min : %s %%', output_error_template => "CPU Usage 5min : %s",
perfdatas => [ perfdatas => [
{ label => 'cpu_5m', value => 'sysTmmStatTmUsageRatio5m', template => '%s', { template => '%s', unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display' }
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' } ], key_values => [ { name => 'sysTmmStatClientCurConns' }, { name => 'display' } ],
output_template => 'Current Client Connections : %s', output_error_template => "Current Client Connections : %s", output_template => 'Current Client Connections : %s', output_error_template => "Current Client Connections : %s",
perfdatas => [ perfdatas => [
{ label => 'current_client_connections', value => 'sysTmmStatClientCurConns', template => '%s', { label => 'current_client_connections', template => '%s',
min => 0, label_extra_instance => 1, instance_use => 'display' }, 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' } ], key_values => [ { name => 'sysTmmStatClientTotConns', diff => 1 }, { name => 'display' } ],
output_template => 'Total Client Connections : %s', output_error_template => "Total Client Connections : %s", output_template => 'Total Client Connections : %s', output_error_template => "Total Client Connections : %s",
perfdatas => [ perfdatas => [
{ label => 'total_client_connections', value => 'sysTmmStatClientTotConns', template => '%s', { template => '%s', min => 0, label_extra_instance => 1, instance_use => 'display' }
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' } ], key_values => [ { name => 'sysTmmStatServerCurConns' }, { name => 'display' } ],
output_template => 'Current Server Connections : %s', output_error_template => "Current Server Connections : %s", output_template => 'Current Server Connections : %s', output_error_template => "Current Server Connections : %s",
perfdatas => [ perfdatas => [
{ label => 'current_server_connections', value => 'sysTmmStatServerCurConns', template => '%s', { template => '%s', min => 0, label_extra_instance => 1, instance_use => 'display' }
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' } ], key_values => [ { name => 'sysTmmStatServerTotConns', diff => 1 }, { name => 'display' } ],
output_template => 'Total Server Connections : %s', output_error_template => "Total Server Connections : %s", output_template => 'Total Server Connections : %s', output_error_template => "Total Server Connections : %s",
perfdatas => [ perfdatas => [
{ label => 'total_server_connections', value => 'sysTmmStatServerTotConns', template => '%s', { template => '%s', min => 0, label_extra_instance => 1, instance_use => 'display' }
min => 0, label_extra_instance => 1, instance_use => 'display' }, ]
],
} }
}, }
]; ];
} }
sub prefix_tmm_output {
my ($self, %options) = @_;
return "TMM '" . $options{instance_value}->{display} . "' ";
}
sub new { sub new {
my ($class, %options) = @_; 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; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
'filter-name:s' => { name => 'filter_name' }, 'filter-name:s' => { name => 'filter_name' }
}); });
return $self; return $self;
@ -224,7 +221,7 @@ __END__
=head1 MODE =head1 MODE
Check TMM usages. Check TMM (Traffic Management Microkernel) usages.
=over 8 =over 8
@ -235,19 +232,63 @@ Example : --filter-counters='^memory-usage$'
=item B<--filter-name> =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. Thresholds.
Can be: 'cpu-1m', 'cpu-5m', 'memory-usage' (%), 'total-client-connections', 'current-client-connections',
'total-server-connections', 'current-server-connections'.
=item B<--critical-*> =item B<--critical-cpu-1m>
Critical threshold. Thresholds.
Can be: 'cpu-1m', 'cpu-5m', 'memory-usage' (%), 'total-client-connections', 'current-client-connections',
'total-server-connections', 'current-server-connections'. =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 =back

View File

@ -42,8 +42,9 @@ sub custom_traffic_perfdata {
my $speed = $self->{result_values}->{speed} > 0 ? $self->{result_values}->{speed} : undef; my $speed = $self->{result_values}->{speed} > 0 ? $self->{result_values}->{speed} : undef;
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'traffic_' . $self->{result_values}->{label}, unit => 'b/s', nlabel => $self->{nlabel},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, unit => 'b/s',
instances => $self->{result_values}->{display},
value => sprintf("%.2f", $self->{result_values}->{traffic_per_seconds}), value => sprintf("%.2f", $self->{result_values}->{traffic_per_seconds}),
warning => $warning, warning => $warning,
critical => $critical, critical => $critical,
@ -101,8 +102,9 @@ sub custom_errors_perfdata {
my $critical = $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}); my $critical = $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel});
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'packets_error_' . $self->{result_values}->{label}, unit => '%', nlabel => $self->{nlabel},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, unit => '%',
instances => $self->{result_values}->{display},
value => sprintf("%.2f", $self->{result_values}->{errors_prct}), value => sprintf("%.2f", $self->{result_values}->{errors_prct}),
warning => $warning, warning => $warning,
critical => $critical, critical => $critical,
@ -150,8 +152,9 @@ sub custom_drops_perfdata {
my $critical = $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}); my $critical = $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel});
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => 'packets_drop_' . $self->{result_values}->{label}, unit => '%', nlabel => $self->{nlabel},
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, unit => '%',
instances => $self->{result_values}->{display},
value => sprintf("%.2f", $self->{result_values}->{drops_prct}), value => sprintf("%.2f", $self->{result_values}->{drops_prct}),
warning => $warning, warning => $warning,
critical => $critical, critical => $critical,
@ -233,7 +236,7 @@ sub set_counters {
closure_custom_threshold_check => \&catalog_status_threshold_ng 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' } ], key_values => [ { name => 'sysTrunkStatBytesIn', diff => 1 }, { name => 'sysTrunkOperBw', diff => 1 }, { name => 'display' } ],
closure_custom_calc => $self->can('custom_traffic_calc'), closure_custom_calc => $self->can('custom_traffic_calc'),
closure_custom_calc_extra_options => { label_ref => 'sysTrunkStatBytesIn', speed => 'sysTrunkOperBw', label => 'in' }, 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') 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' } ], key_values => [ { name => 'sysTrunkStatBytesOut', diff => 1 }, { name => 'sysTrunkOperBw', diff => 1 }, { name => 'display' } ],
closure_custom_calc => $self->can('custom_traffic_calc'), closure_custom_calc => $self->can('custom_traffic_calc'),
closure_custom_calc_extra_options => { label_ref => 'sysTrunkStatBytesOut', speed => 'sysTrunkOperBw', label => 'out' }, 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') 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' } ], key_values => [ { name => 'sysTrunkStatErrorsIn', diff => 1 }, { name => 'sysTrunkStatPktsIn', diff => 1 }, { name => 'display' } ],
closure_custom_calc => $self->can('custom_errors_calc'), closure_custom_calc => $self->can('custom_errors_calc'),
closure_custom_calc_extra_options => { errors => 'sysTrunkStatErrorsIn', packets => 'sysTrunkStatPktsIn', label => 'in' }, 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') 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' } ], key_values => [ { name => 'sysTrunkStatErrorsOut', diff => 1 }, { name => 'sysTrunkStatPktsOut', diff => 1 }, { name => 'display' } ],
closure_custom_calc => $self->can('custom_errors_calc'), closure_custom_calc => $self->can('custom_errors_calc'),
closure_custom_calc_extra_options => { errors => 'sysTrunkStatErrorsOut', packets => 'sysTrunkStatPktsOut', label => 'out' }, 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') 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' } ], key_values => [ { name => 'sysTrunkStatDropsIn', diff => 1 }, { name => 'sysTrunkStatPktsIn', diff => 1 }, { name => 'display' } ],
closure_custom_calc => $self->can('custom_drops_calc'), closure_custom_calc => $self->can('custom_drops_calc'),
closure_custom_calc_extra_options => { drops => 'sysTrunkStatDropsIn', packets => 'sysTrunkStatPktsIn', label => 'in' }, 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') 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' } ], key_values => [ { name => 'sysTrunkStatDropsOut', diff => 1 }, { name => 'sysTrunkStatPktsOut', diff => 1 }, { name => 'display' } ],
closure_custom_calc => $self->can('custom_drops_calc'), closure_custom_calc => $self->can('custom_drops_calc'),
closure_custom_calc_extra_options => { drops => 'sysTrunkStatDropsOut', packets => 'sysTrunkStatPktsOut', label => 'out' }, 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' } ], key_values => [ { name => 'total_interfaces' }, { name => 'display' } ],
output_template => 'total interfaces: %s', output_template => 'total interfaces: %s',
perfdatas => [ 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 { sub new {
my ($class, %options) = @_; 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; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
@ -465,8 +468,8 @@ Units of thresholds for the traffic (default: '%') ('%', 'b/s').
=item B<--speed> =item B<--speed>
Set trunk speed in Mbps (default: sysTrunkOperBw). Set trunk speed in Mbps (default: C<sysTrunkOperBw>).
If not set and sysTrunkOperBw OID value is 0, If not set and C<sysTrunkOperBw> OID value is 0,
percentage thresholds will not be applied on traffic metrics. percentage thresholds will not be applied on traffic metrics.
=item B<--add-interfaces> =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. Define the conditions to match for the status to be CRITICAL.
You can use the following variables: %{status}, %{display} 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. Thresholds.
Can be: 'traffic-in', 'traffic-out', 'packets-error-in' (%),
'packets-error-out' (%), 'packets-drop-in' (%), 'packets-drop-out' (%),
'total-interfaces'.
=back =back

View File

@ -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"'). 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} 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. Thresholds.
Can be: 'current-client-connections'.
=back =back

View File

@ -29,7 +29,6 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options); my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class; bless $self, $class;
$self->{version} = '1.0';
$self->{modes} = { $self->{modes} = {
'apm' => 'network::f5::bigip::snmp::mode::apm', 'apm' => 'network::f5::bigip::snmp::mode::apm',
'connections' => 'network::f5::bigip::snmp::mode::connections', 'connections' => 'network::f5::bigip::snmp::mode::connections',

View 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;

View 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;

View 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'

View 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;;;;

View 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

View 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:

View 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:

View 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]

View 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'

View 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

File diff suppressed because it is too large Load Diff

View 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

View 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%,

View 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

View File

@ -75,6 +75,8 @@ ESX
eth eth
Exense Exense
ext4 ext4
F5
failover
fanspeed fanspeed
FCCapacity FCCapacity
fibre fibre
@ -117,9 +119,9 @@ io-cards
iops iops
IpAddr IpAddr
ip-label ip-label
ipsec
ipv4 ipv4
ipv6 ipv6
ipsec
ISAM ISAM
Iwsva Iwsva
jmeter jmeter
@ -150,6 +152,7 @@ memBuffer
memTotalReal memTotalReal
Meraki Meraki
MIB MIB
Microkernel
module-cellradio-csq module-cellradio-csq
module-cellradio-rscp module-cellradio-rscp
module-cellradio-rsrp module-cellradio-rsrp
@ -250,6 +253,7 @@ teampass
Teldat Teldat
timeframe timeframe
TiMOS TiMOS
TMM
tmnxSasAlarmInputDescription tmnxSasAlarmInputDescription
topic-messages-inflighted topic-messages-inflighted
total-offline-prct total-offline-prct
@ -278,8 +282,8 @@ VeloCloud
VM VM
VMware VMware
VMWARE VMWARE
VPN
vpn vpn
VPN
vSAN vSAN
Vserver Vserver
vSphere vSphere