Skip to content

Commit df880d3

Browse files
authored
Merge pull request #311 from dcec/master
fix PSU sensors on Fortigate FortiOS 7.0 #310
2 parents 296dbf5 + 2744d22 commit df880d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugins-scripts/Classes/Fortigate/Component/SensorSubsystem.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ sub finish {
1717
my ($self) = @_;
1818
$self->{fgHwSensorEntAlarmStatus} ||= "false";
1919
$self->{fgHwSensorEntValue} = -1 if ! defined $self->{fgHwSensorEntValue};
20-
if ($self->{fgHwSensorEntValue} == -1) {
20+
if ( $self->{fgHwSensorEntValue} =~ /^-1$/) {
2121
# empty, this case is handled in the default sensor class
2222
} elsif ($self->{fgHwSensorEntName} =~ /Fan/) {
2323
bless $self, "Classes::Fortigate::Component::SensorSubsystem::Fan";
24-
} elsif ($self->{fgHwSensorEntName} =~ /PS.*Status/) {
24+
} elsif ($self->{fgHwSensorEntName} =~ /PS.*Status|PSU .*|RPS/) {
2525
bless $self, "Classes::Fortigate::Component::SensorSubsystem::Powersupply";
2626
} elsif ($self->{fgHwSensorEntName} =~ /(LM75)|(Temp)|(^(TD|TR)\d+)|(DTS\d+)/) {
2727
# thermal diode/resistor, dingsbums thermal sensor
@@ -37,7 +37,7 @@ $self->{UNKNOWN} = 1;
3737

3838
sub check {
3939
my ($self) = @_;
40-
if ($self->{fgHwSensorEntValue} == -1) {
40+
if ( $self->{fgHwSensorEntValue} =~ /^-1$/) {
4141
$self->add_info(sprintf '%s is not installed',
4242
$self->{fgHwSensorEntName});
4343
return;

0 commit comments

Comments
 (0)