Add support for memory, power status and transceiver monitoring to Fiberstore S3900 series switches (#16225)

This commit is contained in:
Frederik Kriewitz
2024-07-19 19:39:39 +02:00
committed by GitHub
parent 090611f6c1
commit 23965cee49
7 changed files with 105943 additions and 0 deletions

View File

@@ -31,6 +31,26 @@ use LibreNMS\OS;
class FsSwitch extends OS implements ProcessorDiscovery
{
public static function normalizeTransceiverValues($value): float
{
// Convert fixed-point integer thresholds to float
$type = gettype($value);
if ($type === 'integer') {
// Thresholds are integers
$value /= 100.0;
}
return $value;
}
public static function normalizeTransceiverValuesCurrent($value): float
{
$value = FsSwitch::normalizeTransceiverValues($value);
$value *= 0.001; // mA to A
return $value;
}
/**
* Discover processors.
* Returns an array of LibreNMS\Device\Processor objects that have been discovered