commit
284ee0dc08
|
@ -1,105 +0,0 @@
|
||||||
#
|
|
||||||
# Copyright 2016 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 apps::lync::mode::imsessions;
|
|
||||||
|
|
||||||
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 =>
|
|
||||||
{
|
|
||||||
"warning:s" => { name => 'warning', },
|
|
||||||
"critical:s" => { name => 'critical', },
|
|
||||||
});
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::init(%options);
|
|
||||||
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub run {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
# $options{sql} = sqlmode object
|
|
||||||
$self->{sql} = $options{sql};
|
|
||||||
|
|
||||||
$self->{sql}->connect();
|
|
||||||
$self->{sql}->query(query => q{SELECT count(*)
|
|
||||||
FROM [LcsCDR].[dbo].[SessionDetails] s
|
|
||||||
left outer join [LcsCDR].[dbo].[Users] u1 on s.User1Id = u1.UserId left outer join [LcsCDR].[dbo].[Users] u2 on s.User2Id = u2.UserId
|
|
||||||
WHERE (MediaTypes & 1)=1
|
|
||||||
AND s.SessionIdTime>=dateadd(minute,-5,getdate())}
|
|
||||||
);
|
|
||||||
my $im_sessions = $self->{sql}->fetchrow_array();
|
|
||||||
|
|
||||||
my $exit_code = $self->{perfdata}->threshold_check(value => $im_sessions, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
|
||||||
|
|
||||||
$self->{output}->output_add(severity => $exit_code,
|
|
||||||
short_msg => sprintf("%i instant messaging sessions running", $im_sessions));
|
|
||||||
$self->{output}->perfdata_add(label => 'im_sessions', unit => 'sessions',
|
|
||||||
value => $im_sessions,
|
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
|
|
||||||
min => 0);
|
|
||||||
|
|
||||||
$self->{output}->display();
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
|
||||||
|
|
||||||
__END__
|
|
||||||
|
|
||||||
=head1 MODE
|
|
||||||
|
|
||||||
Check Lync number of active instant messaging session during last five minutes
|
|
||||||
|
|
||||||
=over 8
|
|
||||||
|
|
||||||
=item B<--warning>
|
|
||||||
|
|
||||||
Threshold warning on number of active messaging sessions
|
|
||||||
|
|
||||||
=item B<--critical>
|
|
||||||
|
|
||||||
Threshold critical on number of active messaging sessions
|
|
||||||
|
|
||||||
=back
|
|
||||||
|
|
||||||
=cut
|
|
|
@ -1,148 +0,0 @@
|
||||||
#
|
|
||||||
# Copyright 2016 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 apps::lync::mode::lyncusers;
|
|
||||||
|
|
||||||
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 =>
|
|
||||||
{
|
|
||||||
"warning:s" => { name => 'warning', },
|
|
||||||
"critical:s" => { name => 'critical', },
|
|
||||||
"warning-unique:s" => { name => 'warning_unique', },
|
|
||||||
"critical-unique:s" => { name => 'critical_unique', },
|
|
||||||
});
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::init(%options);
|
|
||||||
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warning-unique', value => $self->{option_results}->{warning})) == 0) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'critical-unique', value => $self->{option_results}->{critical})) == 0) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub run {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
# $options{sql} = sqlmode object
|
|
||||||
$self->{sql} = $options{sql};
|
|
||||||
|
|
||||||
$self->{sql}->connect();
|
|
||||||
$self->{sql}->query(query => q{Select
|
|
||||||
(cast (RE.ClientApp as varchar (100))) as ClientVersion,
|
|
||||||
R.UserAtHost as UserName,
|
|
||||||
Reg.Fqdn
|
|
||||||
From
|
|
||||||
rtcdyn.dbo.RegistrarEndpoint RE
|
|
||||||
Inner Join
|
|
||||||
rtc.dbo.Resource R on R.ResourceId = RE.OwnerId
|
|
||||||
Inner Join
|
|
||||||
rtcdyn.dbo.Registrar Reg on Reg.RegistrarId = RE.PrimaryRegistrarClusterId
|
|
||||||
Order By ClientVersion, UserName }
|
|
||||||
);
|
|
||||||
my $users = $self->{sql}->fetchrow_array();
|
|
||||||
|
|
||||||
$self->{sql}->query(query => q{Select
|
|
||||||
count(*) as totalonline, count(distinct UserAtHost) as totalunique
|
|
||||||
From
|
|
||||||
rtcdyn.dbo.RegistrarEndpoint RE
|
|
||||||
Inner Join
|
|
||||||
rtc.dbo.Resource R on R.ResourceId = RE.OwnerId
|
|
||||||
Inner Join
|
|
||||||
rtcdyn.dbo.Registrar Reg on Reg.RegistrarId = RE.PrimaryRegistrarClusterId}
|
|
||||||
);
|
|
||||||
my $unique_users = $self->{sql}->fetchrow_array();
|
|
||||||
|
|
||||||
my $exit1 = $self->{perfdata}->threshold_check(value => $unique_users, threshold => [ { label => 'critical-unique', 'exit_litteral' => 'critical' }, { label => 'warning-unique', exit_litteral => 'warning' } ]);
|
|
||||||
my $exit2 = $self->{perfdata}->threshold_check(value => $users, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
|
||||||
my $exit_code = $self->{output}->get_most_critical(status => [ $exit1, $exit2 ]);
|
|
||||||
|
|
||||||
$self->{output}->output_add(severity => $exit_code,
|
|
||||||
short_msg => sprintf("%i lync unique user(s). (%i total users)", $unique_users, $users));
|
|
||||||
$self->{output}->perfdata_add(label => 'unique_users',
|
|
||||||
value => $unique_users,
|
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-unique'),
|
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-unique'),
|
|
||||||
min => 0);
|
|
||||||
$self->{output}->perfdata_add(label => 'total_users',
|
|
||||||
value => $users,
|
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
|
|
||||||
min => 0);
|
|
||||||
|
|
||||||
$self->{output}->display();
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
|
||||||
|
|
||||||
__END__
|
|
||||||
|
|
||||||
=head1 MODE
|
|
||||||
|
|
||||||
Check Lync users and unique users (one user can be connected with several devices) -- use with dyn-mode mssql plugin)
|
|
||||||
|
|
||||||
=over 8
|
|
||||||
|
|
||||||
=item B<--warning>
|
|
||||||
|
|
||||||
Threshold warning on total users
|
|
||||||
|
|
||||||
=item B<--critical>
|
|
||||||
|
|
||||||
Threshold critical on total users
|
|
||||||
|
|
||||||
=item B<--warning-unique>
|
|
||||||
|
|
||||||
Threshold warning on unique users
|
|
||||||
|
|
||||||
=item B<--critical-unique>
|
|
||||||
|
|
||||||
Threshold critical on unique users
|
|
||||||
|
|
||||||
|
|
||||||
=back
|
|
||||||
|
|
||||||
=cut
|
|
|
@ -1,105 +0,0 @@
|
||||||
#
|
|
||||||
# Copyright 2016 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 apps::lync::mode::remoteassistance;
|
|
||||||
|
|
||||||
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 =>
|
|
||||||
{
|
|
||||||
"warning:s" => { name => 'warning', },
|
|
||||||
"critical:s" => { name => 'critical', },
|
|
||||||
});
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::init(%options);
|
|
||||||
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub run {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
# $options{sql} = sqlmode object
|
|
||||||
$self->{sql} = $options{sql};
|
|
||||||
|
|
||||||
$self->{sql}->connect();
|
|
||||||
$self->{sql}->query(query => q{SELECT count(*)
|
|
||||||
FROM [LcsCDR].[dbo].[SessionDetails] s
|
|
||||||
left outer join [LcsCDR].[dbo].[Users] u1 on s.User1Id = u1.UserId left outer join [LcsCDR].[dbo].[Users] u2 on s.User2Id = u2.UserId
|
|
||||||
WHERE (MediaTypes & 1)=4
|
|
||||||
AND s.SessionIdTime>=dateadd(minute,-5,getdate())}
|
|
||||||
);
|
|
||||||
my $remote_assistance_sessions = $self->{sql}->fetchrow_array();
|
|
||||||
|
|
||||||
my $exit_code = $self->{perfdata}->threshold_check(value => $remote_assistance_sessions, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
|
||||||
|
|
||||||
$self->{output}->output_add(severity => $exit_code,
|
|
||||||
short_msg => sprintf("%i remote assistance sessions running", $remote_assistance_sessions));
|
|
||||||
$self->{output}->perfdata_add(label => 'assistance_sessions', unit => 'sessions',
|
|
||||||
value => $remote_assistance_sessions,
|
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
|
|
||||||
min => 0);
|
|
||||||
|
|
||||||
$self->{output}->display();
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
|
||||||
|
|
||||||
__END__
|
|
||||||
|
|
||||||
=head1 MODE
|
|
||||||
|
|
||||||
Check Lync number of active remote assistance sessions during last five minutes -- use with dyn-mode mssql plugin
|
|
||||||
|
|
||||||
=over 8
|
|
||||||
|
|
||||||
=item B<--warning>
|
|
||||||
|
|
||||||
Threshold warning
|
|
||||||
|
|
||||||
=item B<--critical>
|
|
||||||
|
|
||||||
Threshold critical
|
|
||||||
|
|
||||||
=back
|
|
||||||
|
|
||||||
=cut
|
|
|
@ -1,142 +0,0 @@
|
||||||
#
|
|
||||||
# Copyright 2016 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 apps::lync::mode::sessionstype;
|
|
||||||
|
|
||||||
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 =>
|
|
||||||
{
|
|
||||||
"warning-audio:s" => { name => 'warning-audio', },
|
|
||||||
"critical-audio:s" => { name => 'critical-audio', },
|
|
||||||
"warning-video:s" => { name => 'warning_video', },
|
|
||||||
"critical-video:s" => { name => 'critical_video', },
|
|
||||||
});
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub check_options {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
$self->SUPER::init(%options);
|
|
||||||
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warning-audio', value => $self->{option_results}->{warning})) == 0) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong warning-audio threshold '" . $self->{option_results}->{warning} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'critical-audio', value => $self->{option_results}->{critical})) == 0) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical-audio threshold '" . $self->{option_results}->{critical} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'warning-video', value => $self->{option_results}->{warning})) == 0) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong warning-video threshold '" . $self->{option_results}->{warning} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
if (($self->{perfdata}->threshold_validate(label => 'critical-video', value => $self->{option_results}->{critical})) == 0) {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong critical-video threshold '" . $self->{option_results}->{critical} . "'.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub run {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
# $options{sql} = sqlmode object
|
|
||||||
$self->{sql} = $options{sql};
|
|
||||||
|
|
||||||
$self->{sql}->connect();
|
|
||||||
|
|
||||||
$self->{sql}->query(query => q{SELECT count(*)
|
|
||||||
FROM [LcsCDR].[dbo].[SessionDetails] s
|
|
||||||
left outer join [LcsCDR].[dbo].[Users] u1 on s.User1Id = u1.UserId left outer join [LcsCDR].[dbo].[Users] u2 on s.User2Id = u2.UserId
|
|
||||||
WHERE (MediaTypes & 1)=16
|
|
||||||
AND s.SessionIdTime>=dateadd(minute,-5,getdate())}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
my $audio = $self->{sql}->fetchrow_array();
|
|
||||||
|
|
||||||
$self->{sql}->query(query => q{SELECT count(*)
|
|
||||||
FROM [LcsCDR].[dbo].[SessionDetails] s
|
|
||||||
left outer join [LcsCDR].[dbo].[Users] u1 on s.User1Id = u1.UserId left outer join [LcsCDR].[dbo].[Users] u2 on s.User2Id = u2.UserId
|
|
||||||
WHERE (MediaTypes & 1)=32
|
|
||||||
AND s.SessionIdTime>=dateadd(minute,-5,getdate())}
|
|
||||||
);
|
|
||||||
|
|
||||||
my $video = $self->{sql}->fetchrow_array();
|
|
||||||
|
|
||||||
my $exit1 = $self->{perfdata}->threshold_check(value => $audio, threshold => [ { label => 'critical-audio', 'exit_litteral' => 'critical' }, { label => 'warning-audio', exit_litteral => 'warning' } ]);
|
|
||||||
my $exit2 = $self->{perfdata}->threshold_check(value => $video, threshold => [ { label => 'critical-video', 'exit_litteral' => 'critical' }, { label => 'warning-video', exit_litteral => 'warning' } ]);
|
|
||||||
my $exit_code = $self->{output}->get_most_critical(status => [ $exit1, $exit2 ]);
|
|
||||||
|
|
||||||
$self->{output}->output_add(severity => $exit_code,
|
|
||||||
short_msg => sprintf("Lync sessions type : %i audio sessions and %i video sessions", $audio, $video));
|
|
||||||
$self->{output}->perfdata_add(label => 'video_sessions',
|
|
||||||
value => $video,
|
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-video'),
|
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-video'),
|
|
||||||
min => 0);
|
|
||||||
$self->{output}->perfdata_add(label => 'audio_sessions',
|
|
||||||
value => $audio,
|
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-audio'),
|
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-audio'),
|
|
||||||
min => 0);
|
|
||||||
|
|
||||||
$self->{output}->display();
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
|
||||||
|
|
||||||
__END__
|
|
||||||
|
|
||||||
=head1 MODE
|
|
||||||
|
|
||||||
Check Lync type of sessions (audio or video) during the last five minutes -- use with dyn-mode and mssql plugin
|
|
||||||
|
|
||||||
=over 8
|
|
||||||
|
|
||||||
=item B<--warning-audio>
|
|
||||||
|
|
||||||
Threshold warning on number of audio sessions during last five minutes
|
|
||||||
|
|
||||||
=item B<--critical-audio>
|
|
||||||
|
|
||||||
Threshold critical on number of audio sessions during last five minutes
|
|
||||||
|
|
||||||
=item B<--warning-video>
|
|
||||||
|
|
||||||
Threshold critical on number of video sessions during last five minutes
|
|
||||||
|
|
||||||
=item B<--critical-video>
|
|
||||||
|
|
||||||
Threshold critical on number of video sessions during last five minutes
|
|
||||||
|
|
||||||
=back
|
|
||||||
|
|
||||||
=cut
|
|
|
@ -140,7 +140,7 @@ sub new {
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::check_options(%options);
|
||||||
|
|
||||||
$instance_mode = $self;
|
$instance_mode = $self;
|
||||||
$self->change_macros();
|
$self->change_macros();
|
||||||
|
|
|
@ -20,286 +20,292 @@
|
||||||
|
|
||||||
package centreon::common::cisco::standard::snmp::mode::ipsla;
|
package centreon::common::cisco::standard::snmp::mode::ipsla;
|
||||||
|
|
||||||
use base qw(centreon::plugins::mode);
|
use base qw(centreon::plugins::templates::counter);
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use centreon::plugins::statefile;
|
|
||||||
use centreon::plugins::values;
|
|
||||||
use Digest::MD5 qw(md5_hex);
|
use Digest::MD5 qw(md5_hex);
|
||||||
use Math::Complex;
|
use Math::Complex;
|
||||||
|
|
||||||
my $maps_counters = {
|
sub set_counters {
|
||||||
'000_status' => { class => 'centreon::plugins::values', obj => undef, threshold => 0,
|
my ($self, %options) = @_;
|
||||||
set => {
|
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' },
|
$self->{maps_counters_type} = [
|
||||||
{ name => 'rttMonCtrlAdminTag' },
|
{ name => 'tag', type => 1, cb_prefix_output => 'prefix_tag_output', message_multiple => 'All RTT controls are ok',
|
||||||
{ name => 'rttMonCtrlAdminRttType' },
|
skipped_code => { -2 => 1 } }
|
||||||
{ name => 'rttMonCtrlAdminThreshold' },
|
];
|
||||||
{ name => 'rttMonEchoAdminPrecision' },
|
$self->{maps_counters}->{tag} = [
|
||||||
{ name => 'rttMonLatestRttOperCompletionTime' },
|
{ label => 'status', threshold => 0, set => {
|
||||||
{ name => 'rttMonLatestRttOperSense' },
|
key_values => [ { name => 'rttMonCtrlAdminStatus' },
|
||||||
{ name => 'rttMonLatestRttOperApplSpecificSense' },
|
{ name => 'rttMonCtrlAdminTag' },
|
||||||
],
|
{ name => 'rttMonCtrlAdminRttType' },
|
||||||
closure_custom_calc => \&custom_status_calc,
|
{ name => 'rttMonCtrlAdminThreshold' },
|
||||||
closure_custom_output => \&custom_status_output,
|
{ name => 'rttMonEchoAdminPrecision' },
|
||||||
closure_custom_perfdata => \&custom_status_perfdata,
|
{ name => 'rttMonLatestRttOperCompletionTime' },
|
||||||
closure_custom_threshold_check => \&custom_status_threshold,
|
{ name => 'rttMonLatestRttOperSense' },
|
||||||
}
|
{ name => 'rttMonLatestRttOperApplSpecificSense' },
|
||||||
},
|
],
|
||||||
'001_NumberOverThresholds' => { class => 'centreon::plugins::values', obj => undef,
|
closure_custom_calc => $self->can('custom_status_calc'),
|
||||||
set => {
|
closure_custom_output => $self->can('custom_status_output'),
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
closure_custom_perfdata => sub { return 0; },
|
||||||
{ name => 'OverThresholds_1' }, { name => 'OverThresholds_2' }, { name => 'OverThresholds_times' },
|
closure_custom_threshold_check => $self->can('custom_status_threshold'),
|
||||||
],
|
}
|
||||||
closure_custom_calc => \&custom_NumberOverThresholds_calc,
|
},
|
||||||
closure_custom_output => \&custom_generic_output,
|
{ label => 'CompletionTime', set => {
|
||||||
output_template => 'Number Over Thresholds : %s',
|
key_values => [ { name => 'rttMonLatestRttOperCompletionTime' }, { name => 'rttMonEchoAdminPrecision' }, { name => 'rttMonCtrlAdminTag' }
|
||||||
threshold_use => 'value',
|
],
|
||||||
perfdatas => [
|
output_template => 'Completion Time : %s',
|
||||||
{ label => 'number_over_thresholds', value => 'value', template => '%s',
|
perfdatas => [
|
||||||
label_extra_instance => 1 },
|
{ label => 'completion_time', value => 'rttMonLatestRttOperCompletionTime_absolute', template => '%s',
|
||||||
],
|
min => 0, label_extra_instance => 1 },
|
||||||
}
|
],
|
||||||
},
|
}
|
||||||
'002_AverageDelaySD' => { class => 'centreon::plugins::values', obj => undef,
|
},
|
||||||
set => {
|
{ label => 'NumberOverThresholds', set => {
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
||||||
{ name => 'OWSumSD_1' }, { name => 'OWSumSD_2' }, { name => 'OWSumSD_times' },
|
{ name => 'OverThresholds_1' }, { name => 'OverThresholds_2' }, { name => 'OverThresholds_times' },
|
||||||
{ name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' },
|
],
|
||||||
],
|
closure_custom_calc => $self->can('custom_NumberOverThresholds_calc'),
|
||||||
closure_custom_calc => \&custom_AverageDelaySD_calc,
|
closure_custom_output => $self->can('custom_generic_output'),
|
||||||
closure_custom_output => \&custom_generic_output,
|
output_template => 'Number Over Thresholds : %s',
|
||||||
output_template => 'Average Delay SD : %.2f ms',
|
threshold_use => 'value',
|
||||||
threshold_use => 'value',
|
perfdatas => [
|
||||||
perfdatas => [
|
{ label => 'number_over_thresholds', value => 'value', template => '%s',
|
||||||
{ label => 'average_delay_sd', value => 'value', template => '%.2f', unit => 'ms',
|
label_extra_instance => 1 },
|
||||||
label_extra_instance => 1 },
|
],
|
||||||
],
|
}
|
||||||
}
|
},
|
||||||
},
|
{ label => 'AverageDelaySD', set => {
|
||||||
'003_AverageDelayDS' => { class => 'centreon::plugins::values', obj => undef,
|
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
||||||
set => {
|
{ name => 'OWSumSD_1' }, { name => 'OWSumSD_2' }, { name => 'OWSumSD_times' },
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
{ name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' },
|
||||||
{ name => 'OWSumDS_1' }, { name => 'OWSumDS_2' }, { name => 'OWSumDS_times' },
|
],
|
||||||
{ name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' },
|
closure_custom_calc => $self->can('custom_AverageDelaySD_calc'),
|
||||||
],
|
closure_custom_output => $self->can('custom_generic_output'),
|
||||||
closure_custom_calc => \&custom_AverageDelayDS_calc,
|
output_template => 'Average Delay SD : %.2f ms',
|
||||||
closure_custom_output => \&custom_generic_output,
|
threshold_use => 'value',
|
||||||
output_template => 'Average Delay DS : %.2f ms',
|
perfdatas => [
|
||||||
threshold_use => 'value',
|
{ label => 'average_delay_sd', value => 'value', template => '%.2f', unit => 'ms',
|
||||||
perfdatas => [
|
label_extra_instance => 1 },
|
||||||
{ label => 'average_delay_ds', value => 'value', template => '%.2f', unit => 'ms',
|
],
|
||||||
label_extra_instance => 1 },
|
}
|
||||||
],
|
},
|
||||||
}
|
{ label => 'AverageDelayDS', set => {
|
||||||
},
|
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
||||||
'004_PacketLossRatio' => { class => 'centreon::plugins::values', obj => undef,
|
{ name => 'OWSumDS_1' }, { name => 'OWSumDS_2' }, { name => 'OWSumDS_times' },
|
||||||
set => {
|
{ name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' },
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
],
|
||||||
{ name => 'PacketLossDS_1' }, { name => 'PacketLossDS_2' }, { name => 'PacketLossDS_times' },
|
closure_custom_calc => $self->can('custom_AverageDelayDS_calc'),
|
||||||
{ name => 'PacketLossSD_1' }, { name => 'PacketLossSD_2' }, { name => 'PacketLossSD_times' },
|
closure_custom_output => $self->can('custom_generic_output'),
|
||||||
{ name => 'PacketMIA_1' }, { name => 'PacketMIA_2' }, { name => 'PacketMIA_times' },
|
output_template => 'Average Delay DS : %.2f ms',
|
||||||
{ name => 'PacketLateArrival_1' }, { name => 'PacketLateArrival_2' }, { name => 'PacketLateArrival_times' },
|
threshold_use => 'value',
|
||||||
{ name => 'PacketOutOfSequence_1' }, { name => 'PacketOutOfSequence_2' }, { name => 'PacketOutOfSequence_times' },
|
perfdatas => [
|
||||||
{ name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' },
|
{ label => 'average_delay_ds', value => 'value', template => '%.2f', unit => 'ms',
|
||||||
],
|
label_extra_instance => 1 },
|
||||||
closure_custom_calc => \&custom_PacketLossRatio_calc,
|
],
|
||||||
closure_custom_output => \&custom_generic_output,
|
}
|
||||||
output_template => 'Packet Loss Ratio : %.2f %%',
|
},
|
||||||
threshold_use => 'value',
|
{ label => 'PacketLossRatio', set => {
|
||||||
perfdatas => [
|
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
||||||
{ label => 'packet_loss_ratio', value => 'value', template => '%.2f', unit => '%',
|
{ name => 'PacketLossDS_1' }, { name => 'PacketLossDS_2' }, { name => 'PacketLossDS_times' },
|
||||||
label_extra_instance => 1, min => 0, max => 100 },
|
{ name => 'PacketLossSD_1' }, { name => 'PacketLossSD_2' }, { name => 'PacketLossSD_times' },
|
||||||
],
|
{ name => 'PacketMIA_1' }, { name => 'PacketMIA_2' }, { name => 'PacketMIA_times' },
|
||||||
}
|
{ name => 'PacketLateArrival_1' }, { name => 'PacketLateArrival_2' }, { name => 'PacketLateArrival_times' },
|
||||||
},
|
{ name => 'PacketOutOfSequence_1' }, { name => 'PacketOutOfSequence_2' }, { name => 'PacketOutOfSequence_times' },
|
||||||
'005_PercentagePacketsPositiveJitter' => { class => 'centreon::plugins::values', obj => undef,
|
{ name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' },
|
||||||
set => {
|
],
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
closure_custom_calc => $self->can('custom_PacketLossRatio_calc'),
|
||||||
{ name => 'NumOfPositivesSD_1' }, { name => 'NumOfPositivesSD_2' }, { name => 'NumOfPositivesSD_times' },
|
closure_custom_output => $self->can('custom_generic_output'),
|
||||||
{ name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' },
|
output_template => 'Packet Loss Ratio : %.2f %%',
|
||||||
],
|
threshold_use => 'value',
|
||||||
closure_custom_calc => \&custom_PercentagePacketsPositiveJitter_calc,
|
perfdatas => [
|
||||||
closure_custom_output => \&custom_generic_output,
|
{ label => 'packet_loss_ratio', value => 'value', template => '%.2f', unit => '%',
|
||||||
output_template => 'Percentage of Packets that had Positive Jitter : %.2f',
|
label_extra_instance => 1, min => 0, max => 100 },
|
||||||
threshold_use => 'value',
|
],
|
||||||
perfdatas => [
|
}
|
||||||
{ label => 'prct_jitter_per_packet_positive_jitter', value => 'value', template => '%.2f',
|
},
|
||||||
label_extra_instance => 1, },
|
{ label => 'PercentagePacketsPositiveJitter', set => {
|
||||||
],
|
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
||||||
}
|
{ name => 'NumOfPositivesSD_1' }, { name => 'NumOfPositivesSD_2' }, { name => 'NumOfPositivesSD_times' },
|
||||||
},
|
{ name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' },
|
||||||
'006_AverageJitterPerPacketPositiveJitter' => { class => 'centreon::plugins::values', obj => undef,
|
],
|
||||||
set => {
|
closure_custom_calc => $self->can('custom_PercentagePacketsPositiveJitter_calc'),
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
closure_custom_output => $self->can('custom_generic_output'),
|
||||||
{ name => 'SumOfPositivesSD_1' }, { name => 'SumOfPositivesSD_2' }, { name => 'SumOfPositivesSD_times' },
|
output_template => 'Percentage of Packets that had Positive Jitter : %.2f',
|
||||||
{ name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' },
|
threshold_use => 'value',
|
||||||
],
|
perfdatas => [
|
||||||
closure_custom_calc => \&custom_AverageJitterPerPacketPositiveJitter_calc,
|
{ label => 'prct_jitter_per_packet_positive_jitter', value => 'value', template => '%.2f',
|
||||||
closure_custom_output => \&custom_generic_output,
|
label_extra_instance => 1, },
|
||||||
output_template => 'Average Jitter per Packet that had Positive Jitter : %.2f',
|
],
|
||||||
threshold_use => 'value',
|
}
|
||||||
perfdatas => [
|
},
|
||||||
{ label => 'average_jitter_per_packet_positive_jitter', value => 'value', template => '%.2f',
|
{ label => 'AverageJitterPerPacketPositiveJitter', set => {
|
||||||
label_extra_instance => 1 },
|
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
||||||
],
|
{ name => 'SumOfPositivesSD_1' }, { name => 'SumOfPositivesSD_2' }, { name => 'SumOfPositivesSD_times' },
|
||||||
}
|
{ name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' },
|
||||||
},
|
],
|
||||||
'007_PercentagePacketsNegativeJitter' => { class => 'centreon::plugins::values', obj => undef,
|
closure_custom_calc => $self->can('custom_AverageJitterPerPacketPositiveJitter_calc'),
|
||||||
set => {
|
closure_custom_output => $self->can('custom_generic_output'),
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
output_template => 'Average Jitter per Packet that had Positive Jitter : %.2f',
|
||||||
{ name => 'NumOfNegativesSD_1' }, { name => 'NumOfNegativesSD_2' }, { name => 'NumOfNegativesSD_times' },
|
threshold_use => 'value',
|
||||||
{ name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' },
|
perfdatas => [
|
||||||
],
|
{ label => 'average_jitter_per_packet_positive_jitter', value => 'value', template => '%.2f',
|
||||||
closure_custom_calc => \&custom_PercentagePacketsNegativeJitter_calc,
|
label_extra_instance => 1 },
|
||||||
closure_custom_output => \&custom_generic_output,
|
],
|
||||||
output_template => 'Percentage of Packets that had Negative Jitter : %.2f',
|
}
|
||||||
threshold_use => 'value',
|
},
|
||||||
perfdatas => [
|
{ label => 'PercentagePacketsNegativeJitter', set => {
|
||||||
{ label => 'prct_jitter_per_packet_negative_jitter', value => 'value', template => '%.2f',
|
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
||||||
label_extra_instance => 1, },
|
{ name => 'NumOfNegativesSD_1' }, { name => 'NumOfNegativesSD_2' }, { name => 'NumOfNegativesSD_times' },
|
||||||
],
|
{ name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' },
|
||||||
}
|
],
|
||||||
},
|
closure_custom_calc => $self->can('custom_PercentagePacketsNegativeJitter_calc'),
|
||||||
'008_AverageJitterPerPacketNegativeJitter' => { class => 'centreon::plugins::values', obj => undef,
|
closure_custom_output => $self->can('custom_generic_output'),
|
||||||
set => {
|
output_template => 'Percentage of Packets that had Negative Jitter : %.2f',
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
threshold_use => 'value',
|
||||||
{ name => 'SumOfNegativesSD_1' }, { name => 'SumOfNegativesSD_2' }, { name => 'SumOfNegativesSD_times' },
|
perfdatas => [
|
||||||
{ name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' },
|
{ label => 'prct_jitter_per_packet_negative_jitter', value => 'value', template => '%.2f',
|
||||||
],
|
label_extra_instance => 1, },
|
||||||
closure_custom_calc => \&custom_AverageJitterPerPacketNegativeJitter_calc,
|
],
|
||||||
closure_custom_output => \&custom_generic_output,
|
}
|
||||||
output_template => 'Average Jitter per Packet that had Negative Jitter : %.2f',
|
},
|
||||||
threshold_use => 'value',
|
{ label => 'AverageJitterPerPacketNegativeJitter', set => {
|
||||||
perfdatas => [
|
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
||||||
{ label => 'average_jitter_per_packet_negative_jitter', value => 'value', template => '%.2f',
|
{ name => 'SumOfNegativesSD_1' }, { name => 'SumOfNegativesSD_2' }, { name => 'SumOfNegativesSD_times' },
|
||||||
label_extra_instance => 1 },
|
{ name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' },
|
||||||
],
|
],
|
||||||
}
|
closure_custom_calc => $self->can('custom_AverageJitterPerPacketNegativeJitter_calc'),
|
||||||
},
|
closure_custom_output => $self->can('custom_generic_output'),
|
||||||
'009_AverageJitter' => { class => 'centreon::plugins::values', obj => undef,
|
output_template => 'Average Jitter per Packet that had Negative Jitter : %.2f',
|
||||||
set => {
|
threshold_use => 'value',
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
perfdatas => [
|
||||||
{ name => 'SumOfPositivesDS_1' }, { name => 'SumOfPositivesDS_2' }, { name => 'SumOfPositivesDS_times' },
|
{ label => 'average_jitter_per_packet_negative_jitter', value => 'value', template => '%.2f',
|
||||||
{ name => 'SumOfNegativesDS_1' }, { name => 'SumOfNegativesDS_2' }, { name => 'SumOfNegativesDS_times' },
|
label_extra_instance => 1 },
|
||||||
{ name => 'SumOfPositivesSD_1' }, { name => 'SumOfPositivesSD_2' }, { name => 'SumOfPositivesSD_times' },
|
],
|
||||||
{ name => 'SumOfNegativesSD_1' }, { name => 'SumOfNegativesSD_2' }, { name => 'SumOfNegativesSD_times' },
|
}
|
||||||
{ name => 'NumOfPositivesDS_1' }, { name => 'NumOfPositivesDS_2' }, { name => 'NumOfPositivesDS_times' },
|
},
|
||||||
{ name => 'NumOfNegativesDS_1' }, { name => 'NumOfNegativesDS_2' }, { name => 'NumOfNegativesDS_times' },
|
{ label => 'AverageJitter', set => {
|
||||||
{ name => 'NumOfPositivesSD_1' }, { name => 'NumOfPositivesSD_2' }, { name => 'NumOfPositivesSD_times' },
|
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
||||||
{ name => 'NumOfNegativesSD_1' }, { name => 'NumOfNegativesSD_2' }, { name => 'NumOfNegativesSD_times' },
|
{ name => 'SumOfPositivesDS_1' }, { name => 'SumOfPositivesDS_2' }, { name => 'SumOfPositivesDS_times' },
|
||||||
],
|
{ name => 'SumOfNegativesDS_1' }, { name => 'SumOfNegativesDS_2' }, { name => 'SumOfNegativesDS_times' },
|
||||||
closure_custom_calc => \&custom_AverageJitter_calc,
|
{ name => 'SumOfPositivesSD_1' }, { name => 'SumOfPositivesSD_2' }, { name => 'SumOfPositivesSD_times' },
|
||||||
closure_custom_output => \&custom_generic_output,
|
{ name => 'SumOfNegativesSD_1' }, { name => 'SumOfNegativesSD_2' }, { name => 'SumOfNegativesSD_times' },
|
||||||
output_template => 'Average Jitter : %.2f ms',
|
{ name => 'NumOfPositivesDS_1' }, { name => 'NumOfPositivesDS_2' }, { name => 'NumOfPositivesDS_times' },
|
||||||
threshold_use => 'value',
|
{ name => 'NumOfNegativesDS_1' }, { name => 'NumOfNegativesDS_2' }, { name => 'NumOfNegativesDS_times' },
|
||||||
perfdatas => [
|
{ name => 'NumOfPositivesSD_1' }, { name => 'NumOfPositivesSD_2' }, { name => 'NumOfPositivesSD_times' },
|
||||||
{ label => 'average_jitter', value => 'value', template => '%.2f', unit => 'ms',
|
{ name => 'NumOfNegativesSD_1' }, { name => 'NumOfNegativesSD_2' }, { name => 'NumOfNegativesSD_times' },
|
||||||
label_extra_instance => 1 },
|
],
|
||||||
],
|
closure_custom_calc => $self->can('custom_AverageJitter_calc'),
|
||||||
}
|
closure_custom_output => $self->can('custom_generic_output'),
|
||||||
},
|
output_template => 'Average Jitter : %.2f ms',
|
||||||
'010_RTTStandardDeviation' => { class => 'centreon::plugins::values', obj => undef,
|
threshold_use => 'value',
|
||||||
set => {
|
perfdatas => [
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
{ label => 'average_jitter', value => 'value', template => '%.2f', unit => 'ms',
|
||||||
{ name => 'RTTSum2High_1' }, { name => 'RTTSum2High_2' }, { name => 'RTTSum2High_times' },
|
label_extra_instance => 1 },
|
||||||
{ name => 'RTTSum2Low_1' }, { name => 'RTTSum2Low_2' }, { name => 'RTTSum2Low_times' },
|
],
|
||||||
{ name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' },
|
}
|
||||||
{ name => 'RTTSum_1' }, { name => 'RTTSum_2' }, { name => 'RTTSum_times' },
|
},
|
||||||
],
|
{ label => 'RTTStandardDeviation', set => {
|
||||||
closure_custom_calc => \&custom_RTTStandardDeviation_calc,
|
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
||||||
closure_custom_output => \&custom_generic_output,
|
{ name => 'RTTSum2High_1' }, { name => 'RTTSum2High_2' }, { name => 'RTTSum2High_times' },
|
||||||
output_template => 'Round-Trip Time Standard Deviation : %.2f ms',
|
{ name => 'RTTSum2Low_1' }, { name => 'RTTSum2Low_2' }, { name => 'RTTSum2Low_times' },
|
||||||
threshold_use => 'value',
|
{ name => 'NumOfRTT_1' }, { name => 'NumOfRTT_2' }, { name => 'NumOfRTT_times' },
|
||||||
perfdatas => [
|
{ name => 'RTTSum_1' }, { name => 'RTTSum_2' }, { name => 'RTTSum_times' },
|
||||||
{ label => 'rtt_standard_deviation', value => 'value', template => '%.2f', unit => 'ms',
|
],
|
||||||
label_extra_instance => 1 },
|
closure_custom_calc => $self->can('custom_RTTStandardDeviation_calc'),
|
||||||
],
|
closure_custom_output => $self->can('custom_generic_output'),
|
||||||
}
|
output_template => 'Round-Trip Time Standard Deviation : %.2f ms',
|
||||||
},
|
threshold_use => 'value',
|
||||||
'011_DelaySource2DestinationStandardDeviation' => { class => 'centreon::plugins::values', obj => undef,
|
perfdatas => [
|
||||||
set => {
|
{ label => 'rtt_standard_deviation', value => 'value', template => '%.2f', unit => 'ms',
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
label_extra_instance => 1 },
|
||||||
{ name => 'OWSum2SDHigh_1' }, { name => 'OWSum2SDHigh_2' }, { name => 'OWSum2SDHigh_times' },
|
],
|
||||||
{ name => 'OWSum2SDLow_1' }, { name => 'OWSum2SDLow_2' }, { name => 'OWSum2SDLow_times' },
|
}
|
||||||
{ name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' },
|
},
|
||||||
{ name => 'OWSumSD_1' }, { name => 'OWSumSD_2' }, { name => 'OWSumSD_times' },
|
{ label => 'DelaySource2DestinationStandardDeviation', set => {
|
||||||
],
|
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
||||||
closure_custom_calc => \&custom_DelaySource2DestinationStandardDeviation_calc,
|
{ name => 'OWSum2SDHigh_1' }, { name => 'OWSum2SDHigh_2' }, { name => 'OWSum2SDHigh_times' },
|
||||||
closure_custom_output => \&custom_generic_output,
|
{ name => 'OWSum2SDLow_1' }, { name => 'OWSum2SDLow_2' }, { name => 'OWSum2SDLow_times' },
|
||||||
output_template => 'One-Way Delay Source to Destination Standard Deviation : %.2f ms',
|
{ name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' },
|
||||||
threshold_use => 'value',
|
{ name => 'OWSumSD_1' }, { name => 'OWSumSD_2' }, { name => 'OWSumSD_times' },
|
||||||
perfdatas => [
|
],
|
||||||
{ label => 'delay_src2dest_stdev', value => 'value', template => '%.2f', unit => 'ms',
|
closure_custom_calc => $self->can('custom_DelaySource2DestinationStandardDeviation_calc'),
|
||||||
label_extra_instance => 1 },
|
closure_custom_output => $self->can('custom_generic_output'),
|
||||||
],
|
output_template => 'One-Way Delay Source to Destination Standard Deviation : %.2f ms',
|
||||||
}
|
threshold_use => 'value',
|
||||||
},
|
perfdatas => [
|
||||||
|
{ label => 'delay_src2dest_stdev', value => 'value', template => '%.2f', unit => 'ms',
|
||||||
'012_DelayDestination2SourceStandardDeviation' => { class => 'centreon::plugins::values', obj => undef,
|
label_extra_instance => 1 },
|
||||||
set => {
|
],
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
}
|
||||||
{ name => 'OWSum2DSHigh_1' }, { name => 'OWSum2DSHigh_2' }, { name => 'OWSum2DSHigh_times' },
|
},
|
||||||
{ name => 'OWSum2DSLow_1' }, { name => 'OWSum2DSLow_2' }, { name => 'OWSum2DSLow_times' },
|
{ label => 'DelayDestination2SourceStandardDeviation', set => {
|
||||||
{ name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' },
|
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
||||||
{ name => 'OWSumDS_1' }, { name => 'OWSumDS_2' }, { name => 'OWSumDS_times' },
|
{ name => 'OWSum2DSHigh_1' }, { name => 'OWSum2DSHigh_2' }, { name => 'OWSum2DSHigh_times' },
|
||||||
],
|
{ name => 'OWSum2DSLow_1' }, { name => 'OWSum2DSLow_2' }, { name => 'OWSum2DSLow_times' },
|
||||||
closure_custom_calc => \&custom_DelayDestination2SourceStandardDeviation_calc,
|
{ name => 'NumOfOW_1' }, { name => 'NumOfOW_2' }, { name => 'NumOfOW_times' },
|
||||||
closure_custom_output => \&custom_generic_output,
|
{ name => 'OWSumDS_1' }, { name => 'OWSumDS_2' }, { name => 'OWSumDS_times' },
|
||||||
output_template => 'One-Way Delay Destination to Source Standard Deviation : %.2f ms',
|
],
|
||||||
threshold_use => 'value',
|
closure_custom_calc => $self->can('custom_DelayDestination2SourceStandardDeviation_calc'),
|
||||||
perfdatas => [
|
closure_custom_output => $self->can('custom_generic_output'),
|
||||||
{ label => 'delay_dest2src_stdev', value => 'value', template => '%.2f', unit => 'ms',
|
output_template => 'One-Way Delay Destination to Source Standard Deviation : %.2f ms',
|
||||||
label_extra_instance => 1 },
|
threshold_use => 'value',
|
||||||
],
|
perfdatas => [
|
||||||
}
|
{ label => 'delay_dest2src_stdev', value => 'value', template => '%.2f', unit => 'ms',
|
||||||
},
|
label_extra_instance => 1 },
|
||||||
'013_JitterSource2DestinationStandardDeviation' => { class => 'centreon::plugins::values', obj => undef,
|
],
|
||||||
set => {
|
}
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
},
|
||||||
{ name => 'Sum2PositivesSDHigh_1' }, { name => 'Sum2PositivesSDHigh_2' }, { name => 'Sum2PositivesSDHigh_times' },
|
{ label => 'JitterSource2DestinationStandardDeviation', set => {
|
||||||
{ name => 'Sum2PositivesSDLow_1' }, { name => 'Sum2PositivesSDLow_2' }, { name => 'Sum2PositivesSDLow_times' },
|
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
||||||
{ name => 'Sum2NegativesSDHigh_1' }, { name => 'Sum2NegativesSDHigh_2' }, { name => 'Sum2NegativesSDHigh_times' },
|
{ name => 'Sum2PositivesSDHigh_1' }, { name => 'Sum2PositivesSDHigh_2' }, { name => 'Sum2PositivesSDHigh_times' },
|
||||||
{ name => 'Sum2NegativesSDLow_1' }, { name => 'Sum2NegativesSDLow_2' }, { name => 'Sum2NegativesSDLow_times' },
|
{ name => 'Sum2PositivesSDLow_1' }, { name => 'Sum2PositivesSDLow_2' }, { name => 'Sum2PositivesSDLow_times' },
|
||||||
{ name => 'SumOfPositivesSD_1' }, { name => 'SumOfPositivesSD_2' }, { name => 'SumOfPositivesSD_times' },
|
{ name => 'Sum2NegativesSDHigh_1' }, { name => 'Sum2NegativesSDHigh_2' }, { name => 'Sum2NegativesSDHigh_times' },
|
||||||
{ name => 'SumOfNegativesSD_1' }, { name => 'SumOfNegativesSD_2' }, { name => 'SumOfNegativesSD_times' },
|
{ name => 'Sum2NegativesSDLow_1' }, { name => 'Sum2NegativesSDLow_2' }, { name => 'Sum2NegativesSDLow_times' },
|
||||||
{ name => 'NumOfPositivesSD_1' }, { name => 'NumOfPositivesSD_2' }, { name => 'NumOfPositivesSD_times' },
|
{ name => 'SumOfPositivesSD_1' }, { name => 'SumOfPositivesSD_2' }, { name => 'SumOfPositivesSD_times' },
|
||||||
{ name => 'NumOfNegativesSD_1' }, { name => 'NumOfNegativesSD_2' }, { name => 'NumOfNegativesSD_times' },
|
{ name => 'SumOfNegativesSD_1' }, { name => 'SumOfNegativesSD_2' }, { name => 'SumOfNegativesSD_times' },
|
||||||
],
|
{ name => 'NumOfPositivesSD_1' }, { name => 'NumOfPositivesSD_2' }, { name => 'NumOfPositivesSD_times' },
|
||||||
closure_custom_calc => \&custom_JitterSource2DestinationStandardDeviation_calc,
|
{ name => 'NumOfNegativesSD_1' }, { name => 'NumOfNegativesSD_2' }, { name => 'NumOfNegativesSD_times' },
|
||||||
closure_custom_output => \&custom_generic_output,
|
],
|
||||||
output_template => 'One-Way Jitter Source to Destination Standard Deviation : %.2f ms',
|
closure_custom_calc => $self->can('custom_JitterSource2DestinationStandardDeviation_calc'),
|
||||||
threshold_use => 'value',
|
closure_custom_output => $self->can('custom_generic_output'),
|
||||||
perfdatas => [
|
output_template => 'One-Way Jitter Source to Destination Standard Deviation : %.2f ms',
|
||||||
{ label => 'jitter_src2dest_stdev', value => 'value', template => '%.2f', unit => 'ms',
|
threshold_use => 'value',
|
||||||
label_extra_instance => 1 },
|
perfdatas => [
|
||||||
],
|
{ label => 'jitter_src2dest_stdev', value => 'value', template => '%.2f', unit => 'ms',
|
||||||
}
|
label_extra_instance => 1 },
|
||||||
},
|
],
|
||||||
'014_JitterDestination2SourceStandardDeviation' => { class => 'centreon::plugins::values', obj => undef,
|
}
|
||||||
set => {
|
},
|
||||||
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
{ label => 'JitterDestination2SourceStandardDeviation', set => {
|
||||||
{ name => 'Sum2PositivesDSHigh_1' }, { name => 'Sum2PositivesDSHigh_2' }, { name => 'Sum2PositivesDSHigh_times' },
|
key_values => [ { name => 'rttMonCtrlAdminStatus' }, { name => 'rttMonCtrlAdminRttType' },
|
||||||
{ name => 'Sum2PositivesDSLow_1' }, { name => 'Sum2PositivesDSLow_2' }, { name => 'Sum2PositivesDSLow_times' },
|
{ name => 'Sum2PositivesDSHigh_1' }, { name => 'Sum2PositivesDSHigh_2' }, { name => 'Sum2PositivesDSHigh_times' },
|
||||||
{ name => 'Sum2NegativesDSHigh_1' }, { name => 'Sum2NegativesDSHigh_2' }, { name => 'Sum2NegativesDSHigh_times' },
|
{ name => 'Sum2PositivesDSLow_1' }, { name => 'Sum2PositivesDSLow_2' }, { name => 'Sum2PositivesDSLow_times' },
|
||||||
{ name => 'Sum2NegativesDSLow_1' }, { name => 'Sum2NegativesDSLow_2' }, { name => 'Sum2NegativesDSLow_times' },
|
{ name => 'Sum2NegativesDSHigh_1' }, { name => 'Sum2NegativesDSHigh_2' }, { name => 'Sum2NegativesDSHigh_times' },
|
||||||
{ name => 'SumOfPositivesDS_1' }, { name => 'SumOfPositivesDS_2' }, { name => 'SumOfPositivesDS_times' },
|
{ name => 'Sum2NegativesDSLow_1' }, { name => 'Sum2NegativesDSLow_2' }, { name => 'Sum2NegativesDSLow_times' },
|
||||||
{ name => 'SumOfNegativesDS_1' }, { name => 'SumOfNegativesDS_2' }, { name => 'SumOfNegativesDS_times' },
|
{ name => 'SumOfPositivesDS_1' }, { name => 'SumOfPositivesDS_2' }, { name => 'SumOfPositivesDS_times' },
|
||||||
{ name => 'NumOfPositivesDS_1' }, { name => 'NumOfPositivesDS_2' }, { name => 'NumOfPositivesDS_times' },
|
{ name => 'SumOfNegativesDS_1' }, { name => 'SumOfNegativesDS_2' }, { name => 'SumOfNegativesDS_times' },
|
||||||
{ name => 'NumOfNegativesDS_1' }, { name => 'NumOfNegativesDS_2' }, { name => 'NumOfNegativesDS_times' },
|
{ name => 'NumOfPositivesDS_1' }, { name => 'NumOfPositivesDS_2' }, { name => 'NumOfPositivesDS_times' },
|
||||||
],
|
{ name => 'NumOfNegativesDS_1' }, { name => 'NumOfNegativesDS_2' }, { name => 'NumOfNegativesDS_times' },
|
||||||
closure_custom_calc => \&custom_JitterDestination2SourceStandardDeviation_calc,
|
],
|
||||||
closure_custom_output => \&custom_generic_output,
|
closure_custom_calc => $self->can('custom_JitterDestination2SourceStandardDeviation_calc'),
|
||||||
output_template => 'One-Way Jitter Destination to Source Standard Deviation : %.2f ms',
|
closure_custom_output => $self->can('custom_generic_output'),
|
||||||
threshold_use => 'value',
|
output_template => 'One-Way Jitter Destination to Source Standard Deviation : %.2f ms',
|
||||||
perfdatas => [
|
threshold_use => 'value',
|
||||||
{ label => 'jitter_dest2src_stdev', value => 'value', template => '%.2f', unit => 'ms',
|
perfdatas => [
|
||||||
label_extra_instance => 1 },
|
{ label => 'jitter_dest2src_stdev', value => 'value', template => '%.2f', unit => 'ms',
|
||||||
],
|
label_extra_instance => 1 },
|
||||||
}
|
],
|
||||||
},
|
}
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
sub prefix_tag_output {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
return "RTT '" . $options{instance_value}->{rttMonCtrlAdminTag} . "' ";
|
||||||
|
}
|
||||||
|
|
||||||
my $ipsla;
|
my $ipsla;
|
||||||
my $thresholds = {
|
my $thresholds = {
|
||||||
|
@ -348,18 +354,6 @@ sub check_buffer_creation {
|
||||||
|
|
||||||
###### STATUS ######
|
###### STATUS ######
|
||||||
|
|
||||||
sub custom_status_perfdata {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
|
|
||||||
my $extra_label = '';
|
|
||||||
if (!defined($options{extra_instance}) || $options{extra_instance} != 0) {
|
|
||||||
$extra_label .= '_' . $self->{result_values}->{rttMonCtrlAdminTag};
|
|
||||||
}
|
|
||||||
$self->{output}->perfdata_add(label => 'completion_time' . $extra_label, unit => $self->{result_values}->{rttMonEchoAdminPrecision},
|
|
||||||
value => $self->{result_values}->{rttMonLatestRttOperCompletionTime},
|
|
||||||
min => 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub custom_status_threshold {
|
sub custom_status_threshold {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
my $status = 'ok';
|
my $status = 'ok';
|
||||||
|
@ -803,42 +797,23 @@ my $mapping3 = {
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1);
|
||||||
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-tag:s" => { name => 'filter_tag', default => '.*' },
|
"filter-tag:s" => { name => 'filter_tag', default => '.*' },
|
||||||
"threshold-overload:s@" => { name => 'threshold_overload' },
|
"threshold-overload:s@" => { name => 'threshold_overload' },
|
||||||
});
|
});
|
||||||
|
|
||||||
$self->{statefile_value} = centreon::plugins::statefile->new(%options);
|
|
||||||
foreach (keys %{$maps_counters}) {
|
|
||||||
my ($id, $name) = split /_/;
|
|
||||||
if (!defined($maps_counters->{$_}->{threshold}) || $maps_counters->{$_}->{threshold} != 0) {
|
|
||||||
$options{options}->add_options(arguments => {
|
|
||||||
'warning-' . $name . ':s' => { name => 'warning-' . $name },
|
|
||||||
'critical-' . $name . ':s' => { name => 'critical-' . $name },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
my $class = $maps_counters->{$_}->{class};
|
|
||||||
$maps_counters->{$_}->{obj} = $class->new(statefile => $self->{statefile_value},
|
|
||||||
output => $self->{output}, perfdata => $self->{perfdata},
|
|
||||||
label => $name);
|
|
||||||
$maps_counters->{$_}->{obj}->set(%{$maps_counters->{$_}->{set}});
|
|
||||||
}
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::check_options(%options);
|
||||||
|
|
||||||
foreach (keys %{$maps_counters}) {
|
|
||||||
next if (defined($maps_counters->{$_}->{threshold}) && $maps_counters->{$_}->{threshold} == 0);
|
|
||||||
$maps_counters->{$_}->{obj}->init(option_results => $self->{option_results});
|
|
||||||
}
|
|
||||||
$self->{overload_th} = {};
|
$self->{overload_th} = {};
|
||||||
foreach my $val (@{$self->{option_results}->{threshold_overload}}) {
|
foreach my $val (@{$self->{option_results}->{threshold_overload}}) {
|
||||||
if ($val !~ /^(.*?),(.*?),(.*)$/) {
|
if ($val !~ /^(.*?),(.*?),(.*)$/) {
|
||||||
|
@ -854,103 +829,35 @@ sub check_options {
|
||||||
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{statefile_value}->check_options(%options);
|
|
||||||
# to be used on custom function
|
# to be used on custom function
|
||||||
$ipsla = $self;
|
$ipsla = $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub run {
|
|
||||||
my ($self, %options) = @_;
|
|
||||||
# $options{snmp} = snmp object
|
|
||||||
$self->{snmp} = $options{snmp};
|
|
||||||
$self->{hostname} = $self->{snmp}->get_hostname();
|
|
||||||
$self->{snmp_port} = $self->{snmp}->get_port();
|
|
||||||
|
|
||||||
$self->manage_selection();
|
|
||||||
|
|
||||||
$self->{new_datas} = {};
|
|
||||||
$self->{statefile_value}->read(statefile => "cache_cisco_" . $self->{hostname} . '_' . $self->{snmp_port} . '_' . $self->{mode} . '_' .
|
|
||||||
(defined($self->{option_results}->{filter_tag}) ? md5_hex($self->{option_results}->{filter_tag}) : md5_hex('all')));
|
|
||||||
$self->{new_datas}->{last_timestamp} = time();
|
|
||||||
|
|
||||||
my $multiple = 1;
|
|
||||||
if (scalar(keys %{$self->{datas}}) == 1) {
|
|
||||||
$multiple = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($multiple == 1) {
|
|
||||||
$self->{output}->output_add(severity => 'OK',
|
|
||||||
short_msg => 'All RTT controls are ok');
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach my $id (sort keys %{$self->{datas}}) {
|
|
||||||
my ($short_msg, $short_msg_append, $long_msg, $long_msg_append) = ('', '', '', '');
|
|
||||||
my @exits;
|
|
||||||
foreach (sort keys %{$maps_counters}) {
|
|
||||||
$maps_counters->{$_}->{obj}->set(instance => $id);
|
|
||||||
|
|
||||||
my ($value_check) = $maps_counters->{$_}->{obj}->execute(values => $self->{datas}->{$id},
|
|
||||||
new_datas => $self->{new_datas});
|
|
||||||
next if ($value_check == -2);
|
|
||||||
if ($value_check != 0) {
|
|
||||||
$long_msg .= $long_msg_append . $maps_counters->{$_}->{obj}->output_error();
|
|
||||||
$long_msg_append = ', ';
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
my $exit2 = $maps_counters->{$_}->{obj}->threshold_check();
|
|
||||||
push @exits, $exit2;
|
|
||||||
|
|
||||||
my $output = $maps_counters->{$_}->{obj}->output();
|
|
||||||
$long_msg .= $long_msg_append . $output;
|
|
||||||
$long_msg_append = ', ';
|
|
||||||
|
|
||||||
if (!$self->{output}->is_status(litteral => 1, value => $exit2, compare => 'ok')) {
|
|
||||||
$short_msg .= $short_msg_append . $output;
|
|
||||||
$short_msg_append = ', ';
|
|
||||||
}
|
|
||||||
|
|
||||||
$maps_counters->{$_}->{obj}->perfdata(extra_instance => $multiple);
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => "RTT '" . $self->{datas}->{$id}->{rttMonCtrlAdminTag} . "' $long_msg");
|
|
||||||
my $exit = $self->{output}->get_most_critical(status => [ @exits ]);
|
|
||||||
if (!$self->{output}->is_status(litteral => 1, value => $exit, compare => 'ok')) {
|
|
||||||
$self->{output}->output_add(severity => $exit,
|
|
||||||
short_msg => "RTT '" . $self->{datas}->{$id}->{rttMonCtrlAdminTag} . "' $short_msg"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($multiple == 0) {
|
|
||||||
$self->{output}->output_add(short_msg => "RTT '" . $self->{datas}->{$id}->{rttMonCtrlAdminTag} . "' $long_msg");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->{statefile_value}->write(data => $self->{new_datas});
|
|
||||||
$self->{output}->display();
|
|
||||||
$self->{output}->exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{results} = $self->{snmp}->get_multiple_table(oids => [ { oid => $oid_rttMonCtrlAdminEntry },
|
$self->{cache_name} = "cache_cisco_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' .
|
||||||
|
(defined($self->{option_results}->{filter_tag}) ? md5_hex($self->{option_results}->{filter_tag}) : md5_hex('all')) . '_' .
|
||||||
|
(defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all'));
|
||||||
|
|
||||||
|
$self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_rttMonCtrlAdminEntry },
|
||||||
{ oid => $oid_rttMonEchoAdminPrecision },
|
{ oid => $oid_rttMonEchoAdminPrecision },
|
||||||
{ oid => $oid_rttMonLatestRttOperEntry },
|
{ oid => $oid_rttMonLatestRttOperEntry },
|
||||||
{ oid => $oid_rttMonJitterStatsEntry },
|
{ oid => $oid_rttMonJitterStatsEntry },
|
||||||
],
|
],
|
||||||
nothing_quit => 1);
|
nothing_quit => 1);
|
||||||
|
|
||||||
$self->{datas} = {};
|
$self->{tag} = {};
|
||||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rttMonCtrlAdminEntry}})) {
|
foreach my $oid ($options{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rttMonCtrlAdminEntry}})) {
|
||||||
next if ($oid !~ /^$mapping->{rttMonCtrlAdminTag}->{oid}\.(.*)$/);
|
next if ($oid !~ /^$mapping->{rttMonCtrlAdminTag}->{oid}\.(.*)$/);
|
||||||
my $instance = $1;
|
my $instance = $1;
|
||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rttMonCtrlAdminEntry}, instance => $instance);
|
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_rttMonCtrlAdminEntry}, instance => $instance);
|
||||||
my $tag_name = $result->{rttMonCtrlAdminTag};
|
my $tag_name = $result->{rttMonCtrlAdminTag};
|
||||||
if (!defined($tag_name) || $tag_name eq '') {
|
if (!defined($tag_name) || $tag_name eq '') {
|
||||||
$self->{output}->output_add(long_msg => "skipping: please set a tag name");
|
$self->{output}->output_add(long_msg => "skipping: please set a tag name");
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if (defined($self->{datas}->{$tag_name})) {
|
if (defined($self->{tag}->{$tag_name})) {
|
||||||
$self->{output}->output_add(long_msg => "skipping '" . $tag_name . "': duplicate (please change the tag name).");
|
$self->{output}->output_add(long_msg => "skipping '" . $tag_name . "': duplicate (please change the tag name).");
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
@ -959,29 +866,29 @@ sub manage_selection {
|
||||||
$self->{output}->output_add(long_msg => "skipping '" . $tag_name . "': no matching filter.");
|
$self->{output}->output_add(long_msg => "skipping '" . $tag_name . "': no matching filter.");
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
$self->{datas}->{$tag_name} = { %{$result} };
|
$self->{tag}->{$tag_name} = { %{$result} };
|
||||||
$result = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_rttMonEchoAdminPrecision}, instance => $instance);
|
$result = $options{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$oid_rttMonEchoAdminPrecision}, instance => $instance);
|
||||||
$self->{datas}->{$tag_name} = { %{$result}, %{$self->{datas}->{$tag_name}} };
|
$self->{tag}->{$tag_name} = { %{$result}, %{$self->{tag}->{$tag_name}} };
|
||||||
$result = $self->{snmp}->map_instance(mapping => $mapping3, results => $self->{results}->{$oid_rttMonLatestRttOperEntry}, instance => $instance);
|
$result = $options{snmp}->map_instance(mapping => $mapping3, results => $self->{results}->{$oid_rttMonLatestRttOperEntry}, instance => $instance);
|
||||||
$self->{datas}->{$tag_name} = { %{$result}, %{$self->{datas}->{$tag_name}} };
|
$self->{tag}->{$tag_name} = { %{$result}, %{$self->{tag}->{$tag_name}} };
|
||||||
|
|
||||||
# there are two entries with rotation: 1 -> last hour, 2 -> current hour.
|
# there are two entries with rotation: 1 -> last hour, 2 -> current hour.
|
||||||
foreach my $key (keys %{$oids_jitter_stats}) {
|
foreach my $key (keys %{$oids_jitter_stats}) {
|
||||||
$self->{datas}->{$tag_name}->{$key . '_1'} = 0;
|
$self->{tag}->{$tag_name}->{$key . '_1'} = 0;
|
||||||
$self->{datas}->{$tag_name}->{$key . '_2'} = 0;
|
$self->{tag}->{$tag_name}->{$key . '_2'} = 0;
|
||||||
my $i = 1;
|
my $i = 1;
|
||||||
my $instances = [];
|
my $instances = [];
|
||||||
foreach my $oid2 ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rttMonJitterStatsEntry}})) {
|
foreach my $oid2 ($options{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_rttMonJitterStatsEntry}})) {
|
||||||
next if ($oid2 !~ /^$oids_jitter_stats->{$key}\.$instance.(\d+)/);
|
next if ($oid2 !~ /^$oids_jitter_stats->{$key}\.$instance.(\d+)/);
|
||||||
push @{$instances}, $1;
|
push @{$instances}, $1;
|
||||||
$self->{datas}->{$tag_name}->{$key . '_' . $i} = $self->{results}->{$oid_rttMonJitterStatsEntry}->{$oid2};
|
$self->{tag}->{$tag_name}->{$key . '_' . $i} = $self->{results}->{$oid_rttMonJitterStatsEntry}->{$oid2};
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$self->{datas}->{$tag_name}->{$key . '_times'} = join('_', @{$instances});
|
$self->{tag}->{$tag_name}->{$key . '_times'} = join('_', @{$instances});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scalar(keys %{$self->{datas}}) <= 0) {
|
if (scalar(keys %{$self->{tag}}) <= 0) {
|
||||||
$self->{output}->add_option_msg(short_msg => "No entry found.");
|
$self->{output}->add_option_msg(short_msg => "No entry found.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
@ -1032,7 +939,7 @@ Example: --threshold-overload='opersense,CRITICAL,^(?!(ok)$)'
|
||||||
=item B<--warning-*>
|
=item B<--warning-*>
|
||||||
|
|
||||||
Threshold warning.
|
Threshold warning.
|
||||||
Can be: 'NumberOverThresholds', 'AverageDelaySD', 'AverageDelayDS', 'PacketLossRatio',
|
Can be: 'CompletionTime', 'NumberOverThresholds', 'AverageDelaySD', 'AverageDelayDS', 'PacketLossRatio',
|
||||||
'PercentagePacketsPositiveJitter', 'AverageJitterPerPacketPositiveJitter', 'PercentagePacketsNegativeJitter', 'AverageJitterPerPacketNegativeJitter',
|
'PercentagePacketsPositiveJitter', 'AverageJitterPerPacketPositiveJitter', 'PercentagePacketsNegativeJitter', 'AverageJitterPerPacketNegativeJitter',
|
||||||
'AverageJitter', 'RTTStandardDeviation', 'DelaySource2DestinationStandardDeviation', 'DelayDestination2SourceStandardDeviation',
|
'AverageJitter', 'RTTStandardDeviation', 'DelaySource2DestinationStandardDeviation', 'DelayDestination2SourceStandardDeviation',
|
||||||
'JitterSource2DestinationStandardDeviation', 'JitterDestination2SourceStandardDeviation'.
|
'JitterSource2DestinationStandardDeviation', 'JitterDestination2SourceStandardDeviation'.
|
||||||
|
@ -1040,7 +947,7 @@ Can be: 'NumberOverThresholds', 'AverageDelaySD', 'AverageDelayDS', 'PacketLossR
|
||||||
=item B<--critical-*>
|
=item B<--critical-*>
|
||||||
|
|
||||||
Threshold critical.
|
Threshold critical.
|
||||||
Can be: 'NumberOverThresholds', 'AverageDelaySD', 'AverageDelayDS', 'PacketLossRatio',
|
Can be: 'CompletionTime', 'NumberOverThresholds', 'AverageDelaySD', 'AverageDelayDS', 'PacketLossRatio',
|
||||||
'PercentagePacketsPositiveJitter', 'AverageJitterPerPacketPositiveJitter', 'PercentagePacketsNegativeJitter', 'AverageJitterPerPacketNegativeJitter',
|
'PercentagePacketsPositiveJitter', 'AverageJitterPerPacketPositiveJitter', 'PercentagePacketsNegativeJitter', 'AverageJitterPerPacketNegativeJitter',
|
||||||
'AverageJitter', 'RTTStandardDeviation', 'DelaySource2DestinationStandardDeviation', 'DelayDestination2SourceStandardDeviation',
|
'AverageJitter', 'RTTStandardDeviation', 'DelaySource2DestinationStandardDeviation', 'DelayDestination2SourceStandardDeviation',
|
||||||
'JitterSource2DestinationStandardDeviation', 'JitterDestination2SourceStandardDeviation'.
|
'JitterSource2DestinationStandardDeviation', 'JitterDestination2SourceStandardDeviation'.
|
||||||
|
|
|
@ -82,12 +82,12 @@ sub check_options {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub error {
|
sub error {
|
||||||
my ($self) = shift;
|
my ($self) = shift;
|
||||||
|
|
||||||
if (@_) {
|
if (@_) {
|
||||||
$self->{error} = $_[0];
|
$self->{error} = $_[0];
|
||||||
}
|
}
|
||||||
return $self->{error};
|
return $self->{error};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub read {
|
sub read {
|
||||||
|
|
|
@ -116,7 +116,7 @@ sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
foreach my $key (keys %{$self->{maps_counters}}) {
|
foreach my $key (keys %{$self->{maps_counters}}) {
|
||||||
foreach (@{$self->{maps_counters}->{$key}}) {
|
foreach (@{$self->{maps_counters}->{$key}}) {
|
||||||
$_->{obj}->init(option_results => $self->{option_results});
|
$_->{obj}->init(option_results => $self->{option_results});
|
||||||
}
|
}
|
||||||
|
@ -146,6 +146,7 @@ sub run_global {
|
||||||
|
|
||||||
my ($value_check) = $obj->execute(new_datas => $self->{new_datas}, values => $self->{$options{config}->{name}});
|
my ($value_check) = $obj->execute(new_datas => $self->{new_datas}, values => $self->{$options{config}->{name}});
|
||||||
|
|
||||||
|
next if (defined($options{config}->{skipped_code}) && defined($options{config}->{skipped_code}->{$value_check}));
|
||||||
if ($value_check != 0) {
|
if ($value_check != 0) {
|
||||||
$long_msg .= $long_msg_append . $obj->output_error();
|
$long_msg .= $long_msg_append . $obj->output_error();
|
||||||
$long_msg_append = $message_separator;
|
$long_msg_append = $message_separator;
|
||||||
|
@ -215,7 +216,7 @@ sub run_instances {
|
||||||
|
|
||||||
my ($value_check) = $obj->execute(new_datas => $self->{new_datas},
|
my ($value_check) = $obj->execute(new_datas => $self->{new_datas},
|
||||||
values => $self->{$options{config}->{name}}->{$id});
|
values => $self->{$options{config}->{name}}->{$id});
|
||||||
|
next if (defined($options{config}->{skipped_code}) && defined($options{config}->{skipped_code}->{$value_check}));
|
||||||
if ($value_check != 0) {
|
if ($value_check != 0) {
|
||||||
$long_msg .= $long_msg_append . $obj->output_error();
|
$long_msg .= $long_msg_append . $obj->output_error();
|
||||||
$long_msg_append = $message_separator;
|
$long_msg_append = $message_separator;
|
||||||
|
|
|
@ -2097,7 +2097,7 @@ The model can also be used to check strings (not only counters). So we want to c
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::check_options(%options);
|
||||||
|
|
||||||
# Sometimes, you'll need to have access of the current object in the callback
|
# Sometimes, you'll need to have access of the current object in the callback
|
||||||
$instance_mode = $self;
|
$instance_mode = $self;
|
||||||
|
|
|
@ -151,7 +151,7 @@ sub new {
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::check_options(%options);
|
||||||
|
|
||||||
$instance_mode = $self;
|
$instance_mode = $self;
|
||||||
$self->change_macros();
|
$self->change_macros();
|
||||||
|
|
|
@ -92,7 +92,7 @@ sub new {
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::check_options(%options);
|
||||||
|
|
||||||
$instance_mode = $self;
|
$instance_mode = $self;
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ sub new {
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::check_options(%options);
|
||||||
|
|
||||||
$instance_mode = $self;
|
$instance_mode = $self;
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ sub new {
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::check_options(%options);
|
||||||
|
|
||||||
$instance_mode = $self;
|
$instance_mode = $self;
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ sub new {
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::check_options(%options);
|
||||||
|
|
||||||
$instance_mode = $self;
|
$instance_mode = $self;
|
||||||
$self->change_macros();
|
$self->change_macros();
|
||||||
|
|
|
@ -118,7 +118,7 @@ sub new {
|
||||||
|
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::check_options(%options);
|
||||||
|
|
||||||
$instance_mode = $self;
|
$instance_mode = $self;
|
||||||
$self->change_macros();
|
$self->change_macros();
|
||||||
|
|
Loading…
Reference in New Issue