mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	* Added sensors for outlets on Schleifenbauer devices. Also use the outlet name when configured. * Updated tests for Schleifenbauer * Fixed on test for Schleifenbauer * Optimized polling by retriving only outlets from the device with the network connection, not all devices on the data-bus. * Fixed code styling * Use shorthand comparisons for names * Fix for conflicting $entPhysicalIndex
		
			
				
	
	
		
			63 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
/*
 | 
						|
 * LibreNMS
 | 
						|
 *
 | 
						|
 * Copyright (c) 2018 Martijn Schmidt <martijn.schmidt@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 'sdbMgmtCtrlDevUnitAddress ';
 | 
						|
$pre_cache['sdbMgmtCtrlDevUnitAddress'] = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.1.2.4.1.2', 1));
 | 
						|
 | 
						|
echo 'sdbDevIdSerialNumber ';
 | 
						|
$pre_cache['sdbDevIdSerialNumber']      = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.1.1.1.6', 1));
 | 
						|
 | 
						|
echo 'sdbDevInName ';
 | 
						|
$pre_cache['sdbDevInName']              = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.6.1.1.13', 2));
 | 
						|
 | 
						|
echo 'sdbDevInActualVoltage ';
 | 
						|
$pre_cache['sdbDevInActualVoltage']     = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.6.1.1.7', 2));
 | 
						|
 | 
						|
echo 'sdbDevInActualCurrent ';
 | 
						|
$pre_cache['sdbDevInActualCurrent']     = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.6.1.1.5', 2));
 | 
						|
 | 
						|
echo 'sdbDevInMaxAmps ';
 | 
						|
$pre_cache['sdbDevInMaxAmps']           = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.6.1.1.11', 2));
 | 
						|
 | 
						|
echo 'sdbDevCfMaximumLoad ';
 | 
						|
$pre_cache['sdbDevCfMaximumLoad']       = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.2.1.1.6', 1));
 | 
						|
 | 
						|
echo 'sdbDevInPowerVoltAmpere ';
 | 
						|
$pre_cache['sdbDevInPowerVoltAmpere']   = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.6.1.1.9', 2));
 | 
						|
 | 
						|
echo 'sdbDevInKWhTotal ';
 | 
						|
$pre_cache['sdbDevInKWhTotal']          = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.6.1.1.2', 2));
 | 
						|
 | 
						|
echo 'sdbDevInPowerFactor ';
 | 
						|
$pre_cache['sdbDevInPowerFactor']       = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.6.1.1.4', 2));
 | 
						|
 | 
						|
echo 'sdbDevOutName ';
 | 
						|
$pre_cache['sdbDevOutName']             = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.7.1.1.2.' . current($pre_cache['sdbMgmtCtrlDevUnitAddress']), 1));
 | 
						|
 | 
						|
echo 'sdbDevOutMtActualVoltage ';
 | 
						|
$pre_cache['sdbDevOutMtActualVoltage']  = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.7.2.1.7.'  . current($pre_cache['sdbMgmtCtrlDevUnitAddress']), 1));
 | 
						|
 | 
						|
echo 'sdbDevOutMtActualCurrent ';
 | 
						|
$pre_cache['sdbDevOutMtActualCurrent']  = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.7.2.1.5.' . current($pre_cache['sdbMgmtCtrlDevUnitAddress']), 1));
 | 
						|
 | 
						|
echo 'sdbDevOutMtMaxAmps ';
 | 
						|
$pre_cache['sdbDevOutMtMaxAmps']        = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.7.2.1.8.' . current($pre_cache['sdbMgmtCtrlDevUnitAddress']), 1));
 | 
						|
 | 
						|
echo 'sdbDevOutMtPowerVoltAmpere ';
 | 
						|
$pre_cache['sdbDevOutMtPowerVoltAmpere']= current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.7.2.1.10.' . current($pre_cache['sdbMgmtCtrlDevUnitAddress']), 1));
 | 
						|
 | 
						|
echo 'sdbDevOutMtKWhTotal ';
 | 
						|
$pre_cache['sdbDevOutMtKWhTotal']       = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.7.2.1.2.' . current($pre_cache['sdbMgmtCtrlDevUnitAddress']), 1));
 | 
						|
 | 
						|
echo 'sdbDevOutMtPowerFactor ';
 | 
						|
$pre_cache['sdbDevOutMtPowerFactor']    = current(snmpwalk_array_num($device, '.1.3.6.1.4.1.31034.12.1.1.2.7.2.1.4.' . current($pre_cache['sdbMgmtCtrlDevUnitAddress']), 1));
 |