Files
librenms-librenms/includes/polling/os/enexus.inc.php
Hayden 7c770a99d8 Fix 10853 os specific syslocation (#11082)
* added functionality to set sysLocation override in $os.inc.php files

* php styling fixes

* updated docs for location override in $os.inc.php

* patch poweralert.inc.php to use $location override

* added location override for enexus (Eltek)

* update phpdoc for set_device_location()

* converged location code in core.inc.php to use set_device_location()

* added new snmprec test data for enexus os

* Travis test data

* remove enexus_smartpacks2 test data

* Revert "remove enexus_smartpacks2 test data"

This reverts commit 36c8fc7036.

* updated enexus_smartpacks2 test data with generic syslocation

* kick travis CI

* kick travis CI
2020-04-02 23:28:12 +02:00

36 lines
1.3 KiB
PHP

<?php
/**
* enexus.inc.php
*
* -Description-
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2017 Barry O'Donovan
* @author BArry O'Donovan <barry@lightnet.ie>
*/
$location = snmp_get($device, 'powerSystemSite.0', '-Ovqa', 'SP2-MIB');
$hardware = snmp_get($device, 'powerSystemModel.0', '-Ovqa', 'SP2-MIB');
$sw_version1 = snmp_get($device, 'controlUnitSwVersion.1', '-Ovqa', 'SP2-MIB');
$sw_version2 = snmp_get($device, 'controlUnitSwVersion.2', '-Ovqa', 'SP2-MIB');
if (!empty($sw_version1)) {
$version = $sw_version1;
} elseif (!empty($sw_version2)) {
$version = $sw_version2;
}
$serial = snmp_get($device, 'powerSystemSerialNumber.0', '-Ovqa', 'SP2-MIB');