diff --git a/src/storage/emc/isilon/snmp/mode/components/disk.pm b/src/storage/emc/isilon/snmp/mode/components/disk.pm index cbf6e8baf..3d1681427 100644 --- a/src/storage/emc/isilon/snmp/mode/components/disk.pm +++ b/src/storage/emc/isilon/snmp/mode/components/disk.pm @@ -27,7 +27,7 @@ my $mapping = { diskLogicalNumber => { oid => '.1.3.6.1.4.1.12124.2.52.1.2' }, diskChassisNumber => { oid => '.1.3.6.1.4.1.12124.2.52.1.3' }, diskDeviceName => { oid => '.1.3.6.1.4.1.12124.2.52.1.4' }, - diskStatus => { oid => '.1.3.6.1.4.1.12124.2.52.1.5' }, + diskStatus => { oid => '.1.3.6.1.4.1.12124.2.52.1.5' } }; my $oid_diskEntry = '.1.3.6.1.4.1.12124.2.52.1'; @@ -52,17 +52,22 @@ sub check { next if ($self->check_filter(section => 'disk', instance => $instance)); $self->{components}->{disk}->{total}++; - $self->{output}->output_add(long_msg => sprintf("disk '%s' status is '%s' [instance = %s] [logical = %s] [chassis = %s]", - $result->{diskDeviceName}, $result->{diskStatus}, $instance, - $result->{diskLogicalNumber}, $result->{diskChassisNumber} - )); - + $self->{output}->output_add( + long_msg => sprintf( + "disk '%s' status is '%s' [instance: %s] [logical: %s] [chassis: %s]", + $result->{diskDeviceName}, $result->{diskStatus}, $instance, + $result->{diskLogicalNumber}, $result->{diskChassisNumber} + ) + ); + my $exit = $self->get_severity(section => 'disk', value => $result->{diskStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Disk '%s' status is '%s'", $result->{diskDeviceName}, $result->{diskStatus})); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Disk '%s' status is '%s'", $result->{diskDeviceName}, $result->{diskStatus}) + ); } } } -1; \ No newline at end of file +1; diff --git a/src/storage/emc/isilon/snmp/mode/components/fan.pm b/src/storage/emc/isilon/snmp/mode/components/fan.pm index e84843156..d72b3841f 100644 --- a/src/storage/emc/isilon/snmp/mode/components/fan.pm +++ b/src/storage/emc/isilon/snmp/mode/components/fan.pm @@ -52,23 +52,30 @@ sub check { next if ($self->check_filter(section => 'fan', instance => $instance)); $self->{components}->{fan}->{total}++; - $self->{output}->output_add(long_msg => sprintf("fan '%s' is %s rpm [instance = %s] [description = %s]", - $result->{fanName}, $result->{fanSpeed}, $instance, - $result->{fanDescription})); - + $self->{output}->output_add( + long_msg => sprintf( + "fan '%s' is %s rpm [instance = %s] [description = %s]", + $result->{fanName}, $result->{fanSpeed}, $instance, + $result->{fanDescription} + ) + ); + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'fan', instance => $instance, value => $result->{fanSpeed}); - + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Fan '%s' is %s rpm", $result->{fanName}, $result->{fanSpeed})); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Fan '%s' is %s rpm", $result->{fanName}, $result->{fanSpeed}) + ); } + $self->{output}->perfdata_add( label => 'speed', unit => 'rpm', nlabel => 'hardware.fan.speed.rpm', instances => $result->{fanName}, value => $result->{fanSpeed}, warning => $warn, - critical => $crit, + critical => $crit ); } } diff --git a/src/storage/emc/isilon/snmp/mode/components/power.pm b/src/storage/emc/isilon/snmp/mode/components/power.pm index 4161ebf29..e52d121c0 100644 --- a/src/storage/emc/isilon/snmp/mode/components/power.pm +++ b/src/storage/emc/isilon/snmp/mode/components/power.pm @@ -26,7 +26,7 @@ use warnings; my $mapping = { powerSensorName => { oid => '.1.3.6.1.4.1.12124.2.55.1.2' }, powerSensorDescription => { oid => '.1.3.6.1.4.1.12124.2.55.1.3' }, - powerSensorValue => { oid => '.1.3.6.1.4.1.12124.2.55.1.4' }, + powerSensorValue => { oid => '.1.3.6.1.4.1.12124.2.55.1.4' } }; my $oid_powerSensorEntry = '.1.3.6.1.4.1.12124.2.55.1'; @@ -52,16 +52,23 @@ sub check { next if ($self->check_filter(section => 'power', instance => $instance)); $self->{components}->{power}->{total}++; - $self->{output}->output_add(long_msg => sprintf("Power '%s' sensor is %s [instance = %s] [description = %s]", - $result->{powerSensorName}, $result->{powerSensorValue}, $instance, - $result->{powerSensorDescription})); - - my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'fan', instance => $instance, value => $result->{powerSensorValue}); + $self->{output}->output_add( + long_msg => sprintf( + "power '%s' sensor is %s [instance: %s] [description: %s]", + $result->{powerSensorName}, $result->{powerSensorValue}, $instance, + $result->{powerSensorDescription} + ) + ); + + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'power', instance => $instance, value => $result->{powerSensorValue}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Power '%s' sensor is %s (Volt or Amp)", $result->{powerSensorName}, $result->{powerSensorValue})); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Power '%s' sensor is %s (Volt or Amp)", $result->{powerSensorName}, $result->{powerSensorValue}) + ); } + $self->{output}->perfdata_add( label => 'power', nlabel => 'hardware.power.sensor.count', diff --git a/src/storage/emc/isilon/snmp/mode/components/temperature.pm b/src/storage/emc/isilon/snmp/mode/components/temperature.pm index 29a7715f2..4e089cfb7 100644 --- a/src/storage/emc/isilon/snmp/mode/components/temperature.pm +++ b/src/storage/emc/isilon/snmp/mode/components/temperature.pm @@ -26,7 +26,7 @@ use warnings; my $mapping = { tempSensorName => { oid => '.1.3.6.1.4.1.12124.2.54.1.2' }, tempSensorDescription => { oid => '.1.3.6.1.4.1.12124.2.54.1.3' }, - tempSensorValue => { oid => '.1.3.6.1.4.1.12124.2.54.1.4' }, + tempSensorValue => { oid => '.1.3.6.1.4.1.12124.2.54.1.4' } }; my $oid_tempSensorEntry = '.1.3.6.1.4.1.12124.2.54.1'; @@ -52,23 +52,30 @@ sub check { next if ($self->check_filter(section => 'temperature', instance => $instance)); $self->{components}->{temperature}->{total}++; - $self->{output}->output_add(long_msg => sprintf("temperature '%s' is %s C [instance = %s] [description = %s]", - $result->{tempSensorName}, $result->{tempSensorValue}, $instance, - $result->{tempSensorDescription})); - + $self->{output}->output_add( + long_msg => sprintf( + "temperature '%s' is %s C [instance: %s] [description: %s]", + $result->{tempSensorName}, $result->{tempSensorValue}, $instance, + $result->{tempSensorDescription} + ) + ); + my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{tempSensorValue}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Temperature '%s' is %s C", $result->{tempSensorName}, $result->{tempSensorValue})); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf("Temperature '%s' is %s C", $result->{tempSensorName}, $result->{tempSensorValue}) + ); } + $self->{output}->perfdata_add( label => 'temperature', unit => 'C', nlabel => 'hardware.temperature.celsius', instances => $result->{tempSensorName}, value => $result->{tempSensorValue}, warning => $warn, - critical => $crit, + critical => $crit ); } }