mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 07:34:35 +02:00
+ Enhance mode for alcatel pss
This commit is contained in:
parent
1070671850
commit
f965be0c66
@ -64,10 +64,11 @@ sub set_counters {
|
|||||||
},
|
},
|
||||||
{ label => 'in-drop-packets', set => {
|
{ label => 'in-drop-packets', set => {
|
||||||
key_values => [ { name => 'in_dropped_packets', diff => 1 }, { name => 'display' } ],
|
key_values => [ { name => 'in_dropped_packets', diff => 1 }, { name => 'display' } ],
|
||||||
|
closure_custom_calc => $self->can('custom_qos_drop_calc'),
|
||||||
output_template => 'In Dropped Packets : %s',
|
output_template => 'In Dropped Packets : %s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'in_drop_packets', value => 'in_dropped_packets_absolute', template => '%s',
|
{ label => 'in_drop_packets', value => 'in_dropped_packets', template => '%s',
|
||||||
min => 0, label_extra_instance => 1, instance_use => 'display_absolute' },
|
min => 0, label_extra_instance => 1, instance_use => 'display' },
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -94,7 +95,7 @@ sub custom_status_threshold {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$instance_mode->{last_status} = 0;
|
$instance_mode->{last_status} = 0;
|
||||||
if ($self->{result_values}->{status} ne 'up') {
|
if ($self->{result_values}->{admin} eq 'up') {
|
||||||
$instance_mode->{last_status} = 1;
|
$instance_mode->{last_status} = 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -176,6 +177,7 @@ sub custom_qos_output {
|
|||||||
sub custom_qos_calc {
|
sub custom_qos_calc {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
return -10 if (defined($instance_mode->{last_status}) && $instance_mode->{last_status} == 0);
|
||||||
$self->{result_values}->{label} = $options{extra_options}->{label_ref};
|
$self->{result_values}->{label} = $options{extra_options}->{label_ref};
|
||||||
$self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'};
|
$self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'};
|
||||||
$self->{result_values}->{traffic} = ($options{new_datas}->{$self->{instance} . '_' . $self->{result_values}->{label}} - $options{old_datas}->{$self->{instance} . '_' . $self->{result_values}->{label}}) / $options{delta_time};
|
$self->{result_values}->{traffic} = ($options{new_datas}->{$self->{instance} . '_' . $self->{result_values}->{label}} - $options{old_datas}->{$self->{instance} . '_' . $self->{result_values}->{label}}) / $options{delta_time};
|
||||||
@ -186,6 +188,15 @@ sub custom_qos_calc {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub custom_qos_drop_calc {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
return -10 if (defined($instance_mode->{last_status}) && $instance_mode->{last_status} == 0);
|
||||||
|
$self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'};
|
||||||
|
$self->{result_values}->{in_dropped_packets} = $options{new_datas}->{$self->{instance} . '_in_dropped_packets'} - $options{old_datas}->{$self->{instance} . '_in_dropped_packets'};
|
||||||
|
return 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);
|
||||||
@ -250,7 +261,7 @@ my $mapping = {
|
|||||||
tnSapBaseStatsIngressForwardedOctets => { oid => '.1.3.6.1.4.1.7483.7.2.2.2.8.1.1.1.4' },
|
tnSapBaseStatsIngressForwardedOctets => { oid => '.1.3.6.1.4.1.7483.7.2.2.2.8.1.1.1.4' },
|
||||||
tnSapBaseStatsEgressForwardedOctets => { oid => '.1.3.6.1.4.1.7483.7.2.2.2.8.1.1.1.6' },
|
tnSapBaseStatsEgressForwardedOctets => { oid => '.1.3.6.1.4.1.7483.7.2.2.2.8.1.1.1.6' },
|
||||||
tnSapBaseStatsIngressDroppedPackets => { oid => '.1.3.6.1.4.1.7483.7.2.2.2.8.1.1.1.9' },
|
tnSapBaseStatsIngressDroppedPackets => { oid => '.1.3.6.1.4.1.7483.7.2.2.2.8.1.1.1.9' },
|
||||||
);
|
};
|
||||||
|
|
||||||
my $oid_tnSapDescription = '.1.3.6.1.4.1.7483.6.1.2.4.3.2.1.5';
|
my $oid_tnSapDescription = '.1.3.6.1.4.1.7483.6.1.2.4.3.2.1.5';
|
||||||
my $oid_tnSvcName = '.1.3.6.1.4.1.7483.6.1.2.4.2.2.1.28';
|
my $oid_tnSvcName = '.1.3.6.1.4.1.7483.6.1.2.4.2.2.1.28';
|
||||||
@ -290,8 +301,8 @@ sub manage_selection {
|
|||||||
$self->{sap}->{$instance} = { display => $name };
|
$self->{sap}->{$instance} = { display => $name };
|
||||||
}
|
}
|
||||||
|
|
||||||
$options{snmp}->load(oids => [$oid_tnSapBaseStatsIngressForwardedOctets,
|
$options{snmp}->load(oids => [$mapping->{oid_tnSapBaseStatsIngressForwardedOctets}->{oid},
|
||||||
$oid_tnSapBaseStatsEgressForwardedOctets, $oid_tnSapBaseStatsIngressDroppedPackets,
|
$mapping->{tnSapBaseStatsEgressForwardedOctets}->{oid}, $mapping->{tnSapBaseStatsIngressDroppedPackets}->{oid},
|
||||||
$mapping->{tnSapAdminStatus}->{oid}, $mapping->{tnSapOperStatus}->{oid}],
|
$mapping->{tnSapAdminStatus}->{oid}, $mapping->{tnSapOperStatus}->{oid}],
|
||||||
instances => [keys %{$self->{sap}}], instance_regexp => '(\d+\.\d+\.\d+\.\d+)$');
|
instances => [keys %{$self->{sap}}], instance_regexp => '(\d+\.\d+\.\d+\.\d+)$');
|
||||||
$snmp_result = $options{snmp}->get_leef(nothing_quit => 1);
|
$snmp_result = $options{snmp}->get_leef(nothing_quit => 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user