add mitel 3300 icp plugin (#1146)
* add mitel 3300 icp plugin * move to network tree
This commit is contained in:
parent
09ef462605
commit
510cb88579
|
@ -0,0 +1,155 @@
|
|||
#
|
||||
# Copyright 2018 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::mitel::3300icp::snmp::mode::licenses;
|
||||
|
||||
use base qw(centreon::plugins::templates::counter);
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Digest::MD5 qw(md5_hex);
|
||||
|
||||
sub custom_user_calc {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{result_values}->{purchased} = $options{new_datas}->{$self->{instance} . '_mitelIpera3000IPUsrLicPurchased'};
|
||||
$self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_mitelIpera3000IPUsrLicUsed'};
|
||||
$self->{result_values}->{prct} = ($self->{result_values}->{purchased} != 0) ? $self->{result_values}->{used} / $self->{result_values}->{purchased} * 100 : 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub custom_device_calc {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{result_values}->{purchased} = $options{new_datas}->{$self->{instance} . '_mitelIpera3000IPDevLicPurchased'};
|
||||
$self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_mitelIpera3000IPDevLicUsed'};
|
||||
$self->{result_values}->{prct} = ($self->{result_values}->{purchased} != 0) ? $self->{result_values}->{used} / $self->{result_values}->{purchased} * 100 : 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub custom_usage_perfdata {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{output}->perfdata_add(label => 'licenses_' . $self->{label},
|
||||
value => $self->{result_values}->{used},
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, total => $self->{result_values}->{purchased}, cast_int => 1),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, total => $self->{result_values}->{purchased}, cast_int => 1),
|
||||
min => 0, max => $self->{result_values}->{purchased});
|
||||
}
|
||||
|
||||
sub custom_usage_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
return sprintf("%s licenses used: %s/%s (%.2f %%)", ucfirst($self->{label}),
|
||||
$self->{result_values}->{used},
|
||||
$self->{result_values}->{purchased},
|
||||
$self->{result_values}->{prct});
|
||||
}
|
||||
|
||||
sub set_counters {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{maps_counters_type} = [
|
||||
{ name => 'global', type => 0 },
|
||||
];
|
||||
|
||||
$self->{maps_counters}->{global} = [
|
||||
{ label => 'user', set => {
|
||||
key_values => [ { name => 'mitelIpera3000IPUsrLicPurchased' }, { name => 'mitelIpera3000IPUsrLicUsed' } ],
|
||||
closure_custom_calc => $self->can('custom_user_calc'),
|
||||
closure_custom_output => $self->can('custom_usage_output'),
|
||||
threshold_use => 'prct',
|
||||
closure_custom_perfdata => $self->can('custom_usage_perfdata'),
|
||||
}
|
||||
},
|
||||
{ label => 'device', set => {
|
||||
key_values => [ { name => 'mitelIpera3000IPDevLicPurchased' }, { name => 'mitelIpera3000IPDevLicUsed' } ],
|
||||
closure_custom_calc => $self->can('custom_device_calc'),
|
||||
closure_custom_output => $self->can('custom_usage_output'),
|
||||
threshold_use => 'prct',
|
||||
closure_custom_perfdata => $self->can('custom_usage_perfdata'),
|
||||
}
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
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 check_options {
|
||||
my ($self, %options) = @_;
|
||||
$self->SUPER::check_options(%options);
|
||||
}
|
||||
|
||||
my $oid_mitelIpera3000IPUsrLicPurchased = '.1.3.6.1.4.1.1027.4.1.1.2.1.2.1.0';
|
||||
my $oid_mitelIpera3000IPUsrLicUsed = '.1.3.6.1.4.1.1027.4.1.1.2.1.2.2.0';
|
||||
my $oid_mitelIpera3000IPDevLicPurchased = '.1.3.6.1.4.1.1027.4.1.1.2.1.2.3.0';
|
||||
my $oid_mitelIpera3000IPDevLicUsed = '.1.3.6.1.4.1.1027.4.1.1.2.1.2.4.0';
|
||||
|
||||
sub manage_selection {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
my $result = $options{snmp}->get_leef(oids => [ $oid_mitelIpera3000IPUsrLicPurchased,
|
||||
$oid_mitelIpera3000IPUsrLicUsed,
|
||||
$oid_mitelIpera3000IPDevLicPurchased,
|
||||
$oid_mitelIpera3000IPDevLicUsed ],
|
||||
nothing_quit => 1);
|
||||
|
||||
$self->{global} = {
|
||||
mitelIpera3000IPUsrLicPurchased => $result->{$oid_mitelIpera3000IPUsrLicPurchased},
|
||||
mitelIpera3000IPUsrLicUsed => $result->{$oid_mitelIpera3000IPUsrLicUsed},
|
||||
mitelIpera3000IPDevLicPurchased => $result->{$oid_mitelIpera3000IPDevLicPurchased},
|
||||
mitelIpera3000IPDevLicUsed => $result->{$oid_mitelIpera3000IPDevLicUsed},
|
||||
};
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=head1 MODE
|
||||
|
||||
Check call server licenses used versus purchased.
|
||||
|
||||
=over 8
|
||||
|
||||
=item B<--warning-*>
|
||||
|
||||
Threshold warning.
|
||||
Can be: 'user' (%), 'device' (%).
|
||||
|
||||
=item B<--critical-*>
|
||||
|
||||
Threshold critical.
|
||||
Can be: 'user' (%), 'device' (%).
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
|
@ -0,0 +1,124 @@
|
|||
#
|
||||
# Copyright 2018 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::mitel::3300icp::snmp::mode::listzaps;
|
||||
|
||||
use base qw(centreon::plugins::mode);
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
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 =>
|
||||
{
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
});
|
||||
$self->{zap} = {};
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub check_options {
|
||||
my ($self, %options) = @_;
|
||||
$self->SUPER::init(%options);
|
||||
}
|
||||
|
||||
my $mapping = {
|
||||
mitelBWMCurrentZAPLabel => { oid => '.1.3.6.1.4.1.1027.4.1.1.2.5.1.1.1.1.4' },
|
||||
};
|
||||
|
||||
sub manage_selection {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
my $snmp_result = $options{snmp}->get_multiple_table(oids => [ { oid => $mapping->{mitelBWMCurrentZAPLabel}->{oid} },
|
||||
],
|
||||
return_type => 1, nothing_quit => 1);
|
||||
foreach my $oid (keys %$snmp_result) {
|
||||
next if ($oid !~ /^$mapping->{mitelBWMCurrentZAPLabel}->{oid}\.(.*)$/);
|
||||
my $instance = $1;
|
||||
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
|
||||
|
||||
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
|
||||
$result->{mitelBWMCurrentZAPLabel} !~ /$self->{option_results}->{filter_name}/) {
|
||||
$self->{output}->output_add(long_msg => "skipping '" . $result->{mitelBWMCurrentZAPLabel} . "': no matching filter.", debug => 1);
|
||||
next;
|
||||
}
|
||||
|
||||
$self->{zap}->{$instance} = {
|
||||
name => $result->{mitelBWMCurrentZAPLabel},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
sub run {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->manage_selection(%options);
|
||||
foreach my $instance (sort keys %{$self->{zap}}) {
|
||||
$self->{output}->output_add(long_msg => '[name = ' . $self->{zap}->{$instance}->{name} . "]"
|
||||
);
|
||||
}
|
||||
|
||||
$self->{output}->output_add(severity => 'OK',
|
||||
short_msg => 'List zone access points:');
|
||||
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
|
||||
$self->{output}->exit();
|
||||
}
|
||||
|
||||
sub disco_format {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{output}->add_disco_format(elements => ['name']);
|
||||
}
|
||||
|
||||
sub disco_show {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->manage_selection(%options);
|
||||
foreach my $instance (sort keys %{$self->{zap}}) {
|
||||
$self->{output}->add_disco_entry(
|
||||
name => $self->{zap}->{$instance}->{name}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=head1 MODE
|
||||
|
||||
List zone access points.
|
||||
|
||||
=over 8
|
||||
|
||||
=item B<--filter-name>
|
||||
|
||||
Filter by zone access points name (can be a regexp).
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
|
@ -0,0 +1,168 @@
|
|||
#
|
||||
# Copyright 2018 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::mitel::3300icp::snmp::mode::zapbandwidth;
|
||||
|
||||
use base qw(centreon::plugins::templates::counter);
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Digest::MD5 qw(md5_hex);
|
||||
|
||||
sub custom_usage_calc {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_mitelBWMCurrentBandwidthInUse'} * 1000;
|
||||
$self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_mitelBWMCurrentBandwidthLimit'} * 1000;
|
||||
$self->{result_values}->{used_prct} = $self->{result_values}->{used} / $self->{result_values}->{total} * 100;
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub custom_usage_perfdata {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{output}->perfdata_add(label => 'usage', unit => 'b/s',
|
||||
value => $self->{result_values}->{used},
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, total => $self->{result_values}->{total}, cast_int => 1),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, total => $self->{result_values}->{total}, cast_int => 1),
|
||||
min => 0, max => $self->{result_values}->{total});
|
||||
}
|
||||
|
||||
sub custom_usage_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
my ($used_value, $used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used}, network => 1);
|
||||
return sprintf("Bandwidth usage: %s/s (%.2f %%)", $used_value . ' ' . $used_unit, $self->{result_values}->{used_prct});
|
||||
}
|
||||
|
||||
sub set_counters {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{maps_counters_type} = [
|
||||
{ name => 'zap', type => 1, cb_prefix_output => 'prefix_zap_output', message_multiple => 'All zone access points are ok' },
|
||||
];
|
||||
|
||||
$self->{maps_counters}->{zap} = [
|
||||
{ label => 'usage', set => {
|
||||
key_values => [ { name => 'mitelBWMCurrentBandwidthInUse' }, { name => 'mitelBWMCurrentBandwidthLimit' },
|
||||
{ name => 'display' } ],
|
||||
closure_custom_calc => $self->can('custom_usage_calc'),
|
||||
closure_custom_output => $self->can('custom_usage_output'),
|
||||
threshold_use => 'used_prct',
|
||||
closure_custom_perfdata => $self->can('custom_usage_perfdata'),
|
||||
}
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
sub prefix_zap_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
return "Zone access point '" . $options{instance_value}->{display} . "' ";
|
||||
}
|
||||
|
||||
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 =>
|
||||
{
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub check_options {
|
||||
my ($self, %options) = @_;
|
||||
$self->SUPER::check_options(%options);
|
||||
}
|
||||
|
||||
my $oid_mitelBWMCurrentZAPLabel = '.1.3.6.1.4.1.1027.4.1.1.2.5.1.1.1.1.4',
|
||||
my $mapping = {
|
||||
mitelBWMCurrentBandwidthInUse => { oid => '.1.3.6.1.4.1.1027.4.1.1.2.5.1.1.1.1.5' },
|
||||
mitelBWMCurrentBandwidthLimit => { oid => '.1.3.6.1.4.1.1027.4.1.1.2.5.1.1.1.1.6' },
|
||||
};
|
||||
|
||||
sub manage_selection {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{zap} = {};
|
||||
my $snmp_result = $options{snmp}->get_table(oid => $oid_mitelBWMCurrentZAPLabel, nothing_quit => 1);
|
||||
foreach my $oid (keys %{$snmp_result}) {
|
||||
$oid =~ /^$oid_mitelBWMCurrentZAPLabel\.(.*)$/;
|
||||
my $instance = $1;
|
||||
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
|
||||
$snmp_result->{$oid} !~ /$self->{option_results}->{filter_name}/) {
|
||||
$self->{output}->output_add(long_msg => "skipping '" . $snmp_result->{$oid} . "'.", debug => 1);
|
||||
next;
|
||||
}
|
||||
|
||||
$self->{zap}->{$instance} = { display => $snmp_result->{$oid} };
|
||||
}
|
||||
|
||||
$options{snmp}->load(oids => [ $mapping->{mitelBWMCurrentBandwidthInUse}->{oid},
|
||||
$mapping->{mitelBWMCurrentBandwidthLimit}->{oid} ],
|
||||
instances => [ keys %{$self->{zap}} ],
|
||||
instance_regexp => '^(.*)$');
|
||||
$snmp_result = $options{snmp}->get_leef(nothing_quit => 1);
|
||||
|
||||
foreach (keys %{$self->{zap}}) {
|
||||
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $_);
|
||||
|
||||
foreach my $name (keys %{$mapping}) {
|
||||
$self->{zap}->{$_}->{$name} = $result->{$name};
|
||||
}
|
||||
}
|
||||
|
||||
if (scalar(keys %{$self->{zap}}) <= 0) {
|
||||
$self->{output}->add_option_msg(short_msg => "No zone access points found.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=head1 MODE
|
||||
|
||||
Check zone access points bandwidth usage.
|
||||
|
||||
=over 8
|
||||
|
||||
=item B<--filter-name>
|
||||
|
||||
Filter by zone access points name (can be a regexp).
|
||||
|
||||
=item B<--warning-usage>
|
||||
|
||||
Threshold warning in percentage of bandwidth limit.
|
||||
|
||||
=item B<--critical-usage>
|
||||
|
||||
Threshold critical in percentage of bandwidth limit.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
#
|
||||
# Copyright 2018 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::mitel::3300icp::snmp::mode::zapcalls;
|
||||
|
||||
use base qw(centreon::plugins::templates::counter);
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Digest::MD5 qw(md5_hex);
|
||||
|
||||
sub set_counters {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{maps_counters_type} = [
|
||||
{ name => 'zap', type => 1, cb_prefix_output => 'prefix_zap_output', message_multiple => 'All zone access points are ok' },
|
||||
];
|
||||
|
||||
$self->{maps_counters}->{zap} = [
|
||||
{ label => 'admitted', set => {
|
||||
key_values => [ { name => 'mitelBWMCumCACAdmissions', diff => 1 }, { name => 'display' } ],
|
||||
output_template => 'Admitted calls: %s',
|
||||
perfdatas => [
|
||||
{ label => 'admitted', value => 'mitelBWMCumCACAdmissions_absolute', template => '%s',
|
||||
min => 0, unit => 'calls', label_extra_instance => 1, instance_use => 'display_absolute' },
|
||||
],
|
||||
}
|
||||
},
|
||||
{ label => 'rejected', set => {
|
||||
key_values => [ { name => 'mitelBWMCumCACRejections', diff => 1 }, { name => 'display' } ],
|
||||
output_template => 'Rejected calls: %s',
|
||||
perfdatas => [
|
||||
{ label => 'rejected', value => 'mitelBWMCumCACRejections_absolute', template => '%s',
|
||||
min => 0, unit => 'calls', label_extra_instance => 1, instance_use => 'display_absolute' },
|
||||
],
|
||||
}
|
||||
},
|
||||
{ label => 'rejection-ratio', set => {
|
||||
key_values => [ { name => 'mitelBWMCumCACRejectionRatio' }, { name => 'display' } ],
|
||||
output_template => 'Rejection ratio: %s%%',
|
||||
perfdatas => [
|
||||
{ label => 'rejection_ratio', value => 'mitelBWMCumCACRejectionRatio_absolute', template => '%s',
|
||||
min => 0, max => 100, unit => '%', label_extra_instance => 1, instance_use => 'display_absolute' },
|
||||
],
|
||||
}
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
sub prefix_zap_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
return "Zone access point '" . $options{instance_value}->{display} . "' ";
|
||||
}
|
||||
|
||||
sub new {
|
||||
my ($class, %options) = @_;
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1);
|
||||
bless $self, $class;
|
||||
|
||||
$self->{version} = '1.0';
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub check_options {
|
||||
my ($self, %options) = @_;
|
||||
$self->SUPER::check_options(%options);
|
||||
}
|
||||
|
||||
my $oid_mitelBWMCumZAPLabel = '.1.3.6.1.4.1.1027.4.1.1.2.5.1.1.2.1.4',
|
||||
my $mapping = {
|
||||
mitelBWMCumCACAdmissions => { oid => '.1.3.6.1.4.1.1027.4.1.1.2.5.1.1.2.1.5' },
|
||||
mitelBWMCumCACRejections => { oid => '.1.3.6.1.4.1.1027.4.1.1.2.5.1.1.2.1.6' },
|
||||
mitelBWMCumCACRejectionRatio => { oid => '.1.3.6.1.4.1.1027.4.1.1.2.5.1.1.2.1.7' },
|
||||
};
|
||||
|
||||
sub manage_selection {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{zap} = {};
|
||||
my $snmp_result = $options{snmp}->get_table(oid => $oid_mitelBWMCumZAPLabel, nothing_quit => 1);
|
||||
foreach my $oid (keys %{$snmp_result}) {
|
||||
$oid =~ /^$oid_mitelBWMCumZAPLabel\.(.*)$/;
|
||||
my $instance = $1;
|
||||
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
|
||||
$snmp_result->{$oid} !~ /$self->{option_results}->{filter_name}/) {
|
||||
$self->{output}->output_add(long_msg => "skipping '" . $snmp_result->{$oid} . "'.", debug => 1);
|
||||
next;
|
||||
}
|
||||
|
||||
$self->{zap}->{$instance} = { display => $snmp_result->{$oid} };
|
||||
}
|
||||
|
||||
$options{snmp}->load(oids => [ $mapping->{mitelBWMCumCACAdmissions}->{oid},
|
||||
$mapping->{mitelBWMCumCACRejections}->{oid},
|
||||
$mapping->{mitelBWMCumCACRejectionRatio}->{oid} ],
|
||||
instances => [ keys %{$self->{zap}} ],
|
||||
instance_regexp => '^(.*)$');
|
||||
$snmp_result = $options{snmp}->get_leef(nothing_quit => 1);
|
||||
|
||||
foreach (keys %{$self->{zap}}) {
|
||||
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $_);
|
||||
|
||||
foreach my $name (keys %{$mapping}) {
|
||||
$self->{zap}->{$_}->{$name} = $result->{$name};
|
||||
}
|
||||
}
|
||||
|
||||
if (scalar(keys %{$self->{zap}}) <= 0) {
|
||||
$self->{output}->add_option_msg(short_msg => "No zone access points found.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
||||
$self->{cache_name} = "mitel_3300icp_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' .
|
||||
(defined($self->{option_results}->{filter_name}) ? md5_hex($self->{option_results}->{filter_name}) : md5_hex('all'));
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=head1 MODE
|
||||
|
||||
Check zone access points calls.
|
||||
|
||||
=over 8
|
||||
|
||||
=item B<--filter-name>
|
||||
|
||||
Filter by zone access points name (can be a regexp).
|
||||
|
||||
=item B<--warning-*>
|
||||
|
||||
Threshold warning.
|
||||
Can be: 'admitted', 'rejected', 'rejection-ratio' (%).
|
||||
|
||||
=item B<--critical-*>
|
||||
|
||||
Threshold critical.
|
||||
Can be: 'admitted', 'rejected', 'rejection-ratio' (%).
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
#
|
||||
# Copyright 2018 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::mitel::3300icp::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} = '0.1';
|
||||
%{$self->{modes}} = (
|
||||
'interfaces' => 'snmp_standard::mode::interfaces',
|
||||
'list-interfaces' => 'snmp_standard::mode::listinterfaces',
|
||||
'list-zaps' => 'network::mitel::3300icp::snmp::mode::listzaps',
|
||||
'licenses' => 'network::mitel::3300icp::snmp::mode::licenses',
|
||||
'uptime' => 'snmp_standard::mode::uptime',
|
||||
'zap-bandwidth' => 'network::mitel::3300icp::snmp::mode::zapbandwidth',
|
||||
'zap-calls' => 'network::mitel::3300icp::snmp::mode::zapcalls',
|
||||
);
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=head1 PLUGIN DESCRIPTION
|
||||
|
||||
Check Mitel 3300 ICP through SNMP
|
||||
|
||||
=cut
|
Loading…
Reference in New Issue