enhance mikrotik (#2299)
This commit is contained in:
parent
a6940392bf
commit
4509782456
|
@ -68,15 +68,7 @@ sub check {
|
||||||
|
|
||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => 0);
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => 0);
|
||||||
|
|
||||||
if (defined($result->{mtxrHlCurrent}) && $result->{mtxrHlCurrent} =~ /[0-9]+/) {
|
my $gauge_ok = 0;
|
||||||
check_current(
|
|
||||||
$self,
|
|
||||||
value => $result->{mtxrHlCurrent} / 100,
|
|
||||||
instance => 1,
|
|
||||||
name => 'system'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (keys %{$self->{results}}) {
|
foreach (keys %{$self->{results}}) {
|
||||||
next if (! /^$mapping_gauge->{unit}->{oid}\.(\d+)/);
|
next if (! /^$mapping_gauge->{unit}->{oid}\.(\d+)/);
|
||||||
next if ($map_gauge_unit->{ $self->{results}->{$_} } ne 'dA');
|
next if ($map_gauge_unit->{ $self->{results}->{$_} } ne 'dA');
|
||||||
|
@ -88,6 +80,16 @@ sub check {
|
||||||
instance => $1,
|
instance => $1,
|
||||||
name => $result->{name}
|
name => $result->{name}
|
||||||
);
|
);
|
||||||
|
$gauge_ok = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($gauge_ok == 0 && defined($result->{mtxrHlCurrent}) && $result->{mtxrHlCurrent} =~ /[0-9]+/) {
|
||||||
|
check_current(
|
||||||
|
$self,
|
||||||
|
value => $result->{mtxrHlCurrent} / 100,
|
||||||
|
instance => 1,
|
||||||
|
name => 'system'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,19 +67,22 @@ sub check {
|
||||||
return if ($self->check_filter(section => 'fan'));
|
return if ($self->check_filter(section => 'fan'));
|
||||||
|
|
||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => 0);
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => 0);
|
||||||
if (defined($result->{mtxrHlFanSpeed1}) && $result->{mtxrHlFanSpeed1} =~ /[0-9]+/) {
|
|
||||||
check_fan($self, value => $result->{mtxrHlFanSpeed1}, instance => 1);
|
|
||||||
}
|
|
||||||
if (defined($result->{mtxrHlFanSpeed2}) && $result->{mtxrHlFanSpeed2} =~ /[0-9]+/) {
|
|
||||||
check_fan($self, value => $result->{mtxrHlFanSpeed2}, instance => 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
my $gauge_ok = 0;
|
||||||
foreach (keys %{$self->{results}}) {
|
foreach (keys %{$self->{results}}) {
|
||||||
next if (! /^$mapping_gauge->{unit}->{oid}\.(\d+)/);
|
next if (! /^$mapping_gauge->{unit}->{oid}\.(\d+)/);
|
||||||
next if ($map_gauge_unit->{ $self->{results}->{$_} } ne 'rpm');
|
next if ($map_gauge_unit->{ $self->{results}->{$_} } ne 'rpm');
|
||||||
|
|
||||||
$result = $self->{snmp}->map_instance(mapping => $mapping_gauge, results => $self->{results}, instance => $1);
|
$result = $self->{snmp}->map_instance(mapping => $mapping_gauge, results => $self->{results}, instance => $1);
|
||||||
check_fan($self, value => $result->{value}, instance => $result->{name});
|
check_fan($self, value => $result->{value}, instance => $result->{name});
|
||||||
|
$gauge_ok = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($gauge_ok == 0 && defined($result->{mtxrHlFanSpeed1}) && $result->{mtxrHlFanSpeed1} =~ /[0-9]+/) {
|
||||||
|
check_fan($self, value => $result->{mtxrHlFanSpeed1}, instance => 1);
|
||||||
|
}
|
||||||
|
if ($gauge_ok == 0 && defined($result->{mtxrHlFanSpeed2}) && $result->{mtxrHlFanSpeed2} =~ /[0-9]+/) {
|
||||||
|
check_fan($self, value => $result->{mtxrHlFanSpeed2}, instance => 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,15 +98,7 @@ sub check {
|
||||||
check_psu($self, value => $result->{mtxrHlPowerSupplyState}, type => 'primary');
|
check_psu($self, value => $result->{mtxrHlPowerSupplyState}, type => 'primary');
|
||||||
check_psu($self, value => $result->{mtxrHlBackupPowerSupplyState}, type => 'backup');
|
check_psu($self, value => $result->{mtxrHlBackupPowerSupplyState}, type => 'backup');
|
||||||
|
|
||||||
if (defined($result->{mtxrHlPower}) && $result->{mtxrHlPower} =~ /[0-9]+/) {
|
my $gauge_ok = 0;
|
||||||
check_power(
|
|
||||||
$self,
|
|
||||||
value => $result->{mtxrHlPower} / 100,
|
|
||||||
instance => 1,
|
|
||||||
name => 'system'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (keys %{$self->{results}}) {
|
foreach (keys %{$self->{results}}) {
|
||||||
next if (! /^$mapping_gauge->{unit}->{oid}\.(\d+)/);
|
next if (! /^$mapping_gauge->{unit}->{oid}\.(\d+)/);
|
||||||
next if ($map_gauge_unit->{ $self->{results}->{$_} } ne 'dW');
|
next if ($map_gauge_unit->{ $self->{results}->{$_} } ne 'dW');
|
||||||
|
@ -118,6 +110,16 @@ sub check {
|
||||||
instance => $1,
|
instance => $1,
|
||||||
name => $result->{name}
|
name => $result->{name}
|
||||||
);
|
);
|
||||||
|
$gauge_ok = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($gauge_ok == 0 && defined($result->{mtxrHlPower}) && $result->{mtxrHlPower} =~ /[0-9]+/) {
|
||||||
|
check_power(
|
||||||
|
$self,
|
||||||
|
value => $result->{mtxrHlPower} / 100,
|
||||||
|
instance => 1,
|
||||||
|
name => 'system'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,25 +72,7 @@ sub check {
|
||||||
|
|
||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => 0);
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => 0);
|
||||||
|
|
||||||
if (defined($result->{mtxrHlTemperature}) && $result->{mtxrHlTemperature} =~ /[0-9]+/) {
|
my $gauge_ok = 0;
|
||||||
check_temperature(
|
|
||||||
$self,
|
|
||||||
value => $result->{mtxrHlTemperature} / 10,
|
|
||||||
instance => 1,
|
|
||||||
name => 'system',
|
|
||||||
description => 'system temperature (SoC or PCB)'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (defined($result->{mtxrHlProcessorTemperature}) && $result->{mtxrHlProcessorTemperature} =~ /[0-9]+/) {
|
|
||||||
check_temperature(
|
|
||||||
$self,
|
|
||||||
value => $result->{mtxrHlProcessorTemperature} / 10,
|
|
||||||
instance => 2,
|
|
||||||
name => 'processor',
|
|
||||||
description => 'processor temperature'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (keys %{$self->{results}}) {
|
foreach (keys %{$self->{results}}) {
|
||||||
next if (! /^$mapping_gauge->{unit}->{oid}\.(\d+)/);
|
next if (! /^$mapping_gauge->{unit}->{oid}\.(\d+)/);
|
||||||
next if ($map_gauge_unit->{ $self->{results}->{$_} } ne 'celsius');
|
next if ($map_gauge_unit->{ $self->{results}->{$_} } ne 'celsius');
|
||||||
|
@ -103,6 +85,26 @@ sub check {
|
||||||
name => $result->{name},
|
name => $result->{name},
|
||||||
description => "sensor temperature '$result->{name}'"
|
description => "sensor temperature '$result->{name}'"
|
||||||
);
|
);
|
||||||
|
$gauge_ok = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($gauge_ok == 0 && defined($result->{mtxrHlTemperature}) && $result->{mtxrHlTemperature} =~ /[0-9]+/) {
|
||||||
|
check_temperature(
|
||||||
|
$self,
|
||||||
|
value => $result->{mtxrHlTemperature} / 10,
|
||||||
|
instance => 1,
|
||||||
|
name => 'system',
|
||||||
|
description => 'system temperature (SoC or PCB)'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if ($gauge_ok == 0 && defined($result->{mtxrHlProcessorTemperature}) && $result->{mtxrHlProcessorTemperature} =~ /[0-9]+/) {
|
||||||
|
check_temperature(
|
||||||
|
$self,
|
||||||
|
value => $result->{mtxrHlProcessorTemperature} / 10,
|
||||||
|
instance => 2,
|
||||||
|
name => 'processor',
|
||||||
|
description => 'processor temperature'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,15 +67,8 @@ sub check {
|
||||||
return if ($self->check_filter(section => 'voltage'));
|
return if ($self->check_filter(section => 'voltage'));
|
||||||
|
|
||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => 0);
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}, instance => 0);
|
||||||
if (defined($result->{mtxrHlVoltage}) && $result->{mtxrHlVoltage} =~ /[0-9]+/) {
|
|
||||||
check_voltage(
|
|
||||||
$self,
|
|
||||||
value => $result->{mtxrHlVoltage} / 10,
|
|
||||||
instance => 1,
|
|
||||||
name => 'system'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
my $gauge_ok = 0;
|
||||||
foreach (keys %{$self->{results}}) {
|
foreach (keys %{$self->{results}}) {
|
||||||
next if (! /^$mapping_gauge->{unit}->{oid}\.(\d+)/);
|
next if (! /^$mapping_gauge->{unit}->{oid}\.(\d+)/);
|
||||||
next if ($map_gauge_unit->{ $self->{results}->{$_} } ne 'dV');
|
next if ($map_gauge_unit->{ $self->{results}->{$_} } ne 'dV');
|
||||||
|
@ -87,6 +80,16 @@ sub check {
|
||||||
instance => $1,
|
instance => $1,
|
||||||
name => $result->{name}
|
name => $result->{name}
|
||||||
);
|
);
|
||||||
|
$gauge_ok = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($gauge_ok == 0 && defined($result->{mtxrHlVoltage}) && $result->{mtxrHlVoltage} =~ /[0-9]+/) {
|
||||||
|
check_voltage(
|
||||||
|
$self,
|
||||||
|
value => $result->{mtxrHlVoltage} / 10,
|
||||||
|
instance => 1,
|
||||||
|
name => 'system'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue