add audiocodes snmp plugin (WIP)
This commit is contained in:
parent
c35937390e
commit
efa61eb09b
|
@ -0,0 +1,78 @@
|
||||||
|
#
|
||||||
|
# Copyright 2017 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package network::audiocodes::snmp::mode::components::fantray;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
my %map_status = (
|
||||||
|
0 => 'cleared',
|
||||||
|
1 => 'indeterminate',
|
||||||
|
2 => 'warning',
|
||||||
|
3 => 'minor',
|
||||||
|
4 => 'major',
|
||||||
|
5 => 'critical',
|
||||||
|
);
|
||||||
|
my %map_existence = (
|
||||||
|
1 => 'present',
|
||||||
|
2 => 'missing',
|
||||||
|
);
|
||||||
|
|
||||||
|
my $mapping = {
|
||||||
|
acSysFanTrayExistence => { oid => '.1.3.6.1.4.1.5003.9.10.10.4.22.1.3', map => \%map_existence },
|
||||||
|
acSysFanTraySeverity => { oid => '.1.3.6.1.4.1.5003.9.10.10.4.22.1.6', map => \%map_status },
|
||||||
|
};
|
||||||
|
my $oid_acSysFanTrayEntry = '.1.3.6.1.4.1.5003.9.10.10.4.22.1';
|
||||||
|
|
||||||
|
sub load {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
push @{$self->{request}}, { oid => $oid_acSysFanTrayEntry };
|
||||||
|
}
|
||||||
|
|
||||||
|
sub check {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
$self->{output}->output_add(long_msg => "Checking fantray");
|
||||||
|
$self->{components}->{fantray} = {name => 'fantray', total => 0, skip => 0};
|
||||||
|
return if ($self->check_filter(section => 'fantray'));
|
||||||
|
|
||||||
|
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_acSysFanTrayEntry}})) {
|
||||||
|
next if ($oid !~ /^$mapping->{acSysFanTraySeverity}->{oid}\.(.*)$/);
|
||||||
|
my $instance = $1;
|
||||||
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_acSysFanTrayEntry}, instance => $instance);
|
||||||
|
|
||||||
|
next if ($result->{acSysFanTrayExistence} eq 'missing' &&
|
||||||
|
$self->absent_problem(section => 'fantray', instance => $instance));
|
||||||
|
next if ($self->check_filter(section => 'fantray', instance => $instance));
|
||||||
|
|
||||||
|
$self->{components}->{fantray}->{total}++;
|
||||||
|
$self->{output}->output_add(long_msg => sprintf("Fan tray '%s' status is '%s' [instance = %s]",
|
||||||
|
$instance, $result->{acSysFanTraySeverity}, $instance));
|
||||||
|
my $exit = $self->get_severity(label => 'default', section => 'fantray', value => $result->{acSysFanTraySeverity});
|
||||||
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
|
$self->{output}->output_add(severity => $exit,
|
||||||
|
short_msg => sprintf("Fan tray '%s' status is '%s'", $instance, $result->{acSysFanTraySeverity}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
|
@ -0,0 +1,79 @@
|
||||||
|
#
|
||||||
|
# Copyright 2017 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package network::audiocodes::snmp::mode::components::module;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
my %map_status = (
|
||||||
|
1 => 'moduleNotExist',
|
||||||
|
2 => 'moduleExistOk',
|
||||||
|
3 => 'moduleOutOfService',
|
||||||
|
4 => 'moduleBackToServiceStart',
|
||||||
|
5 => 'moduleMismatch',
|
||||||
|
6 => 'moduleFaulty',
|
||||||
|
7 => 'notApplicable',
|
||||||
|
);
|
||||||
|
my %map_existence = (
|
||||||
|
1 => 'present',
|
||||||
|
2 => 'missing',
|
||||||
|
);
|
||||||
|
|
||||||
|
my $mapping = {
|
||||||
|
acSysModulePresence => { oid => '.1.3.6.1.4.1.5003.9.10.10.4.21.1.4', map => \%map_existence },
|
||||||
|
acSysModuleFRUstatus => { oid => '.1.3.6.1.4.1.5003.9.10.10.4.21.1.14', map => \%map_status },
|
||||||
|
};
|
||||||
|
my $oid_acSysModuleEntry = '.1.3.6.1.4.1.5003.9.10.10.4.21.1';
|
||||||
|
|
||||||
|
sub load {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
push @{$self->{request}}, { oid => $oid_acSysModuleEntry };
|
||||||
|
}
|
||||||
|
|
||||||
|
sub check {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
$self->{output}->output_add(long_msg => "Checking modules");
|
||||||
|
$self->{components}->{module} = {name => 'modules', total => 0, skip => 0};
|
||||||
|
return if ($self->check_filter(section => 'module'));
|
||||||
|
|
||||||
|
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_acSysModuleEntry}})) {
|
||||||
|
next if ($oid !~ /^$mapping->{acSysModuleFRUstatus}->{oid}\.(.*)$/);
|
||||||
|
my $instance = $1;
|
||||||
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_acSysModuleEntry}, instance => $instance);
|
||||||
|
|
||||||
|
next if ($result->{acSysModulePresence} eq 'missing' &&
|
||||||
|
$self->absent_problem(section => 'module', instance => $instance));
|
||||||
|
next if ($self->check_filter(section => 'module', instance => $instance));
|
||||||
|
|
||||||
|
$self->{components}->{module}->{total}++;
|
||||||
|
$self->{output}->output_add(long_msg => sprintf("module '%s' status is '%s' [instance = %s]",
|
||||||
|
$instance, $result->{acSysModuleFRUstatus}, $instance));
|
||||||
|
my $exit = $self->get_severity(section => 'module', value => $result->{acSysModuleFRUstatus});
|
||||||
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
|
$self->{output}->output_add(severity => $exit,
|
||||||
|
short_msg => sprintf("Module '%s' status is '%s'", $instance, $result->{acSysModuleFRUstatus}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
|
@ -0,0 +1,78 @@
|
||||||
|
#
|
||||||
|
# Copyright 2017 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package network::audiocodes::snmp::mode::components::psu;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
my %map_status = (
|
||||||
|
1 => 'cleared',
|
||||||
|
2 => 'indeterminate',
|
||||||
|
3 => 'warning',
|
||||||
|
4 => 'minor',
|
||||||
|
5 => 'major',
|
||||||
|
6 => 'critical',
|
||||||
|
);
|
||||||
|
my %map_existence = (
|
||||||
|
1 => 'present',
|
||||||
|
2 => 'missing',
|
||||||
|
);
|
||||||
|
|
||||||
|
my $mapping = {
|
||||||
|
acSysPowerSupplyExistence => { oid => '.1.3.6.1.4.1.5003.9.10.10.4.23.1.3', map => \%map_existence },
|
||||||
|
acSysPowerSupplySeverity => { oid => '.1.3.6.1.4.1.5003.9.10.10.4.23.1.6', map => \%map_status },
|
||||||
|
};
|
||||||
|
my $oid_acSysPowerSupplyEntry = '.1.3.6.1.4.1.5003.9.10.10.4.23.1';
|
||||||
|
|
||||||
|
sub load {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
push @{$self->{request}}, { oid => $oid_acSysPowerSupplyEntry };
|
||||||
|
}
|
||||||
|
|
||||||
|
sub check {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
$self->{output}->output_add(long_msg => "Checking power supplies");
|
||||||
|
$self->{components}->{psu} = {name => 'psus', total => 0, skip => 0};
|
||||||
|
return if ($self->check_filter(section => 'psu'));
|
||||||
|
|
||||||
|
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_acSysPowerSupplyEntry}})) {
|
||||||
|
next if ($oid !~ /^$mapping->{acSysPowerSupplySeverity}->{oid}\.(.*)$/);
|
||||||
|
my $instance = $1;
|
||||||
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_acSysPowerSupplyEntry}, instance => $instance);
|
||||||
|
|
||||||
|
next if ($result->{acSysPowerSupplyExistence} eq 'missing' &&
|
||||||
|
$self->absent_problem(section => 'psu', instance => $instance));
|
||||||
|
next if ($self->check_filter(section => 'psu', instance => $instance));
|
||||||
|
|
||||||
|
$self->{components}->{psu}->{total}++;
|
||||||
|
$self->{output}->output_add(long_msg => sprintf("power supply '%s' status is '%s' [instance = %s]",
|
||||||
|
$instance, $result->{acSysPowerSupplySeverity}, $instance));
|
||||||
|
my $exit = $self->get_severity(label => 'default', section => 'psu', value => $result->{acSysPowerSupplySeverity});
|
||||||
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
|
$self->{output}->output_add(severity => $exit,
|
||||||
|
short_msg => sprintf("Power supply '%s' status is '%s'", $instance, $result->{acSysPowerSupplySeverity}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
|
@ -0,0 +1,106 @@
|
||||||
|
#
|
||||||
|
# Copyright 2017 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package network::audiocodes::snmp::mode::cpu;
|
||||||
|
|
||||||
|
use base qw(centreon::plugins::templates::counter);
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
sub set_counters {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
$self->{maps_counters_type} = [
|
||||||
|
{ name => 'global', type => 0, message_separator => ' - ' },
|
||||||
|
];
|
||||||
|
$self->{maps_counters}->{global} = [
|
||||||
|
{ label => 'voip', set => {
|
||||||
|
key_values => [ { name => 'voip' } ],
|
||||||
|
output_template => 'CPU VoIp Usage : %.2f %%',
|
||||||
|
perfdatas => [
|
||||||
|
{ label => 'cpu_voip', value => 'voip_absolute', template => '%.2f', min => 0, max => 100, unit => '%' },
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ label => 'data', set => {
|
||||||
|
key_values => [ { name => 'data' } ],
|
||||||
|
output_template => 'CPU Data Usage : %.2f %%',
|
||||||
|
perfdatas => [
|
||||||
|
{ label => 'cpu_data', value => 'data_absolute', template => '%.2f', min => 0, max => 100, unit => '%' },
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
my ($class, %options) = @_;
|
||||||
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
bless $self, $class;
|
||||||
|
|
||||||
|
$self->{version} = '1.0';
|
||||||
|
$options{options}->add_options(arguments =>
|
||||||
|
{
|
||||||
|
});
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub manage_selection {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
my $oid_acSysStateVoIpCpuUtilization = '.1.3.6.1.4.1.5003.9.10.10.2.5.10.0';
|
||||||
|
my $oid_acSysStateDataCpuUtilization = '.1.3.6.1.4.1.5003.9.10.10.2.5.8.0';
|
||||||
|
my $snmp_result = $options{snmp}->get_leef(oids => [
|
||||||
|
$oid_acSysStateVoIpCpuUtilization, $oid_acSysStateDataCpuUtilization
|
||||||
|
], nothing_quit => 1);
|
||||||
|
|
||||||
|
$self->{global} = { data => $snmp_result->{$oid_acSysStateDataCpuUtilization}, voip => $snmp_result->{$oid_acSysStateVoIpCpuUtilization} };
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 MODE
|
||||||
|
|
||||||
|
Check CPU usages.
|
||||||
|
|
||||||
|
=over 8
|
||||||
|
|
||||||
|
=item B<--filter-counters>
|
||||||
|
|
||||||
|
Only display some counters (regexp can be used).
|
||||||
|
Example: --filter-counters='^voip$'
|
||||||
|
|
||||||
|
=item B<--warning-*>
|
||||||
|
|
||||||
|
Threshold warning.
|
||||||
|
Can be: 'voip', 'data'.
|
||||||
|
|
||||||
|
=item B<--critical-*>
|
||||||
|
|
||||||
|
Threshold critical.
|
||||||
|
Can be: 'voip', 'data'.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
|
@ -0,0 +1,117 @@
|
||||||
|
#
|
||||||
|
# Copyright 2017 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package network::audiocodes::snmp::mode::hardware;
|
||||||
|
|
||||||
|
use base qw(centreon::plugins::templates::hardware);
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
sub set_system {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
$self->{regexp_threshold_overload_check_section_option} = '^(module|fantray|psu)$';
|
||||||
|
|
||||||
|
$self->{cb_hook2} = 'snmp_execute';
|
||||||
|
|
||||||
|
$self->{thresholds} = {
|
||||||
|
default => [
|
||||||
|
['cleared', 'OK'],
|
||||||
|
['indeterminate', 'UNKNOWN'],
|
||||||
|
['warning', 'WARNING'],
|
||||||
|
['minor', 'WARNING'],
|
||||||
|
['major', 'CRITICAL'],
|
||||||
|
['critical', 'CRITICAL'],
|
||||||
|
],
|
||||||
|
module => [
|
||||||
|
['moduleNotExist', 'OK'],
|
||||||
|
['moduleExistOk', 'OK'],
|
||||||
|
['moduleOutOfService', 'CRITICAL'],
|
||||||
|
['moduleBackToServiceStart', 'WARNING'],
|
||||||
|
['moduleMismatch', 'WARNING'],
|
||||||
|
['moduleFaulty', 'CRITICAL'],
|
||||||
|
['notApplicable', 'OK'],
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
$self->{components_path} = 'network::audiocodes::snmp::mode::components';
|
||||||
|
$self->{components_module} = ['module', 'fantray', 'psu'];
|
||||||
|
}
|
||||||
|
|
||||||
|
sub snmp_execute {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
$self->{snmp} = $options{snmp};
|
||||||
|
$self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request});
|
||||||
|
}
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
my ($class, %options) = @_;
|
||||||
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1);
|
||||||
|
bless $self, $class;
|
||||||
|
|
||||||
|
$self->{version} = '1.0';
|
||||||
|
$options{options}->add_options(arguments =>
|
||||||
|
{
|
||||||
|
});
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 MODE
|
||||||
|
|
||||||
|
Check Hardware.
|
||||||
|
|
||||||
|
=over 8
|
||||||
|
|
||||||
|
=item B<--component>
|
||||||
|
|
||||||
|
Which component to check (Default: '.*').
|
||||||
|
Can be: 'fantray', 'module', 'psu'.
|
||||||
|
|
||||||
|
=item B<--filter>
|
||||||
|
|
||||||
|
Exclude some parts (comma seperated list) (Example: --filter=fan --filter=psu)
|
||||||
|
Can also exclude specific instance: --filter=fantray,1
|
||||||
|
|
||||||
|
=item B<--absent-problem>
|
||||||
|
|
||||||
|
Return an error if an entity is not 'present' (default is skipping) (comma seperated list)
|
||||||
|
Can be specific or global: --absent-problem=psu,1
|
||||||
|
|
||||||
|
=item B<--no-component>
|
||||||
|
|
||||||
|
Return an error if no compenents are checked.
|
||||||
|
If total (with skipped) is 0. (Default: 'critical' returns).
|
||||||
|
|
||||||
|
=item B<--threshold-overload>
|
||||||
|
|
||||||
|
Set to overload default threshold values (syntax: section,[instance,]status,regexp)
|
||||||
|
It used before default thresholds (order stays).
|
||||||
|
Example: --threshold-overload='psu,CRITICAL,^(?!(cleared)$)'
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
|
@ -0,0 +1,106 @@
|
||||||
|
#
|
||||||
|
# Copyright 2017 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package network::audiocodes::snmp::mode::memory;
|
||||||
|
|
||||||
|
use base qw(centreon::plugins::templates::counter);
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
sub set_counters {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
$self->{maps_counters_type} = [
|
||||||
|
{ name => 'global', type => 0, message_separator => ' - ' },
|
||||||
|
];
|
||||||
|
$self->{maps_counters}->{global} = [
|
||||||
|
{ label => 'voip', set => {
|
||||||
|
key_values => [ { name => 'voip' } ],
|
||||||
|
output_template => 'Memory VoIp Usage : %.2f %%',
|
||||||
|
perfdatas => [
|
||||||
|
{ label => 'used_voip', value => 'voip_absolute', template => '%.2f', min => 0, max => 100, unit => '%' },
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ label => 'data', set => {
|
||||||
|
key_values => [ { name => 'data' } ],
|
||||||
|
output_template => 'Memory Data Usage : %.2f %%',
|
||||||
|
perfdatas => [
|
||||||
|
{ label => 'used_data', value => 'data_absolute', template => '%.2f', min => 0, max => 100, unit => '%' },
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
my ($class, %options) = @_;
|
||||||
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
bless $self, $class;
|
||||||
|
|
||||||
|
$self->{version} = '1.0';
|
||||||
|
$options{options}->add_options(arguments =>
|
||||||
|
{
|
||||||
|
});
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub manage_selection {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
my $oid_acSysStateVoIpMemoryUtilization = '.1.3.6.1.4.1.5003.9.10.10.2.5.11.0';
|
||||||
|
my $oid_acSysStateDataMemoryUtilization = '.1.3.6.1.4.1.5003.9.10.10.2.5.9.0';
|
||||||
|
my $snmp_result = $options{snmp}->get_leef(oids => [
|
||||||
|
$oid_acSysStateVoIpMemoryUtilization, $oid_acSysStateDataMemoryUtilization
|
||||||
|
], nothing_quit => 1);
|
||||||
|
|
||||||
|
$self->{global} = { data => $snmp_result->{$oid_acSysStateDataMemoryUtilization}, voip => $snmp_result->{$oid_acSysStateVoIpMemoryUtilization} };
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 MODE
|
||||||
|
|
||||||
|
Check memory usages.
|
||||||
|
|
||||||
|
=over 8
|
||||||
|
|
||||||
|
=item B<--filter-counters>
|
||||||
|
|
||||||
|
Only display some counters (regexp can be used).
|
||||||
|
Example: --filter-counters='^voip$'
|
||||||
|
|
||||||
|
=item B<--warning-*>
|
||||||
|
|
||||||
|
Threshold warning.
|
||||||
|
Can be: 'voip', 'data'.
|
||||||
|
|
||||||
|
=item B<--critical-*>
|
||||||
|
|
||||||
|
Threshold critical.
|
||||||
|
Can be: 'voip', 'data'.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=cut
|
|
@ -0,0 +1,52 @@
|
||||||
|
#
|
||||||
|
# Copyright 2017 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package network::audiocodes::snmp::plugin;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use base qw(centreon::plugins::script_snmp);
|
||||||
|
|
||||||
|
sub new {
|
||||||
|
my ($class, %options) = @_;
|
||||||
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
bless $self, $class;
|
||||||
|
|
||||||
|
$self->{version} = '1.0';
|
||||||
|
%{$self->{modes}} = (
|
||||||
|
'cpu' => 'network::audiocodes::snmp::mode::cpu',
|
||||||
|
'hardware' => 'network::audiocodes::snmp::mode::hardware',
|
||||||
|
'interfaces' => 'snmp_standard::mode::interfaces',
|
||||||
|
'list-interfaces' => 'snmp_standard::mode::listinterfaces',
|
||||||
|
'memory' => 'network::audiocodes::snmp::mode::memory',
|
||||||
|
);
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 PLUGIN DESCRIPTION
|
||||||
|
|
||||||
|
Check Audiocodes equipments (Mediant) in SNMP.
|
||||||
|
|
||||||
|
=cut
|
Loading…
Reference in New Issue