mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
bug - XDSL adslAtucCurrOutputPwr exception (Cisco CSCvj53634) (#15614)
* Cisco CSCvj53634 tests change RRD minimas to accept negative dbm output power unnecessary tests * unsignedAsSigned function * use new function Number::unsignedAsSigned * negative power for Vdsl as well * style * style * Add types * simplify and exception if over max value * Add tests * Style fixes * Tell phpstan to shut up --------- Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -137,6 +137,10 @@ class Xdsl implements Module
|
||||
// Values are 1/10
|
||||
foreach ($this->adslTenthValues as $oid) {
|
||||
if (isset($data[$oid])) {
|
||||
if ($oid == 'adslAtucCurrOutputPwr') {
|
||||
// workaround Cisco Bug CSCvj53634
|
||||
$data[$oid] = Number::unsignedAsSigned($data[$oid]);
|
||||
}
|
||||
$data[$oid] = $data[$oid] / 10;
|
||||
}
|
||||
}
|
||||
@@ -212,12 +216,12 @@ class Xdsl implements Module
|
||||
$rrd_def = RrdDefinition::make()
|
||||
->addDataset('AtucCurrSnrMgn', 'GAUGE', 0, 635)
|
||||
->addDataset('AtucCurrAtn', 'GAUGE', 0, 635)
|
||||
->addDataset('AtucCurrOutputPwr', 'GAUGE', 0, 635)
|
||||
->addDataset('AtucCurrOutputPwr', 'GAUGE', -100, 635)
|
||||
->addDataset('AtucCurrAttainableR', 'GAUGE', 0)
|
||||
->addDataset('AtucChanCurrTxRate', 'GAUGE', 0)
|
||||
->addDataset('AturCurrSnrMgn', 'GAUGE', 0, 635)
|
||||
->addDataset('AturCurrAtn', 'GAUGE', 0, 635)
|
||||
->addDataset('AturCurrOutputPwr', 'GAUGE', 0, 635)
|
||||
->addDataset('AturCurrOutputPwr', 'GAUGE', -100, 635)
|
||||
->addDataset('AturCurrAttainableR', 'GAUGE', 0)
|
||||
->addDataset('AturChanCurrTxRate', 'GAUGE', 0)
|
||||
->addDataset('AtucPerfLofs', 'COUNTER', null, 100000000000)
|
||||
@@ -298,8 +302,8 @@ class Xdsl implements Module
|
||||
'ifName' => $os->ifIndexToName($ifIndex),
|
||||
'rrd_name' => Rrd::portName($port->port_id, 'xdsl2LineStatusActAtp'),
|
||||
'rrd_def' => RrdDefinition::make()
|
||||
->addDataset('ds', 'GAUGE', 0)
|
||||
->addDataset('us', 'GAUGE', 0),
|
||||
->addDataset('ds', 'GAUGE', -100)
|
||||
->addDataset('us', 'GAUGE', -100),
|
||||
], [
|
||||
'ds' => $data['xdsl2LineStatusActAtpDs'] ?? null,
|
||||
'us' => $data['xdsl2LineStatusActAtpUs'] ?? null,
|
||||
|
Reference in New Issue
Block a user