enhance paloalto sessions
This commit is contained in:
parent
ac9eec384b
commit
78b94f42b9
|
@ -25,6 +25,44 @@ use base qw(centreon::plugins::templates::counter);
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
|
sub custom_vsys_active_perfdata {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
$self->{output}->perfdata_add(
|
||||||
|
label => $self->{label},
|
||||||
|
nlabel => $self->{nlabel},
|
||||||
|
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display_absolute} : undef,
|
||||||
|
value => $self->{result_values}->{sessions_active_absolute},
|
||||||
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}),
|
||||||
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}),
|
||||||
|
min => 0,
|
||||||
|
max => $self->{result_values}->{sessions_max_absolute} != 0 ? $self->{result_values}->{sessions_max_absolute} : undef
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub custom_active_perfdata {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
$self->{output}->perfdata_add(
|
||||||
|
label => $self->{label},
|
||||||
|
nlabel => $self->{nlabel},
|
||||||
|
value => $self->{result_values}->{sessions_active_absolute},
|
||||||
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}),
|
||||||
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}),
|
||||||
|
min => 0,
|
||||||
|
max => $self->{result_values}->{sessions_max_absolute} != 0 ? $self->{result_values}->{sessions_max_absolute} : undef
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub custom_active_output {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
return sprintf('active: %s (%s)',
|
||||||
|
$self->{result_values}->{sessions_active_absolute},
|
||||||
|
$self->{result_values}->{sessions_max_absolute} != 0 ? $self->{result_values}->{sessions_max_absolute} : '-'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
sub set_counters {
|
sub set_counters {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
@ -33,76 +71,79 @@ sub set_counters {
|
||||||
{ name => 'vsys', type => 1, cb_prefix_output => 'prefix_vsys_output', message_multiple => 'Vsys sessions metrics are OK', skipped_code => { -10 => 1 } },
|
{ name => 'vsys', type => 1, cb_prefix_output => 'prefix_vsys_output', message_multiple => 'Vsys sessions metrics are OK', skipped_code => { -10 => 1 } },
|
||||||
];
|
];
|
||||||
$self->{maps_counters}->{global} = [
|
$self->{maps_counters}->{global} = [
|
||||||
{ label => 'active', set => {
|
{ label => 'active', nlabel => 'sessions.active.count', set => {
|
||||||
key_values => [ { name => 'panSessionActive' }, { name => 'panSessionMax' } ],
|
key_values => [ { name => 'sessions_active' }, { name => 'sessions_max' } ],
|
||||||
closure_custom_calc => $self->can('custom_active_calc'),
|
|
||||||
closure_custom_output => $self->can('custom_active_output'),
|
closure_custom_output => $self->can('custom_active_output'),
|
||||||
closure_custom_perfdata => $self->can('custom_active_perfdata'),
|
closure_custom_perfdata => $self->can('custom_active_perfdata')
|
||||||
closure_custom_threshold_check => $self->can('custom_active_threshold'),
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'active-ssl-proxy', nlabel => 'sessions.active.vpnssl.count', set => {
|
{ label => 'active-prct', nlabel => 'sessions.active.percentage', display_ok => 0, set => {
|
||||||
key_values => [ { name => 'panSessionSslProxyUtilization' } ],
|
key_values => [ { name => 'sessions_active_prct' } ],
|
||||||
output_template => 'Active SSL Proxy : %.2f %%',
|
output_template => 'active: %.2f %%',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'active_ssl_proxy', value => 'panSessionSslProxyUtilization_absolute', template => '%.2f', unit => '%',
|
{ label => 'active_prct', value => 'sessions_active_prct_absolute', template => '%.2f', unit => '%',
|
||||||
min => 0, max => 100 },
|
min => 0, max => 100 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'active-tcp', nlabel => 'sessions.active.tcp.count', set => {
|
{ label => 'active-tcp', nlabel => 'sessions.active.tcp.count', set => {
|
||||||
key_values => [ { name => 'panSessionActiveTcp' } ],
|
key_values => [ { name => 'panSessionActiveTcp' } ],
|
||||||
output_template => 'Active TCP : %s',
|
output_template => 'active TCP: %s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'active_tcp', value => 'panSessionActiveTcp_absolute', template => '%s', min => 0 },
|
{ label => 'active_tcp', value => 'panSessionActiveTcp_absolute', template => '%s', min => 0 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'active-udp', nlabel => 'sessions.active.udp.count', set => {
|
{ label => 'active-udp', nlabel => 'sessions.active.udp.count', set => {
|
||||||
key_values => [ { name => 'panSessionActiveUdp' } ],
|
key_values => [ { name => 'panSessionActiveUdp' } ],
|
||||||
output_template => 'Active UDP : %s',
|
output_template => 'active UDP: %s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'active_udp', value => 'panSessionActiveUdp_absolute', template => '%s', min => 0 },
|
{ label => 'active_udp', value => 'panSessionActiveUdp_absolute', template => '%s', min => 0 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'active-icmp', nlabel => 'sessions.active.icmp.count', set => {
|
{ label => 'active-icmp', nlabel => 'sessions.active.icmp.count', set => {
|
||||||
key_values => [ { name => 'panSessionActiveICMP' } ],
|
key_values => [ { name => 'panSessionActiveICMP' } ],
|
||||||
output_template => 'Active ICMP : %s',
|
output_template => 'active ICMP: %s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'active_icmp', value => 'panSessionActiveICMP_absolute', template => '%s', min => 0 },
|
{ label => 'active_icmp', value => 'panSessionActiveICMP_absolute', template => '%s', min => 0 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{vsys} = [
|
$self->{maps_counters}->{vsys} = [
|
||||||
{ label => 'active-vsys', set => {
|
{ label => 'vsys-active', nlabel => 'vsys.sessions.active.count', set => {
|
||||||
key_values => [ { name => 'panVsysActiveSessions' }, { name => 'panVsysMaxSessions' }, { name => 'display' } ],
|
key_values => [ { name => 'sessions_active' }, { name => 'sessions_max' }, { name => 'display' } ],
|
||||||
closure_custom_calc => $self->can('custom_active_calc'),
|
|
||||||
closure_custom_output => $self->can('custom_active_output'),
|
closure_custom_output => $self->can('custom_active_output'),
|
||||||
closure_custom_perfdata => $self->can('custom_active_perfdata'),
|
closure_custom_perfdata => $self->can('custom_vsys_active_perfdata')
|
||||||
closure_custom_threshold_check => $self->can('custom_active_threshold'),
|
}
|
||||||
|
},
|
||||||
|
{ label => 'vsys-active-prct', nlabel => 'vsys.sessions.active.percentage', display_ok => 0, set => {
|
||||||
|
key_values => [ { name => 'sessions_active_prct' } ],
|
||||||
|
output_template => 'active: %.2f %%',
|
||||||
|
perfdatas => [
|
||||||
|
{ label => 'active_prct', value => 'sessions_active_prct_absolute', template => '%.2f', unit => '%',
|
||||||
|
min => 0, max => 100 }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'vsys-active-tcp', nlabel => 'vsys.sessions.active.tcp.count', set => {
|
{ label => 'vsys-active-tcp', nlabel => 'vsys.sessions.active.tcp.count', set => {
|
||||||
key_values => [ { name => 'panVsysActiveTcpCps' }, { name => 'display' } ],
|
key_values => [ { name => 'panVsysActiveTcpCps' }, { name => 'display' } ],
|
||||||
output_template => 'Active TCP : %s',
|
output_template => 'active TCP: %s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'active_tcp', value => 'panVsysActiveTcpCps_absolute', template => '%s',
|
{ label => 'active_tcp', value => 'panVsysActiveTcpCps_absolute', template => '%s',
|
||||||
label_extra_instance => 1, instance_use => 'display_absolute', min => 0 },
|
label_extra_instance => 1, min => 0 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'vsys-active-udp', nlabel => 'vsys.sessions.active.udp.count', set => {
|
{ label => 'vsys-active-udp', nlabel => 'vsys.sessions.active.udp.count', set => {
|
||||||
key_values => [ { name => 'panVsysActiveUdpCps' }, { name => 'display' } ],
|
key_values => [ { name => 'panVsysActiveUdpCps' }, { name => 'display' } ],
|
||||||
output_template => 'Active UDP : %s',
|
output_template => 'active UDP: %s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'active_udp', value => 'panVsysActiveUdpCps_absolute', template => '%s',
|
{ label => 'active_udp', value => 'panVsysActiveUdpCps_absolute', template => '%s',
|
||||||
label_extra_instance => 1, instance_use => 'display_absolute', min => 0 },
|
label_extra_instance => 1, min => 0 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'vsys-active-other', nlabel => 'vsys.sessions.active.other.count', set => {
|
{ label => 'vsys-active-other', nlabel => 'vsys.sessions.active.other.count', set => {
|
||||||
|
@ -110,14 +151,11 @@ sub set_counters {
|
||||||
output_template => 'Other : %s',
|
output_template => 'Other : %s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'active_other', value => 'panVsysActiveOtherIpCps_absolute', template => '%s',
|
{ label => 'active_other', value => 'panVsysActiveOtherIpCps_absolute', template => '%s',
|
||||||
label_extra_instance => 1, instance_use => 'display_absolute', min => 0 },
|
label_extra_instance => 1, min => 0 }
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub prefix_global_output {
|
sub prefix_global_output {
|
||||||
|
@ -129,102 +167,7 @@ sub prefix_global_output {
|
||||||
sub prefix_vsys_output {
|
sub prefix_vsys_output {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
return "Vsys '" . $options{instance_value}->{display} . "' ";
|
return "Vsys '" . $options{instance_value}->{display} . "' sessions ";
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
sub custom_active_perfdata {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
|
|
||||||
my %total_options = ();
|
|
||||||
|
|
||||||
if ($self->{label} eq 'active') {
|
|
||||||
if ($self->{result_values}->{panSessionMax} != 0) {
|
|
||||||
$total_options{total} = $self->{result_values}->{panSessionMax};
|
|
||||||
$total_options{cast_int} = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->{output}->perfdata_add(label => $self->{label},
|
|
||||||
nlabel => 'sessions.active.count',
|
|
||||||
value => $self->{result_values}->{panSessionActive},
|
|
||||||
warning => defined($total_options{total}) ? $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, %total_options) : undef,
|
|
||||||
critical => defined($total_options{total}) ? $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, %total_options) : undef,
|
|
||||||
min => 0, max => $self->{result_values}->{panSessionMax});
|
|
||||||
} else {
|
|
||||||
if ($self->{result_values}->{panVsysMaxSessions} != 0) {
|
|
||||||
$total_options{total} = $self->{result_values}->{panVsysMaxSessions};
|
|
||||||
$total_options{cast_int} = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->{output}->perfdata_add(label => $self->{label},
|
|
||||||
nlabel => $self->{result_values}->{display} . "#" . 'sessions.active.count',
|
|
||||||
value => $self->{result_values}->{panVsysActiveSessions},
|
|
||||||
warning => defined($total_options{total}) ? $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, %total_options) : undef,
|
|
||||||
critical => defined($total_options{total}) ? $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, %total_options) : undef,
|
|
||||||
min => 0, max => $self->{result_values}->{panVsysMaxSessions});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub custom_active_threshold {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
|
|
||||||
my ($exit, $threshold_value) = ('ok');
|
|
||||||
|
|
||||||
if ($self->{label} eq 'active') {
|
|
||||||
if ($self->{result_values}->{panSessionMax} != 0) {
|
|
||||||
$threshold_value = $self->{result_values}->{active_prct};
|
|
||||||
}
|
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold =>
|
|
||||||
[ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]) if (defined($threshold_value));
|
|
||||||
return $exit;
|
|
||||||
} else {
|
|
||||||
if ($self->{result_values}->{panVsysMaxSessions} != 0) {
|
|
||||||
$threshold_value = $self->{result_values}->{active_prct};
|
|
||||||
}
|
|
||||||
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold =>
|
|
||||||
[ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]) if (defined($threshold_value));
|
|
||||||
return $exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub custom_active_output {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
|
|
||||||
my $msg = "";
|
|
||||||
if ($self->{label} eq 'active') {
|
|
||||||
$msg = sprintf("Active : %s (%s)",
|
|
||||||
$self->{result_values}->{panSessionActive},
|
|
||||||
$self->{result_values}->{panSessionMax} != 0 ? $self->{result_values}->{active_prct} . " %" :
|
|
||||||
'-');
|
|
||||||
} else {
|
|
||||||
$msg = sprintf("Active : %s (%s)",
|
|
||||||
$self->{result_values}->{panVsysActiveSessions},
|
|
||||||
$self->{result_values}->{panVsysMaxSessions} != 0 ? $self->{result_values}->{active_prct} . " %" :
|
|
||||||
'-');
|
|
||||||
}
|
|
||||||
return $msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub custom_active_calc {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
|
|
||||||
$self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'};
|
|
||||||
$self->{result_values}->{panSessionActive} = $options{new_datas}->{$self->{instance} . '_panSessionActive'};
|
|
||||||
$self->{result_values}->{panSessionMax} = $options{new_datas}->{$self->{instance} . '_panSessionMax'};
|
|
||||||
$self->{result_values}->{panVsysActiveSessions} = $options{new_datas}->{$self->{instance} . '_panVsysActiveSessions'};
|
|
||||||
$self->{result_values}->{panVsysMaxSessions} = $options{new_datas}->{$self->{instance} . '_panVsysMaxSessions'};
|
|
||||||
$self->{result_values}->{active_prct} = 0;
|
|
||||||
|
|
||||||
if ($self->{label} eq 'active') {
|
|
||||||
if ($self->{result_values}->{panSessionMax} != 0) {
|
|
||||||
$self->{result_values}->{active_prct} = $self->{result_values}->{panSessionActive} * 100 / $self->{result_values}->{panSessionMax};
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($self->{result_values}->{panVsysMaxSessions} != 0) {
|
|
||||||
$self->{result_values}->{active_prct} = $self->{result_values}->{panVsysActiveSessions} * 100 / $self->{result_values}->{panVsysMaxSessions};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
|
@ -233,7 +176,7 @@ sub new {
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$options{options}->add_options(arguments => {
|
$options{options}->add_options(arguments => {
|
||||||
'add-vsys' => { name => 'add_vsys' },
|
'add-vsys' => { name => 'add_vsys' },
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
|
@ -241,56 +184,54 @@ sub new {
|
||||||
|
|
||||||
|
|
||||||
my $mapping_sessions = {
|
my $mapping_sessions = {
|
||||||
panSessionMax => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.2' },
|
sessions_max => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.2' }, # panSessionMax
|
||||||
panSessionActive => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.3' },
|
sessions_active => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.3' }, # panSessionActive
|
||||||
panSessionActiveTcp => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.4' },
|
panSessionActiveTcp => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.4' },
|
||||||
panSessionActiveUdp => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.5' },
|
panSessionActiveUdp => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.5' },
|
||||||
panSessionActiveICMP => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.6' },
|
panSessionActiveICMP => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.6' },
|
||||||
#panSessionActiveSslProxy => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.7' }, Cannot get the max if 0...
|
panSessionSslProxyUtilization => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.8' }
|
||||||
panSessionSslProxyUtilization => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.8' },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
my $mapping_vsys = {
|
my $mapping_vsys = {
|
||||||
panVsysName => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.9.1.2' },
|
display => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.9.1.2' }, # panVsysName
|
||||||
panVsysActiveSessions => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.9.1.4' },
|
sessions_active => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.9.1.4' }, # panVsysActiveSessions
|
||||||
panVsysMaxSessions => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.9.1.5' },
|
sessions_max => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.9.1.5' }, # panVsysMaxSessions
|
||||||
panVsysActiveTcpCps => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.9.1.6' },
|
panVsysActiveTcpCps => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.9.1.6' },
|
||||||
panVsysActiveUdpCps => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.9.1.7' },
|
panVsysActiveUdpCps => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.9.1.7' },
|
||||||
panVsysActiveOtherIpCps => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.9.1.8' },
|
panVsysActiveOtherIpCps => { oid => '.1.3.6.1.4.1.25461.2.1.2.3.9.1.8' }
|
||||||
};
|
};
|
||||||
|
|
||||||
sub add_vsys {
|
sub add_vsys {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $oid_panVsysEntry = '.1.3.6.1.4.1.25461.2.1.2.3.9.1';
|
my $oid_panVsysEntry = '.1.3.6.1.4.1.25461.2.1.2.3.9.1';
|
||||||
$self->{results} = $options{snmp}->get_table(oid => $oid_panVsysEntry,
|
my $snmp_result = $options{snmp}->get_table(
|
||||||
nothing_quit => 1);
|
oid => $oid_panVsysEntry,
|
||||||
|
nothing_quit => 1
|
||||||
|
);
|
||||||
|
|
||||||
foreach my $oid (keys %{$self->{results}}) {
|
foreach my $oid (keys %$snmp_result) {
|
||||||
next if $oid !~ /^$mapping_vsys->{panVsysName}->{oid}\.(.*)$/;
|
next if $oid !~ /^$mapping_vsys->{panVsysName}->{oid}\.(.*)$/;
|
||||||
my $instance = $1;
|
my $instance = $1;
|
||||||
|
|
||||||
my $result = $options{snmp}->map_instance(mapping => $mapping_vsys, results => $self->{results}, instance => $instance);
|
my $result = $options{snmp}->map_instance(mapping => $mapping_vsys, results => $snmp_result, instance => $instance);
|
||||||
|
$self->{vsys}->{$result->{display}} = $result;
|
||||||
$self->{vsys}->{$result->{panVsysName}} = {
|
$self->{vsys}->{$result->{display}}->{sessions_max} = 0 if (!defined($result->{sessions_max}));
|
||||||
display => $result->{panVsysName},
|
$self->{vsys}->{$result->{display}}->{sessions_active_prct} = $result->{sessions_active} * 100 / $self->{vsys}->{$result->{display}}->{sessions_max}
|
||||||
panVsysMaxSessions => defined($result->{panVsysMaxSessions}) ? $result->{panVsysMaxSessions} : 0,
|
if ($self->{vsys}->{$result->{display}}->{sessions_max} != 0);
|
||||||
panVsysActiveSessions => $result->{panVsysActiveSessions},
|
|
||||||
panVsysActiveTcpCps => $result->{panVsysActiveTcpCps},
|
|
||||||
panVsysActiveUdpCps => $result->{panVsysActiveUdpCps},
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $oid_panSession = '.1.3.6.1.4.1.25461.2.1.2.3';
|
my $snmp_result = $options{snmp}->get_leef(
|
||||||
$self->{results} = $options{snmp}->get_table(oid => $oid_panSession,
|
oids => [ map($_->{oid} . '.0', values(%$mapping_sessions)) ],
|
||||||
nothing_quit => 1);
|
nothing_quit => 1
|
||||||
$self->{global} = $options{snmp}->map_instance(mapping => $mapping_sessions, results => $self->{results}, instance => '0');
|
);
|
||||||
$self->{global}->{panSessionMax} = 0 if (!defined($self->{global}->{panSessionMax}));
|
$self->{global} = $options{snmp}->map_instance(mapping => $mapping_sessions, results => $snmp_result, instance => '0');
|
||||||
|
$self->{global}->{sessions_max} = 0 if (!defined($self->{global}->{sessions_max}));
|
||||||
|
$self->{global}->{sessions_active_prct} = $self->{global}->{sessions_active} * 100 / $self->{global}->{sessions_max}
|
||||||
|
if ($self->{global}->{sessions_max} != 0);
|
||||||
|
|
||||||
$self->add_vsys(snmp => $options{snmp})
|
$self->add_vsys(snmp => $options{snmp})
|
||||||
if (defined($self->{option_results}->{add_vsys}));
|
if (defined($self->{option_results}->{add_vsys}));
|
||||||
|
@ -306,17 +247,11 @@ Check sessions.
|
||||||
|
|
||||||
=over 8
|
=over 8
|
||||||
|
|
||||||
=item B<--warning-*>
|
=item B<--warning-*> B<--critical-*>
|
||||||
|
|
||||||
Threshold warning.
|
Thresholds.
|
||||||
Global: 'active' (%), 'active-tcp', 'active-udp', 'active-icmp', 'active-ssl-proxy' (%).
|
Global: 'active', 'active-prct', (%), 'active-tcp', 'active-udp', 'active-icmp',
|
||||||
Per vsys: 'active-vsys' (%), 'vsys-active-tcp' 'vsys-active-udp' 'vsys-active-other'
|
Per vsys: 'vsys-active', 'vsys-active-prct' (%), 'vsys-active-tcp' 'vsys-active-udp' 'vsys-active-other'.
|
||||||
|
|
||||||
=item B<--critical-*>
|
|
||||||
|
|
||||||
Threshold critical.
|
|
||||||
Global: 'active' (%), 'active-tcp', 'active-udp', 'active-icmp', 'active-ssl-proxy' (%).
|
|
||||||
Per vsys: 'active-vsys' (%), 'vsys-active-tcp' 'vsys-active-udp' 'vsys-active-other'
|
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue