Files
librenms-librenms/includes/discovery/sensors/temperature/ciscosb.inc.php
Jellyfrog b6620746c5 Miscellaneous cleanup - part 5 (#14502)
* Miscellaneous cleanup - part 5

* Update includes/discovery/sensors/pre-cache/ipoman.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>

* Update ipoman.inc.php

* string for trim()

* Update ciscosb.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-10-25 19:27:28 +02:00

35 lines
1.5 KiB
PHP

<?php
/*
* LibreNMS
*
* Copyright (c) 2017 Søren Friis Rosiak <sorenrosiak@gmail.com>
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
echo 'CiscoSB';
$multiplier = 1;
$divisor = 1;
foreach ($pre_cache['ciscosb_rlPhyTestGetResult'] as $index => $ciscosb_data) {
foreach ($ciscosb_data as $key => $value) {
if (! isset($value['rlPhyTestTableTransceiverTemp'])) {
continue;
}
$oid = '.1.3.6.1.4.1.9.6.1.101.90.1.2.1.3.' . $index . '.5';
$sensor_type = 'rlPhyTestTableTransceiverTemp';
$port_descr = get_port_by_index_cache($device['device_id'], preg_replace('/^\d+\./', '', $index));
$descr = trim(($port_descr['ifDescr'] ?? null) . ' Module');
$temperature = $value['rlPhyTestTableTransceiverTemp'];
$entPhysicalIndex = $index;
$entPhysicalIndex_measured = 'ports';
if (is_numeric($temperature) && ($value['rlPhyTestTableTransceiverSupply'] != 0)) {
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, $sensor_type, $descr, $divisor, $multiplier, null, null, null, null, $temperature, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
}
}
}