mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-25 22:55:15 +02:00
Ref #1403
This commit is contained in:
parent
9ca49d3c81
commit
9de7e3c3c3
@ -67,11 +67,12 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '1.0';
|
$self->{version} = '1.0';
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
'filter-name:s' => { name => 'filter_name' },
|
||||||
"filter-name:s" => { name => 'filter_name' },
|
'warning-status:s' => { name => 'warning_status', default => '' },
|
||||||
"warning-status:s" => { name => 'warning_status', default => '' },
|
'critical-status:s' => { name => 'critical_status', default => '%{type} eq "permanent" and %{status} =~ /down/i' },
|
||||||
"critical-status:s" => { name => 'critical_status', default => '%{type} eq "permanent" and %{status} =~ /down/i' },
|
'filter-name:s' => { name => 'filter_name' },
|
||||||
|
'buggy-snmp' => { name => 'buggy_snmp' },
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
@ -100,16 +101,22 @@ my $mapping = {
|
|||||||
tunnelState => { oid => '.1.3.6.1.4.1.2620.500.9002.1.3', map => \%map_state },
|
tunnelState => { oid => '.1.3.6.1.4.1.2620.500.9002.1.3', map => \%map_state },
|
||||||
tunnelType => { oid => '.1.3.6.1.4.1.2620.500.9002.1.11', map => \%map_type },
|
tunnelType => { oid => '.1.3.6.1.4.1.2620.500.9002.1.11', map => \%map_type },
|
||||||
};
|
};
|
||||||
|
my $oid_tunnelEntry = '.1.3.6.1.4.1.2620.500.9002.1';
|
||||||
|
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{vs} = {};
|
$self->{vs} = {};
|
||||||
my $snmp_result = $options{snmp}->get_multiple_table(oids => [
|
my $snmp_result;
|
||||||
|
if (defined($self->{option_results}->{buggy_snmp})) {
|
||||||
|
$snmp_result = $options{snmp}->get_table(oid => $oid_tunnelEntry, nothing_quit => 1);
|
||||||
|
} else {
|
||||||
|
$snmp_result = $options{snmp}->get_multiple_table(oids => [
|
||||||
{ oid => $mapping->{tunnelPeerObjName}->{oid} },
|
{ oid => $mapping->{tunnelPeerObjName}->{oid} },
|
||||||
{ oid => $mapping->{tunnelState}->{oid} },
|
{ oid => $mapping->{tunnelState}->{oid} },
|
||||||
{ oid => $mapping->{tunnelType}->{oid} },
|
{ oid => $mapping->{tunnelType}->{oid} },
|
||||||
], nothing_quit => 1, return_type => 1);
|
], nothing_quit => 1, return_type => 1);
|
||||||
|
}
|
||||||
|
|
||||||
foreach my $oid (keys %{$snmp_result}) {
|
foreach my $oid (keys %{$snmp_result}) {
|
||||||
next if ($oid !~ /^$mapping->{tunnelState}->{oid}\.(.*)$/);
|
next if ($oid !~ /^$mapping->{tunnelState}->{oid}\.(.*)$/);
|
||||||
@ -122,9 +129,11 @@ sub manage_selection {
|
|||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{vpn}->{$instance} = { display => $result->{tunnelPeerObjName},
|
$self->{vpn}->{$instance} = {
|
||||||
|
display => $result->{tunnelPeerObjName},
|
||||||
status => $result->{tunnelState},
|
status => $result->{tunnelState},
|
||||||
type => $result->{tunnelType} };
|
type => $result->{tunnelType}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scalar(keys %{$self->{vpn}}) <= 0) {
|
if (scalar(keys %{$self->{vpn}}) <= 0) {
|
||||||
@ -157,6 +166,10 @@ Can used special variables like: %{type}, %{status}, %{display}
|
|||||||
Set critical threshold for status (Default: '%{type} eq "permanent" and %{status} =~ /down/i').
|
Set critical threshold for status (Default: '%{type} eq "permanent" and %{status} =~ /down/i').
|
||||||
Can used special variables like: %{type}, %{status}, %{display}
|
Can used special variables like: %{type}, %{status}, %{display}
|
||||||
|
|
||||||
|
=item B<--buggy-snmp>
|
||||||
|
|
||||||
|
Checkpoint snmp can be buggy. Test that option if no response.
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
Loading…
x
Reference in New Issue
Block a user