From 175e23875680585fab1ceaf128b5192a16febae9 Mon Sep 17 00:00:00 2001 From: Quentin Garnier Date: Thu, 2 Oct 2014 16:47:11 +0200 Subject: [PATCH] + Better management for hardware fortigate (no really useful. because hardware is only for blade fortigate...) --- centreon/common/fortinet/fortigate/mode/hardware.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/centreon/common/fortinet/fortigate/mode/hardware.pm b/centreon/common/fortinet/fortigate/mode/hardware.pm index 75f73abf2..aba5b81b2 100644 --- a/centreon/common/fortinet/fortigate/mode/hardware.pm +++ b/centreon/common/fortinet/fortigate/mode/hardware.pm @@ -74,8 +74,9 @@ sub run { my $oid_fgHwSensorCount = '.1.3.6.1.4.1.12356.101.4.3.1.0'; my $result = $self->{snmp}->get_leef(oids => [$oid_sysDescr, $oid_fgSysVersion, $oid_fgHwSensorCount], nothing_quit => 1); - $self->{output}->output_add(long_msg => sprintf("[System: %s] [Firmware: %s]", $result->{$oid_sysDescr}, $result->{$oid_fgSysVersion})); - if ($result->{$oid_fgHwSensorCount} == 0) { + $self->{output}->output_add(long_msg => sprintf("[System: %s] [Firmware: %s]", $result->{$oid_sysDescr}, + defined($result->{$oid_fgSysVersion}) ? $result->{$oid_fgSysVersion} : 'unknown')); + if (!defined($result->{$oid_fgHwSensorCount}) || $result->{$oid_fgHwSensorCount} == 0) { $self->{output}->output_add(severity => 'UNKNOWN', short_msg => "No hardware sensors available."); $self->{output}->display();