refactor riverbed steelhead, add riverbed interceptor

This commit is contained in:
Colin Gagnaire 2019-03-15 10:00:13 +01:00
parent 56d2d1f433
commit 68ed1a9fed
16 changed files with 1043 additions and 741 deletions

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::riverbed::steelhead::snmp::mode::bwoptimization;
package centreon::common::riverbed::steelhead::snmp::mode::bwoptimization;
use base qw(centreon::plugins::templates::counter);
@ -37,7 +37,7 @@ sub set_counters {
{ label => 'wan2lan-lan', set => {
key_values => [ { name => 'bwHCAggInLan', diff => 1 } ],
output_template => 'Wan2Lan on Lan: %s %s/s',
output_change_bytes => 1,
output_change_bytes => 1, per_second => 1,
perfdatas => [
{ label => 'wan2lan_lan', value => 'bwHCAggInLan_absolute',
template => '%s', min => 0, unit => 'B/s' },
@ -47,7 +47,7 @@ sub set_counters {
{ label => 'wan2lan-wan', set => {
key_values => [ { name => 'bwHCAggInWan', diff => 1 } ],
output_template => 'Wan2Lan on Wan: %s %s/s',
output_change_bytes => 1,
output_change_bytes => 1, per_second => 1,
perfdatas => [
{ label => 'wan2lan_wan', value => 'bwHCAggInWan_absolute',
template => '%s', min => 0, unit => 'B/s' },
@ -57,7 +57,7 @@ sub set_counters {
{ label => 'lan2wan-lan', set => {
key_values => [ { name => 'bwHCAggOutLan', diff => 1 } ],
output_template => 'Lan2Wan on Lan: %s %s/s',
output_change_bytes => 1,
output_change_bytes => 1, per_second => 1,
perfdatas => [
{ label => 'lan2wan_lan', value => 'bwHCAggOutLan_absolute',
template => '%s', min => 0, unit => 'B/s' },
@ -67,7 +67,7 @@ sub set_counters {
{ label => 'lan2wan-wan', set => {
key_values => [ { name => 'bwHCAggOutWan', diff => 1 } ],
output_template => 'Lan2Wan on Wan: %s %s/s',
output_change_bytes => 1,
output_change_bytes => 1, per_second => 1,
perfdatas => [
{ label => 'lan2wan_wan', value => 'bwHCAggOutWan_absolute',
template => '%s', min => 0, unit => 'B/s' },
@ -80,7 +80,7 @@ sub set_counters {
sub prefix_output {
my ($self, %options) = @_;
return "Optimized: ";
return "Optimized ";
}
sub new {
@ -96,41 +96,51 @@ sub new {
return $self;
}
my $mappings = {
common => {
bwHCAggInLan => { oid => '.1.3.6.1.4.1.17163.1.1.5.6.1.1' },
bwHCAggInWan => { oid => '.1.3.6.1.4.1.17163.1.1.5.6.1.2' },
bwHCAggOutLan => { oid => '.1.3.6.1.4.1.17163.1.1.5.6.1.3' },
bwHCAggOutWan => { oid => '.1.3.6.1.4.1.17163.1.1.5.6.1.4' },
},
ex => {
bwHCAggInLan => { oid => '.1.3.6.1.4.1.17163.1.51.5.6.1.1' },
bwHCAggInWan => { oid => '.1.3.6.1.4.1.17163.1.51.5.6.1.2' },
bwHCAggOutLan => { oid => '.1.3.6.1.4.1.17163.1.51.5.6.1.3' },
bwHCAggOutWan => { oid => '.1.3.6.1.4.1.17163.1.51.5.6.1.4' },
},
};
my $oids = {
common => '.1.3.6.1.4.1.17163.1.1.5.6.1',
ex => '.1.3.6.1.4.1.17163.1.51.5.6.1',
};
sub manage_selection {
my ($self, %options) = @_;
# STEELHEAD-MIB
my $oids = {
bwHCAggInLan => '.1.3.6.1.4.1.17163.1.1.5.6.1.1.0',
bwHCAggInWan => '.1.3.6.1.4.1.17163.1.1.5.6.1.2.0',
bwHCAggOutLan => '.1.3.6.1.4.1.17163.1.1.5.6.1.3.0',
bwHCAggOutWan => '.1.3.6.1.4.1.17163.1.1.5.6.1.4.0',
};
my $results = $options{snmp}->get_multiple_table(
oids => [
{ oid => $oids->{common},
start => $mappings->{common}->{bwHCAggInLan}->{oid},
end => $mappings->{common}->{bwHCAggOutWan}->{oid} },
{ oid => $oids->{ex},
start => $mappings->{ex}->{bwHCAggInLan}->{oid},
end => $mappings->{ex}->{bwHCAggOutWan}->{oid} }
]
);
# STEELHEAD-EX-MIB
my $oids_ex = {
bwHCAggInLan => '.1.3.6.1.4.1.17163.1.51.5.6.1.1.0',
bwHCAggInWan => '.1.3.6.1.4.1.17163.1.51.5.6.1.2.0',
bwHCAggOutLan => '.1.3.6.1.4.1.17163.1.51.5.6.1.3.0',
bwHCAggOutWan => '.1.3.6.1.4.1.17163.1.51.5.6.1.4.0',
};
foreach my $equipment (keys %{$oids}) {
next if (!%{$results->{$oids->{$equipment}}});
my $result = $options{snmp}->get_leef(oids => [ values %{$oids}, values %{$oids_ex} ], nothing_quit => 1);
my $result = $options{snmp}->map_instance(mapping => $mappings->{$equipment},
results => $results->{$oids->{$equipment}}, instance => 0);
$self->{cache_name} = "riverbed_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() .
'_' . $self->{mode} . '_' . md5_hex('all');
$self->{global} = {};
if (defined($result->{$oids->{bwHCAggInLan}})) {
foreach (keys %{$oids}) {
$self->{global}->{$_} = $result->{$oids->{$_}};
}
} else {
foreach (keys %{$oids_ex}) {
$self->{global}->{$_} = $result->{$oids_ex->{$_}};
}
$self->{global} = { %$result };
}
$self->{cache_name} = "riverbed_steelhead_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() .
'_' . $self->{mode} . '_' . md5_hex('all');
}
1;

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::riverbed::steelhead::snmp::mode::bwpassthrough;
package centreon::common::riverbed::steelhead::snmp::mode::bwpassthrough;
use base qw(centreon::plugins::templates::counter);
@ -37,20 +37,20 @@ sub set_counters {
{ label => 'traffic-in', set => {
key_values => [ { name => 'bwPassThroughIn', diff => 1 } ],
output_template => 'Traffic In (Wan2Lan): %s %s/s',
output_change_bytes => 1,
output_change_bytes => 1, per_second => 1,
perfdatas => [
{ label => 'traffic_in', value => 'bwPassThroughIn_absolute',
template => '%s', min => 0, unit => 'B/s' },
template => '%s', min => 0, unit => 'B/s' },
],
}
},
{ label => 'traffic-out', set => {
key_values => [ { name => 'bwPassThroughOut', diff => 1 } ],
output_template => 'Traffic Out (Lan2Wan): %s %s/s',
output_change_bytes => 1,
output_change_bytes => 1, per_second => 1,
perfdatas => [
{ label => 'traffic_out', value => 'bwPassThroughOut_absolute',
template => '%s', min => 0, unit => 'B/s' },
template => '%s', min => 0, unit => 'B/s' },
],
}
},
@ -60,18 +60,33 @@ sub set_counters {
sub prefix_output {
my ($self, %options) = @_;
return "Passthrough: ";
return "Passthrough ";
}
my $mappings = {
common => {
bwPassThroughIn => { oid => '.1.3.6.1.4.1.17163.1.1.5.3.3.1' },
bwPassThroughOut => { oid => '.1.3.6.1.4.1.17163.1.1.5.3.3.2' },
},
ex => {
bwPassThroughIn => { oid => '.1.3.6.1.4.1.17163.1.51.5.3.3.1' },
bwPassThroughOut => { oid => '.1.3.6.1.4.1.17163.1.51.5.3.3.2' },
},
};
my $oids = {
common => '.1.3.6.1.4.1.17163.1.1.5.3.3',
ex => '.1.3.6.1.4.1.17163.1.51.5.3.3',
};
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1);
bless $self, $class;
$self->{version} = '0.1';
$options{options}->add_options(arguments =>
{
});
$options{options}->add_options(arguments => {
});
return $self;
}
@ -79,34 +94,28 @@ sub new {
sub manage_selection {
my ($self, %options) = @_;
# STEELHEAD-MIB
my $oids = {
bwPassThroughIn => '.1.3.6.1.4.1.17163.1.1.5.3.3.1.0',
bwPassThroughOut => '.1.3.6.1.4.1.17163.1.1.5.3.3.2.0',
};
my $results = $options{snmp}->get_multiple_table(
oids => [
{ oid => $oids->{common},
start => $mappings->{common}->{bwPassThroughIn}->{oid},
end => $mappings->{common}->{bwPassThroughOut}->{oid} },
{ oid => $oids->{ex},
start => $mappings->{ex}->{bwPassThroughIn}->{oid},
end => $mappings->{ex}->{bwPassThroughOut}->{oid} }
]
);
# STEELHEAD-EX-MIB
my $oids_ex = {
bwPassThroughIn => '.1.3.6.1.4.1.17163.1.51.5.3.3.1.0',
bwPassThroughOut => '.1.3.6.1.4.1.17163.1.51.5.3.3.2.0',
};
foreach my $equipment (keys %{$oids}) {
next if (!%{$results->{$oids->{$equipment}}});
my $result = $options{snmp}->get_leef(oids => [ values %{$oids}, values %{$oids_ex} ], nothing_quit => 1);
my $result = $options{snmp}->map_instance(mapping => $mappings->{$equipment},
results => $results->{$oids->{$equipment}}, instance => 0);
$self->{cache_name} = "riverbed_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() .
'_' . $self->{mode} . '_' . md5_hex('all');
$self->{global} = {};
if (defined($result->{$oids->{bwPassThroughIn}})) {
foreach (keys %{$oids}) {
$self->{global}->{$_} = $result->{$oids->{$_}};
}
} else {
foreach (keys %{$oids_ex}) {
$self->{global}->{$_} = $result->{$oids_ex->{$_}};
}
$self->{global} = { %$result };
}
$self->{cache_name} = "riverbed_steelhead_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() .
'_' . $self->{mode} . '_' . md5_hex('all');
}
1;

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::riverbed::steelhead::snmp::mode::connections;
package centreon::common::riverbed::steelhead::snmp::mode::connections;
use base qw(centreon::plugins::templates::counter);
@ -104,49 +104,58 @@ sub new {
bless $self, $class;
$self->{version} = '0.1';
$options{options}->add_options(arguments =>
{
});
$options{options}->add_options(arguments => {
});
return $self;
}
my $mappings = {
common => {
optimizedConnections => { oid => '.1.3.6.1.4.1.17163.1.1.5.2.1' },
passthroughConnections => { oid => '.1.3.6.1.4.1.17163.1.1.5.2.2' },
halfOpenedConnections => { oid => '.1.3.6.1.4.1.17163.1.1.5.2.3' },
halfClosedConnections => { oid => '.1.3.6.1.4.1.17163.1.1.5.2.4' },
establishedConnections => { oid => '.1.3.6.1.4.1.17163.1.1.5.2.5' },
activeConnections => { oid => '.1.3.6.1.4.1.17163.1.1.5.2.6' },
totalConnections => { oid => '.1.3.6.1.4.1.17163.1.1.5.2.7' },
},
ex => {
optimizedConnections => { oid => '.1.3.6.1.4.1.17163.1.51.5.2.1' },
passthroughConnections => { oid => '.1.3.6.1.4.1.17163.1.51.5.2.2' },
halfOpenedConnections => { oid => '.1.3.6.1.4.1.17163.1.51.5.2.3' },
halfClosedConnections => { oid => '.1.3.6.1.4.1.17163.1.51.5.2.4' },
establishedConnections => { oid => '.1.3.6.1.4.1.17163.1.51.5.2.5' },
activeConnections => { oid => '.1.3.6.1.4.1.17163.1.51.5.2.6' },
totalConnections => { oid => '.1.3.6.1.4.1.17163.1.51.5.2.7' },
},
};
my $oids = {
common => '.1.3.6.1.4.1.17163.1.1.5.2',
ex => '.1.3.6.1.4.1.17163.1.51.5.2',
};
sub manage_selection {
my ($self, %options) = @_;
# STEELHEAD-MIB
my $oids = {
optimizedConnections => '.1.3.6.1.4.1.17163.1.1.5.2.1.0',
passthroughConnections => '.1.3.6.1.4.1.17163.1.1.5.2.2.0',
halfOpenedConnections => '.1.3.6.1.4.1.17163.1.1.5.2.3.0',
halfClosedConnections => '.1.3.6.1.4.1.17163.1.1.5.2.4.0',
establishedConnections => '.1.3.6.1.4.1.17163.1.1.5.2.5.0',
activeConnections => '.1.3.6.1.4.1.17163.1.1.5.2.6.0',
totalConnections => '.1.3.6.1.4.1.17163.1.1.5.2.7.0',
};
my $results = $options{snmp}->get_multiple_table(
oids => [
{ oid => $oids->{common},
start => $mappings->{common}->{optimizedConnections}->{oid},
end => $mappings->{common}->{totalConnections}->{oid} },
{ oid => $oids->{ex},
start => $mappings->{ex}->{optimizedConnections}->{oid},
end => $mappings->{ex}->{totalConnections}->{oid} }
]
);
# STEELHEAD-EX-MIB
my $oids_ex = {
optimizedConnections => '.1.3.6.1.4.1.17163.1.51.5.2.1.0',
passthroughConnections => '.1.3.6.1.4.1.17163.1.51.5.2.2.0',
halfOpenedConnections => '.1.3.6.1.4.1.17163.1.51.5.2.3.0',
halfClosedConnections => '.1.3.6.1.4.1.17163.1.51.5.2.4.0',
establishedConnections => '.1.3.6.1.4.1.17163.1.51.5.2.5.0',
activeConnections => '.1.3.6.1.4.1.17163.1.51.5.2.6.0',
totalConnections => '.1.3.6.1.4.1.17163.1.51.5.2.7.0',
};
foreach my $equipment (keys %{$oids}) {
next if (!%{$results->{$oids->{$equipment}}});
my $snmp_result = $options{snmp}->get_leef(oids => [ values %{$oids}, values %{$oids_ex} ], nothing_quit => 1);
$self->{global} = {};
if (defined($snmp_result->{$oids->{optimizedConnections}})) {
foreach (keys %{$oids}) {
$self->{global}->{$_} = $snmp_result->{$oids->{$_}};
}
} else {
foreach (keys %{$oids_ex}) {
$self->{global}->{$_} = $snmp_result->{$oids_ex->{$_}};
}
my $result = $options{snmp}->map_instance(mapping => $mappings->{$equipment},
results => $results->{$oids->{$equipment}}, instance => 0);
$self->{global} = { %$result };
}
}

View File

@ -0,0 +1,173 @@
#
# Copyright 2019 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.
#
#
# Copyright 2019 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 centreon::common::riverbed::steelhead::snmp::mode::diskutilization;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'global', type => 0 },
];
$self->{maps_counters}->{global} = [
{ label => 'usage', set => {
key_values => [ { name => 'dsAveDiskUtilization' } ],
output_template => 'Datastore Usage: %.2f%%',
perfdatas => [
{ label => 'used', value => 'dsAveDiskUtilization_absolute', template => '%.2f',
min => 0, max => 100, unit => '%' },
],
}
},
{ label => 'hits', set => {
key_values => [ { name => 'dsHitsTotal', diff => 1 } ],
per_second => 1,
output_template => 'Hits: %s/s',
perfdatas => [
{ label => 'hits', value => 'dsHitsTotal_per_second', template => '%.2f',
min => 0, unit => 'hits/s' },
],
}
},
{ label => 'misses', set => {
key_values => [ { name => 'dsMissTotal', diff => 1 } ],
per_second => 1,
output_template => 'Misses: %s/s',
perfdatas => [
{ label => 'misses', value => 'dsMissTotal_per_second', template => '%.2f',
min => 0, unit => 'misses/s' },
],
}
},
];
}
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1);
bless $self, $class;
$self->{version} = '0.1';
$options{options}->add_options(arguments =>{
});
return $self;
}
my $mappings = {
common => {
dsHitsTotal => { oid => '.1.3.6.1.4.1.17163.1.1.5.4.1' },
dsMissTotal => { oid => '.1.3.6.1.4.1.17163.1.1.5.4.2' },
dsCostPerSegment => { oid => '.1.3.6.1.4.1.17163.1.1.5.4.3' },
dsAveDiskUtilization => { oid => '.1.3.6.1.4.1.17163.1.1.5.4.4' },
},
ex => {
dsHitsTotal => { oid => '.1.3.6.1.4.1.17163.1.51.5.4.1' },
dsMissTotal => { oid => '.1.3.6.1.4.1.17163.1.51.5.4.2' },
dsCostPerSegment => { oid => '.1.3.6.1.4.1.17163.1.51.5.4.3' },
dsAveDiskUtilization => { oid => '.1.3.6.1.4.1.17163.1.51.5.4.4' },
},
};
my $oids = {
common => '.1.3.6.1.4.1.17163.1.1.5.4',
ex => '.1.3.6.1.4.1.17163.1.51.5.4',
};
sub manage_selection {
my ($self, %options) = @_;
my $results = $options{snmp}->get_multiple_table(
oids => [
{ oid => $oids->{common},
start => $mappings->{common}->{dsHitsTotal}->{oid},
end => $mappings->{common}->{dsAveDiskUtilization}->{oid} },
{ oid => $oids->{ex},
start => $mappings->{ex}->{dsHitsTotal}->{oid},
end => $mappings->{ex}->{dsAveDiskUtilization}->{oid} }
]
);
foreach my $equipment (keys %{$oids}) {
next if (!%{$results->{$oids->{$equipment}}});
my $result = $options{snmp}->map_instance(mapping => $mappings->{$equipment},
results => $results->{$oids->{$equipment}}, instance => 0);
$self->{global} = {
dsHitsTotal => $result->{dsHitsTotal},
dsMissTotal => $result->{dsMissTotal},
dsAveDiskUtilization => $result->{dsAveDiskUtilization},
};
}
$self->{cache_name} = "riverbed_steelhead_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() .
'_' . $self->{mode} . '_' . md5_hex('all');
}
1;
__END__
=head1 MODE
Check disk utilization : usage, hits and misses.
=over 8
=item B<--warning-*>
Threshold warning.
Can be: 'usage' (%), 'hits' (/s), 'misses' (/s).
=item B<--critical-usage>
Threshold critical.
Can be: 'usage' (%), 'hits' (/s), 'misses' (/s).
=back
=cut

View File

@ -38,7 +38,7 @@
# limitations under the License.
#
package network::riverbed::steelhead::snmp::mode::loadaverage;
package centreon::common::riverbed::steelhead::snmp::mode::loadaverage;
use base qw(centreon::plugins::templates::counter);
@ -49,98 +49,116 @@ sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'load', type => 0, cb_prefix_output => 'prefix_load_output' },
{ name => 'global', type => 0 },
];
$self->{maps_counters}->{load} = [
$self->{maps_counters}->{global} = [
{ label => 'average', set => {
key_values => [ { name => 'cpuUtil1' } ],
output_template => 'average: %d%%',
output_template => 'CPU Average: %.2f%%',
perfdatas => [
{ label => 'total_cpu_avg', value => 'cpuUtil1_absolute', template => '%d',
{ label => 'total_cpu_avg', value => 'cpuUtil1_absolute', template => '%.2f',
min => 0, max => 100, unit => '%' },
],
}
},
{ label => '1min', set => {
key_values => [ { name => 'cpuLoad1' } ],
output_template => '1 min: %d%%',
output_template => 'Load 1 min: %.2f',
perfdatas => [
{ label => 'load1', value => 'cpuLoad1_absolute', template => '%d',
min => 0, max => 100, unit => '%' },
{ label => 'load1', value => 'cpuLoad1_absolute', template => '%.2f',
min => 0 },
],
}
},
{ label => '5min', set => {
key_values => [ { name => 'cpuLoad5' } ],
output_template => '5 min: %d%%',
output_template => 'Load 5 min: %.2f',
perfdatas => [
{ label => 'load5', value => 'cpuLoad5_absolute', template => '%d',
min => 0, max => 100, unit => "%" },
{ label => 'load5', value => 'cpuLoad5_absolute', template => '%.2f',
min => 0 },
],
}
},
{ label => '15min', set => {
key_values => [ { name => 'cpuLoad15' } ],
output_template => '15 min: %d%%',
output_template => 'Load 15 min: %.2f',
perfdatas => [
{ label => 'load15', value => 'cpuLoad15_absolute', template => '%d',
min => 0, max => 100, unit => '%' },
{ label => 'load15', value => 'cpuLoad15_absolute', template => '%.2f',
min => 0 },
],
}
},
];
}
sub prefix_load_output {
my ($self, %options) = @_;
return "Load ";
}
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$self->{version} = '0.1';
$options{options}->add_options(arguments =>
{
});
$options{options}->add_options(arguments =>{
});
return $self;
}
my $mappings = {
common => {
cpuLoad1 => { oid => '.1.3.6.1.4.1.17163.1.1.5.1.1' },
cpuLoad5 => { oid => '.1.3.6.1.4.1.17163.1.1.5.1.2' },
cpuLoad15 => { oid => '.1.3.6.1.4.1.17163.1.1.5.1.3' },
cpuUtil1 => { oid => '.1.3.6.1.4.1.17163.1.1.5.1.4' },
},
ex => {
cpuLoad1 => { oid => '.1.3.6.1.4.1.17163.1.51.5.1.1' },
cpuLoad5 => { oid => '.1.3.6.1.4.1.17163.1.51.5.1.2' },
cpuLoad15 => { oid => '.1.3.6.1.4.1.17163.1.51.5.1.3' },
cpuUtil1 => { oid => '.1.3.6.1.4.1.17163.1.51.5.1.4' },
},
interceptor => {
cpuLoad1 => { oid => '.1.3.6.1.4.1.17163.1.3.5.1.1' },
cpuLoad5 => { oid => '.1.3.6.1.4.1.17163.1.3.5.1.2' },
cpuLoad15 => { oid => '.1.3.6.1.4.1.17163.1.3.5.1.3' },
cpuUtil1 => { oid => '.1.3.6.1.4.1.17163.1.3.5.1.4' },
},
};
my $oids = {
common => '.1.3.6.1.4.1.17163.1.1.5.1',
ex => '.1.3.6.1.4.1.17163.1.51.5.1',
interceptor => '.1.3.6.1.4.1.17163.1.3.5.1',
};
sub manage_selection {
my ($self, %options) = @_;
# STEELHEAD-MIB
my $oids = {
cpuLoad1 => '.1.3.6.1.4.1.17163.1.1.5.1.1.0',
cpuLoad5 => '.1.3.6.1.4.1.17163.1.1.5.1.2.0',
cpuLoad15 => '.1.3.6.1.4.1.17163.1.1.5.1.3.0',
cpuUtil1 => '.1.3.6.1.4.1.17163.1.1.5.1.4.0',
};
my $results = $options{snmp}->get_multiple_table(
oids => [
{ oid => $oids->{common},
start => $mappings->{common}->{cpuLoad1}->{oid},
end => $mappings->{common}->{cpuUtil1}->{oid} },
{ oid => $oids->{ex},
start => $mappings->{ex}->{cpuLoad1}->{oid},
end => $mappings->{ex}->{cpuUtil1}->{oid} },
{ oid => $oids->{interceptor},
start => $mappings->{interceptor}->{cpuLoad1}->{oid},
end => $mappings->{interceptor}->{cpuUtil1}->{oid} }
]
);
# STEELHEAD-EX-MIB
my $oids_ex = {
cpuLoad1 => '.1.3.6.1.4.1.17163.1.51.5.1.1.0',
cpuLoad5 => '.1.3.6.1.4.1.17163.1.51.5.1.2.0',
cpuLoad15 => '.1.3.6.1.4.1.17163.1.51.5.1.3.0',
cpuUtil1 => '.1.3.6.1.4.1.17163.1.51.5.1.4.0',
};
foreach my $equipment (keys %{$oids}) {
next if (!%{$results->{$oids->{$equipment}}});
my $snmp_result = $options{snmp}->get_leef(oids => [ values %{$oids}, values %{$oids_ex} ], nothing_quit => 1);
my $result = $options{snmp}->map_instance(mapping => $mappings->{$equipment},
results => $results->{$oids->{$equipment}}, instance => 0);
$self->{load} = {};
if (defined($snmp_result->{$oids->{cpuUtil1}})) {
foreach (keys %{$oids}) {
$self->{load}->{$_} = $snmp_result->{$oids->{$_}};
}
} else {
foreach (keys %{$oids}) {
$self->{load}->{$_} = $snmp_result->{$oids_ex->{$_}};
}
$self->{global} = {
cpuLoad1 => $result->{cpuLoad1} / 100,
cpuLoad5 => $result->{cpuLoad1} / 100,
cpuLoad15 => $result->{cpuLoad1} / 100,
cpuUtil1 => $result->{cpuUtil1},
};
}
}
@ -150,7 +168,7 @@ __END__
=head1 MODE
Check system load-average.
Check system load average.
=over 8

View File

@ -0,0 +1,186 @@
#
# Copyright 2019 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 centreon::common::riverbed::steelhead::snmp::mode::status;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold);
sub custom_status_output {
my ($self, %options) = @_;
my $msg = sprintf("Health is '%s', Status is '%s'",
$self->{result_values}->{health},
$self->{result_values}->{status});
return $msg;
}
sub custom_status_calc {
my ($self, %options) = @_;
$self->{result_values}->{health} = $options{new_datas}->{$self->{instance} . '_health'};
$self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_serviceStatus'};
return 0;
}
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'global', type => 0, cb_prefix_output => 'prefix_status_output' },
];
$self->{maps_counters}->{global} = [
{ label => 'status', threshold => 0, set => {
key_values => [ { name => 'health' }, { name => 'serviceStatus' } ],
closure_custom_calc => $self->can('custom_status_calc'),
closure_custom_output => $self->can('custom_status_output'),
closure_custom_perfdata => sub { return 0; },
closure_custom_threshold_check => \&catalog_status_threshold,
}
},
{ label => 'uptime', set => {
key_values => [ { name => 'serviceUptime' }, { name => 'serviceUptime_human' } ],
output_template => 'Uptime: %s', output_use => 'serviceUptime_human_absolute',
perfdatas => [
{ label => 'uptime', value => 'serviceUptime_absolute', template => '%d',
min => 0, unit => 's' },
],
}
},
];
}
sub prefix_status_output {
my ($self, %options) = @_;
return "Optimization Service ";
}
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-status:s" => { name => 'warning_status', default => '' },
"critical-status:s" => { name => 'critical_status', default => '%{health} !~ /Healthy/ || %{status} !~ /running/' },
});
return $self;
}
sub check_options {
my ($self, %options) = @_;
$self->SUPER::check_options(%options);
$self->change_macros(macros => ['warning_status', 'critical_status']);
}
my $mappings = {
common => {
health => { oid => '.1.3.6.1.4.1.17163.1.1.2.2' },
serviceStatus => { oid => '.1.3.6.1.4.1.17163.1.1.2.3' },
serviceUptime => { oid => '.1.3.6.1.4.1.17163.1.1.2.4' },
},
ex => {
health => { oid => '.1.3.6.1.4.1.17163.1.51.2.2' },
serviceStatus => { oid => '.1.3.6.1.4.1.17163.1.51.2.3' },
serviceUptime => { oid => '.1.3.6.1.4.1.17163.1.51.2.4' },
},
interceptor => {
health => { oid => '.1.3.6.1.4.1.17163.1.3.2.2' },
serviceStatus => { oid => '.1.3.6.1.4.1.17163.1.3.2.3' },
serviceUptime => { oid => '.1.3.6.1.4.1.17163.1.3.2.4' },
},
};
my $oids = {
common => '.1.3.6.1.4.1.17163.1.1.2',
ex => '.1.3.6.1.4.1.17163.1.51.2',
interceptor => '.1.3.6.1.4.1.17163.1.3.2',
};
sub manage_selection {
my ($self, %options) = @_;
my $results = $options{snmp}->get_multiple_table(
oids => [
{ oid => $oids->{common},
start => $mappings->{common}->{health}->{oid},
end => $mappings->{common}->{serviceUptime}->{oid} },
{ oid => $oids->{ex},
start => $mappings->{ex}->{health}->{oid},
end => $mappings->{ex}->{serviceUptime}->{oid} },
{ oid => $oids->{interceptor},
start => $mappings->{interceptor}->{health}->{oid},
end => $mappings->{interceptor}->{serviceUptime}->{oid} }
]
);
foreach my $equipment (keys %{$oids}) {
next if (!%{$results->{$oids->{$equipment}}});
my $result = $options{snmp}->map_instance(mapping => $mappings->{$equipment},
results => $results->{$oids->{$equipment}}, instance => 0);
$self->{global} = {
health => $result->{health},
serviceStatus => $result->{serviceStatus},
serviceUptime => $result->{serviceUptime} / 100,
serviceUptime_human => centreon::plugins::misc::change_seconds(value => $result->{serviceUptime} / 100),
};
}
}
1;
__END__
=head1 MODE
Check the current status of the optimization service.
=over 8
=item B<--warning-status>
Set warning threshold for status (Default: '').
Can used special variables like: %{health}, %{status}
=item B<--critical-status>
Set critical threshold for status (Default: '%{health} !~ /Healthy/ || %{status} !~ /running/').
Can used special variables like: %{health}, %{status}
=item B<--warning-uptime>
Warning thresholds in seconds.
=item B<--critical-uptime>
Critical thresholds in seconds.
=back
=cut

View File

@ -0,0 +1,120 @@
#
# Copyright 2019 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 centreon::common::riverbed::steelhead::snmp::mode::temperature;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'global', type => 0 },
];
$self->{maps_counters}->{global} = [
{ label => 'temperature', set => {
key_values => [ { name => 'systemTemperature' } ],
output_template => 'Temperature: %.2f C',
perfdatas => [
{ label => 'temperature', value => 'systemTemperature_absolute', template => '%.2f',
min => 0, unit => 'C' },
],
}
},
];
}
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$self->{version} = '0.1';
$options{options}->add_options(arguments =>{
});
return $self;
}
my $mappings = {
common => {
systemTemperature => { oid => '.1.3.6.1.4.1.17163.1.1.2.9' },
},
ex => {
systemTemperature => { oid => '.1.3.6.1.4.1.17163.1.51.2.9' },
},
};
my $oids = {
common => '.1.3.6.1.4.1.17163.1.1.2.9',
ex => '.1.3.6.1.4.1.17163.1.51.2.9',
};
sub manage_selection {
my ($self, %options) = @_;
my $results = $options{snmp}->get_multiple_table(
oids => [
{ oid => $oids->{common},
start => $mappings->{common}->{systemTemperature}->{oid},
end => $mappings->{common}->{systemTemperature}->{oid} },
{ oid => $oids->{ex},
start => $mappings->{ex}->{systemTemperature}->{oid},
end => $mappings->{ex}->{systemTemperature}->{oid} }
]
);
foreach my $equipment (keys %{$oids}) {
next if (!%{$results->{$oids->{$equipment}}});
my $result = $options{snmp}->map_instance(mapping => $mappings->{$equipment},
results => $results->{$oids->{$equipment}}, instance => 0);
$self->{global} = {
systemTemperature => $result->{systemTemperature},
};
}
}
1;
__END__
=head1 MODE
Check the temperature of the system in Celcius (STEELHEAD-MIB and STEELHEAD-EX-MIB).
=over 8
=item B<--warning>
Threshold warning for temperature in Celsius.
=item B<--critical>
Threshold critical for temperature in Celsius.
=back
=cut

View File

@ -0,0 +1,170 @@
#
# Copyright 2019 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::riverbed::interceptor::snmp::mode::interfaces;
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 => 'interface', type => 1, cb_prefix_output => 'prefix_interface_output',
message_multiple => 'All interfaces are ok' },
];
$self->{maps_counters}->{interface} = [
{ label => 'packets-in-dropped', set => {
key_values => [ { name => 'interfaceRxDrops', diff => 1 }, { name => 'display' } ],
output_template => 'Packets In Dropped (NIC): %d packets/s',
per_second => 1,
perfdatas => [
{ label => 'packets_in_dropped', value => 'interfaceRxDrops_absolute', template => '%d', min => 0,
unit => 'packets/s', label_extra_instance => 1, instance_use => 'display_absolute' },
],
}
},
{ label => 'packets-out-dropped', set => {
key_values => [ { name => 'interfaceTxDrops', diff => 1 }, { name => 'display' } ],
output_template => 'Packets Out Dropped (NIC): %d packets/s',
per_second => 1,
perfdatas => [
{ label => 'packets_out_dropped', value => 'interfaceTxDrops_absolute', template => '%d', min => 0,
unit => 'packets/s', label_extra_instance => 1, instance_use => 'display_absolute' },
],
}
},
{ label => 'packets-soft-dropped', set => {
key_values => [ { name => 'interfaceSoftwareDrops', diff => 1 }, { name => 'display' } ],
output_template => 'Packets Dropped (Software): %d packets/s',
per_second => 1,
perfdatas => [
{ label => 'packets_soft_dropped', value => 'interfaceSoftwareDrops', template => '%d', min => 0,
unit => 'packets/s', label_extra_instance => 1, instance_use => 'display_absolute' },
],
}
},
{ label => 'packets-xoff', set => {
key_values => [ { name => 'interfaceFlowCtrlPkts', diff => 1 }, { name => 'display' } ],
output_template => 'XOFF Flow Control Packets Transmitted: %d packets/s',
per_second => 1,
perfdatas => [
{ label => 'packets_xoff', value => 'interfaceFlowCtrlPkts', template => '%d', min => 0,
unit => 'packets/s', label_extra_instance => 1, instance_use => 'display_absolute' },
],
}
},
];
}
sub prefix_interface_output {
my ($self, %options) = @_;
return "Interface '" . $options{instance_value}->{display} . "' ";
}
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1);
bless $self, $class;
$self->{version} = '0.1';
$options{options}->add_options(arguments => {
});
return $self;
}
my $mappings = {
int => {
interfaceName => { oid => '.1.3.6.1.4.1.17163.1.3.2.9.1.2' },
interfaceRxDrops => { oid => '.1.3.6.1.4.1.17163.1.3.2.9.1.3' },
interfaceTxDrops => { oid => '.1.3.6.1.4.1.17163.1.3.2.9.1.4' },
interfaceSoftwareDrops => { oid => '.1.3.6.1.4.1.17163.1.3.2.9.1.5' },
interfaceFlowCtrlPkts => { oid => '.1.3.6.1.4.1.17163.1.3.2.9.1.6' },
},
};
my $oids = {
int => '.1.3.6.1.4.1.17163.1.3.2.9.1',
};
sub manage_selection {
my ($self, %options) = @_;
my $results = $options{snmp}->get_multiple_table(
oids => [
{ oid => $oids->{int},
start => $mappings->{int}->{interfaceName}->{oid},
end => $mappings->{int}->{interfaceFlowCtrlPkts}->{oid} }
]
);
foreach my $equipment (keys %{$oids}) {
next if (!%{$results->{$oids->{$equipment}}});
foreach my $oid (keys %{$results->{$oids->{$equipment}}}) {
next if ($oid !~ /^$mappings->{$equipment}->{interfaceName}->{oid}\.(\d+)/);
my $instance = $1;
my $result = $options{snmp}->map_instance(mapping => $mappings->{$equipment},
results => $results->{$oids->{$equipment}}, instance => $instance);
$self->{interface}->{$result->{interfaceName}} = {
display => $result->{interfaceName},
interfaceRxDrops => $result->{interfaceRxDrops},
interfaceTxDrops => $result->{interfaceTxDrops},
interfaceSoftwareDrops => $result->{interfaceSoftwareDrops},
interfaceFlowCtrlPkts => $result->{interfaceFlowCtrlPkts}
};
}
}
$self->{cache_name} = "riverbed_steelhead_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() .
'_' . $self->{mode} . '_' . md5_hex('all');
}
1;
__END__
=head1 MODE
Check interfaces packets.
=over 8
=item B<--warning-*>
Threshold warning.
Can be: 'packets-in-dropped', 'packets-out-dropped',
'packets-soft-dropped', 'packets-xoff'.
=item B<--critical-*>
Threshold critical.
Can be: 'packets-in-dropped', 'packets-out-dropped',
'packets-soft-dropped', 'packets-xoff'.
=back
=cut

View File

@ -0,0 +1,135 @@
#
# Copyright 2019 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::riverbed::interceptor::snmp::mode::neighborconnections;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'neighbor', type => 1, cb_prefix_output => 'prefix_neighbor_output',
message_multiple => 'All neighbor connections count are ok' },
];
$self->{maps_counters}->{neighbor} = [
{ label => 'connection', set => {
key_values => [ { name => 'neighborConnectionCount' }, { name => 'display' } ],
output_template => 'Optimized Connections Count: %d',
perfdatas => [
{ label => 'connections', value => 'neighborConnectionCount_absolute', template => '%d', min => 0,
label_extra_instance => 1, instance_use => 'display_absolute' },
],
}
},
];
}
sub prefix_neighbor_output {
my ($self, %options) = @_;
return "Neighbor '" . $options{instance_value}->{display} . "' ";
}
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$self->{version} = '0.1';
$options{options}->add_options(arguments => {
});
return $self;
}
my $mappings = {
int => {
neighborName => { oid => '.1.3.6.1.4.1.17163.1.3.2.6.1.3' },
neighborConnectionCount => { oid => '.1.3.6.1.4.1.17163.1.3.2.6.1.4' },
},
};
my $oids = {
int => '.1.3.6.1.4.1.17163.1.3.2.6',
};
sub manage_selection {
my ($self, %options) = @_;
my $results = $options{snmp}->get_multiple_table(
oids => [
{ oid => $oids->{int},
start => $mappings->{int}->{neighborName}->{oid},
end => $mappings->{int}->{neighborConnectionCount}->{oid} }
]
);
foreach my $equipment (keys %{$oids}) {
next if (!%{$results->{$oids->{$equipment}}});
foreach my $oid (keys %{$results->{$oids->{$equipment}}}) {
next if ($oid !~ /^$mappings->{$equipment}->{neighborName}->{oid}\.(\d+)/);
my $instance = $1;
my $result = $options{snmp}->map_instance(mapping => $mappings->{$equipment},
results => $results->{$oids->{$equipment}}, instance => $instance);
$self->{neighbor}->{$result->{neighborName}} = {
display => $result->{neighborName},
neighborConnectionCount => $result->{neighborConnectionCount}
};
}
}
}
1;
__END__
=head1 MODE
Current connections: total, established, active, optimized, passthrough,
half opened and half closed ones (STEELHEAD-MIB and STEELHEAD-EX-MIB).
=over 8
=item B<--filter-counters>
Only display some counters (regexp can be used).
Example: --filter-counters='^(total)$'
=item B<--warning-*>
Threshold warning.
Can be: 'total', 'established', 'active', 'optimized',
'passthrough', 'half-opened', 'half-closed'.
=item B<--critical-*>
Threshold critical.
Can be: 'total', 'established', 'active', 'optimized',
'passthrough', 'half-opened', 'half-closed'.
=back
=cut

View File

@ -0,0 +1,53 @@
#
# Copyright 2019 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::riverbed::interceptor::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' => 'network::riverbed::interceptor::snmp::mode::interfaces',
'neighbor-connections' => 'network::riverbed::interceptor::snmp::mode::neighborconnections',
'load-average' => 'centreon::common::riverbed::steelhead::snmp::mode::loadaverage',
'status' => 'centreon::common::riverbed::steelhead::snmp::mode::status',
);
return $self;
}
1;
__END__
=head1 PLUGIN DESCRIPTION
Check Riverbed SteelHead Interceptor using SNMP.
=cut

View File

@ -1,106 +0,0 @@
#
# Copyright 2019 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::riverbed::steelhead::snmp::mode::diskutilization;
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} = '0.1';
$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) = @_;
$self->{snmp} = $options{snmp};
# STEELHEAD-MIB
my $oid_dsAveDiskUtilization = '.1.3.6.1.4.1.17163.1.1.5.4.4.0'; # in %
# STEELHEAD-EX-MIB
my $oid_ex_dsAveDiskUtilization = '.1.3.6.1.4.1.17163.1.51.5.4.4.0'; # in %
my $result = $self->{snmp}->get_leef(oids => [$oid_dsAveDiskUtilization, $oid_ex_dsAveDiskUtilization], nothing_quit => 1);
my $disk_usage = defined($result->{$oid_dsAveDiskUtilization}) ? $result->{$oid_dsAveDiskUtilization} : $result->{$oid_ex_dsAveDiskUtilization};
my $exit = $self->{perfdata}->threshold_check(value => $disk_usage, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Datastore usage: %d %%",
$disk_usage));
$self->{output}->perfdata_add(label => "used", unit => '%',
value => $disk_usage,
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
min => 0, max => 100
);
$self->{output}->display();
$self->{output}->exit();
}
1;
__END__
=head1 MODE
Average disk utilization, a more accurate measurement of the underlying disk activities,
and correlates directly to disk pressure (STEELHEAD-MIB & STEELHEAD-EX-MIB).
=over 8
=item B<--warning>
Threshold warning in %.
=item B<--critical>
Threshold critical in %.
=back
=cut

View File

@ -1,126 +0,0 @@
#
# Copyright 2019 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::riverbed::steelhead::snmp::mode::health;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold);
sub custom_status_output {
my ($self, %options) = @_;
my $msg = "System health: '" . $self->{result_values}->{state} . "' ";
return $msg;
}
sub custom_status_calc {
my ($self, %options) = @_;
$self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'};
return 0;
}
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'health', type => 0 },
];
$self->{maps_counters}->{health} = [
{ label => 'status', threshold => 0, set => {
key_values => [ { name => 'state' } ],
closure_custom_calc => $self->can('custom_status_calc'),
closure_custom_output => $self->can('custom_status_output'),
closure_custom_perfdata => sub { return 0; },
closure_custom_threshold_check => \&catalog_status_threshold,
}
},
];
}
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-status:s" => { name => 'warning_status', default => '%{state} =~ /degraded/' },
"critical-status:s" => { name => 'critical_status', default => '%{state} =~ /(critical|admission)/' },
});
return $self;
}
sub check_options {
my ($self, %options) = @_;
$self->SUPER::check_options(%options);
$self->change_macros(macros => ['warning_status', 'critical_status']);
}
my %map_status = (
10000 => 'healthy',
30000 => 'degraded',
31000 => 'admissionControl',
50000 => 'critical',
);
sub manage_selection {
my ($self, %options) = @_;
$self->{health} = {};
# STEELHEAD-MIB
my $oid_optSystemHealth = '.1.3.6.1.4.1.17163.1.1.2.7.0';
# STEELHEAD-EX-MIB
my $oid_ex_optSystemHealth = '.1.3.6.1.4.1.17163.1.51.2.7.0';
my $result = $options{snmp}->get_leef(oids => [ $oid_optSystemHealth, $oid_ex_optSystemHealth ], nothing_quit => 1);
my $status = defined($result->{$oid_optSystemHealth}) ? $result->{$oid_optSystemHealth} : $result->{$oid_ex_optSystemHealth} ;
$self->{health} = { state => $map_status{$status} };
}
1;
__END__
=head1 MODE
Check the global system health (STEELHEAD-MIB and STEELHEAD-EX-MIB).
=over 8
=item B<--warning-status>
Set warning threshold for status (Default: '%{state} =~ /degraded/').
Special var is %{state}
=item B<--critical-status>
Set critical threshold for status (Default: '%{state} !~ /(critical|admission)/').
Special var is %{state}
=back
=cut

View File

@ -1,131 +0,0 @@
#
# Copyright 2019 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::riverbed::steelhead::snmp::mode::servicestatus;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold);
sub custom_status_output {
my ($self, %options) = @_;
my $msg = "Optimization service state: '" . $self->{result_values}->{state} . "' ";
return $msg;
}
sub custom_status_calc {
my ($self, %options) = @_;
$self->{result_values}->{state} = $options{new_datas}->{$self->{instance} . '_state'};
return 0;
}
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'opt_service', type => 0 },
];
$self->{maps_counters}->{opt_service} = [
{ label => 'status', threshold => 0, set => {
key_values => [ { name => 'state' } ],
closure_custom_calc => $self->can('custom_status_calc'),
closure_custom_output => $self->can('custom_status_output'),
closure_custom_perfdata => sub { return 0; },
closure_custom_threshold_check => \&catalog_status_threshold,
}
},
];
}
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-status:s" => { name => 'warning_status', default => '' },
"critical-status:s" => { name => 'critical_status', default => '%{state} !~ /running/' },
});
return $self;
}
sub check_options {
my ($self, %options) = @_;
$self->SUPER::check_options(%options);
$self->change_macros(macros => ['warning_status', 'critical_status']);
}
my %map_status = (
0 => 'none',
1 => 'unmanaged',
2 => 'running',
3 => 'sentCom1',
4 => 'sentTerm1',
5 => 'sentTerm2',
6 => 'sentTerm3',
7 => 'pending',
8 => 'stopped',
);
sub manage_selection {
my ($self, %options) = @_;
$self->{opt_service} = {};
# STEELHEAD-MIB
my $oid_optServiceStatus = '.1.3.6.1.4.1.17163.1.1.2.8.0';
# STEELHEAD-EX-MIB
my $oid_ex_optServiceStatus = '.1.3.6.1.4.1.17163.1.51.2.8.0';
my $result = $options{snmp}->get_leef(oids => [ $oid_optServiceStatus, $oid_ex_optServiceStatus ], nothing_quit => 1);
my $status = defined($result->{$oid_optServiceStatus}) ? $result->{$oid_optServiceStatus} : $result->{$oid_ex_optServiceStatus} ;
$self->{opt_service} = { state => $map_status{$status} };
}
1;
__END__
=head1 MODE
Check the current status of the optimization service (STEELHEAD-MIB and STEELHEAD-EX-MIB).
=over 8
=item B<--warning-status>
Set warning threshold for status (Default: '').
Special var is %{state}
=item B<--critical-status>
Set critical threshold for status (Default: '%{state} !~ /running/').
Special var is %{state}
=back
=cut

View File

@ -1,110 +0,0 @@
#
# Copyright 2019 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::riverbed::steelhead::snmp::mode::serviceuptime;
use base qw(centreon::plugins::mode);
use strict;
use warnings;
use centreon::plugins::misc;
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', },
"seconds" => { name => 'seconds', }
});
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) = @_;
$self->{snmp} = $options{snmp};
# STEELHEAD-MIB
my $oid_serviceUptime = '.1.3.6.1.4.1.17163.1.1.2.4.0';
# STEELHEAD-EX-MIB
my $oid_ex_serviceUptime = '.1.3.6.1.4.1.17163.1.51.2.4.0';
my $result = $self->{snmp}->get_leef(oids => [ $oid_serviceUptime, $oid_ex_serviceUptime ], nothing_quit => 1);
my $value = defined($result->{$oid_serviceUptime}) ? $result->{$oid_serviceUptime} : $result->{$oid_ex_serviceUptime};
my $exit_code = $self->{perfdata}->threshold_check(value => sprintf("%d", $value / 100),
threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
$self->{output}->perfdata_add(label => 'uptime', unit => 's',
value => sprintf("%d", $value / 100),
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
min => 0);
$self->{output}->output_add(severity => $exit_code,
short_msg => sprintf("Service uptime is: %s", centreon::plugins::misc::change_seconds(value => $value / 100)));
$self->{output}->display();
$self->{output}->exit();
}
1;
__END__
=head1 MODE
Uptime of the optimization service (STEELHEAD-MIB and STEELHEAD-EX-MIB).
=over 8
=item B<--warning>
Threshold warning in seconds.
=item B<--critical>
Threshold critical in seconds.
=item B<--seconds>
Display uptime in seconds.
=back
=cut

View File

@ -1,104 +0,0 @@
#
# Copyright 2019 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::riverbed::steelhead::snmp::mode::temperature;
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) = @_;
$self->{snmp} = $options{snmp};
# STEELHEAD-MIB
my $oid_systemTemperature = '.1.3.6.1.4.1.17163.1.1.2.9.0'; # in Celsius
# STEELHEAD-EX-MIB
my $oid_ex_systemTemperature = '.1.3.6.1.4.1.17163.1.51.2.9.0'; # in Celsius
my $result = $self->{snmp}->get_leef(oids => [$oid_systemTemperature, $oid_ex_systemTemperature], nothing_quit => 1);
my $temp = defined($result->{$oid_systemTemperature}) ? $result->{$oid_systemTemperature} : $result->{$oid_ex_systemTemperature};
my $exit = $self->{perfdata}->threshold_check(value => $temp, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Device Temperature is %d C degrees",
$temp));
$self->{output}->perfdata_add(label => "temperature", unit => 'C',
value => $temp,
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
);
$self->{output}->display();
$self->{output}->exit();
}
1;
__END__
=head1 MODE
Check the temperature of the system in Celcius (STEELHEAD-MIB AND STEELHEAD-EX-MIB).
=over 8
=item B<--warning>
Threshold warning for temperature in Celsius.
=item B<--critical>
Threshold critical for temperature in Celsius.
=back
=cut

View File

@ -30,21 +30,17 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
# Plugin version
$self->{version} = '0.1';
# Modes association
%{$self->{modes}} = (
'temperature' => 'network::riverbed::steelhead::snmp::mode::temperature',
'service-uptime' => 'network::riverbed::steelhead::snmp::mode::serviceuptime',
'health' => 'network::riverbed::steelhead::snmp::mode::health',
'service-status' => 'network::riverbed::steelhead::snmp::mode::servicestatus',
'load-average' => 'network::riverbed::steelhead::snmp::mode::loadaverage',
'bandwidth-passthrough' => 'network::riverbed::steelhead::snmp::mode::bwpassthrough',
'bandwidth-optimization' => 'network::riverbed::steelhead::snmp::mode::bwoptimization',
'disk-utilization' => 'network::riverbed::steelhead::snmp::mode::diskutilization',
'connections' => 'network::riverbed::steelhead::snmp::mode::connections',
);
'bandwidth-optimization' => 'centreon::common::riverbed::steelhead::snmp::mode::bwoptimization',
'bandwidth-passthrough' => 'centreon::common::riverbed::steelhead::snmp::mode::bwpassthrough',
'connections' => 'centreon::common::riverbed::steelhead::snmp::mode::connections',
'disk-utilization' => 'centreon::common::riverbed::steelhead::snmp::mode::diskutilization',
'load-average' => 'centreon::common::riverbed::steelhead::snmp::mode::loadaverage',
'status' => 'centreon::common::riverbed::steelhead::snmp::mode::status',
'temperature' => 'centreon::common::riverbed::steelhead::snmp::mode::temperature',
);
return $self;
}