This commit is contained in:
Quentin Garnier 2014-10-06 16:29:53 +02:00
parent d1d9438ac6
commit 2d8a0bbc4a
4 changed files with 9 additions and 13 deletions

View File

@ -93,8 +93,8 @@ sub new {
"exclude:s" => { name => 'exclude' },
"component:s" => { name => 'component', default => 'all' },
"no-component:s" => { name => 'no_component' },
"threshold-overload:s@" => { name => 'threshold_overload' },
});
"threshold-overload:s@" => { name => 'threshold_overload' },
});
$self->{components} = {};
$self->{no_components} = undef;
@ -137,7 +137,7 @@ sub run {
$self->{results} = $self->{snmp}->get_leef(oids => [$oid_synoSystempowerStatus, $oid_synoSystemcpuFanStatus, $oid_synoSystemsystemFanStatus],
nothing_quit => 1);
nothing_quit => 1);
if ($self->{option_results}->{component} eq 'all') {
$self->check_fan_cpu();
@ -291,8 +291,8 @@ sub check_disk {
foreach my $key ($self->{snmp}->oid_lex_sort(keys %$results)) {
next if ($key !~ /^$oid_synoDiskdiskStatus\.(\d+)/);
my $index = $1;
$instance = $1;
my $index = $1;
$instance = $1;
my $disk_state = $results->{$oid_synoDiskdiskStatus . '.' . $index};
next if ($self->check_exclude(section => 'disk', instance => $instance));
@ -302,14 +302,13 @@ sub check_disk {
$self->{output}->output_add(long_msg => sprintf("Disk '%s' state is %s.",
$index, $map_states_disk{$disk_state}));
my $exit = $self->get_severity(section => 'disk', value => $map_states_disk{$disk_state});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Disk '%s' state is %s.", $index, $map_states_disk{$disk_state}));
}
}
}
1;
__END__

View File

@ -52,7 +52,6 @@ my %map_states_system = (
2 => 'Failed',
);
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
@ -73,7 +72,7 @@ sub run {
# $options{snmp} = snmp object
$self->{snmp} = $options{snmp};
my $oid_synoSystemsystemStatus = '.1.3.6.1.4.1.6574.1.1.0'; # in Celsius
my $oid_synoSystemsystemStatus = '.1.3.6.1.4.1.6574.1.1.0';
my $result = $self->{snmp}->get_leef(oids => [$oid_synoSystemsystemStatus],
nothing_quit => 1);

View File

@ -39,7 +39,6 @@ use base qw(centreon::plugins::mode);
use strict;
use warnings;
use Data::Dumper;
sub new {
my ($class, %options) = @_;

View File

@ -39,7 +39,6 @@ use base qw(centreon::plugins::mode);
use strict;
use warnings;
use Data::Dumper;
sub new {
my ($class, %options) = @_;
@ -49,8 +48,8 @@ sub new {
$self->{version} = '1.0';
$options{options}->add_options(arguments =>
{
"warning:s" => { name => 'warning' },
"critical:s" => { name => 'critical' },
"warning:s" => { name => 'warning' },
"critical:s" => { name => 'critical' },
});
return $self;
}