fix infoblox (#2358)
This commit is contained in:
parent
4d28aca671
commit
6c1683c977
|
@ -29,7 +29,7 @@ sub set_system {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{cb_hook2} = 'snmp_execute';
|
$self->{cb_hook2} = 'snmp_execute';
|
||||||
|
|
||||||
$self->{thresholds} = {
|
$self->{thresholds} = {
|
||||||
default => [
|
default => [
|
||||||
['unknown', 'OK'],
|
['unknown', 'OK'],
|
||||||
|
@ -39,7 +39,7 @@ sub set_system {
|
||||||
['failed', 'CRITICAL']
|
['failed', 'CRITICAL']
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
$self->{components_path} = 'network::infoblox::snmp::mode::components';
|
$self->{components_path} = 'network::infoblox::snmp::mode::components';
|
||||||
$self->{components_module} = ['service'];
|
$self->{components_module} = ['service'];
|
||||||
}
|
}
|
||||||
|
@ -76,8 +76,8 @@ Can be: 'service'.
|
||||||
|
|
||||||
=item B<--filter>
|
=item B<--filter>
|
||||||
|
|
||||||
Exclude some parts (comma seperated list)
|
Filter component instances (syntax: component,regexp_filter). Component instances are excluded if matching regexp_filter.
|
||||||
Can also exclude specific instance: --filter=service,fan1
|
E.g: --filter=service,fan1
|
||||||
|
|
||||||
=item B<--no-component>
|
=item B<--no-component>
|
||||||
|
|
||||||
|
@ -144,16 +144,22 @@ sub check {
|
||||||
next if ($oid !~ /^$mapping->{ibNodeServiceName}->{oid}\.(.*)$/);
|
next if ($oid !~ /^$mapping->{ibNodeServiceName}->{oid}\.(.*)$/);
|
||||||
my $instance = $1;
|
my $instance = $1;
|
||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_ibMemberNodeServiceStatusEntry}, instance => $instance);
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_ibMemberNodeServiceStatusEntry}, instance => $instance);
|
||||||
|
|
||||||
next if ($self->check_filter(section => 'service', instance => $result->{ibNodeServiceName}));
|
next if ($self->check_filter(section => 'service', instance => $result->{ibNodeServiceName}));
|
||||||
|
|
||||||
$self->{components}->{service}->{total}++;
|
$self->{components}->{service}->{total}++;
|
||||||
$self->{output}->output_add(long_msg => sprintf("service '%s' status is '%s' [instance = %s]",
|
$self->{output}->output_add(
|
||||||
$result->{ibNodeServiceName}, $result->{ibNodeServiceStatus}, $result->{ibNodeServiceName}));
|
long_msg => sprintf(
|
||||||
my $exit = $self->get_severity(section => 'default', instance => $result->{ibNodeServiceName}, value => $result->{ibNodeServiceStatus});
|
"service '%s' status is '%s' [instance = %s]",
|
||||||
|
$result->{ibNodeServiceName}, $result->{ibNodeServiceStatus}, $result->{ibNodeServiceName}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
my $exit = $self->get_severity(section => 'default', label => 'service', instance => $result->{ibNodeServiceName}, value => $result->{ibNodeServiceStatus});
|
||||||
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("Service '%s' status is '%s'", $result->{ibNodeServiceName}, $result->{ibNodeServiceStatus}));
|
severity => $exit,
|
||||||
|
short_msg => sprintf("Service '%s' status is '%s'", $result->{ibNodeServiceName}, $result->{ibNodeServiceStatus})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue