Created
December 6, 2016 02:15
-
-
Save murrant/d3aad3a0bd2709fc143423942b9dc5e9 to your computer and use it in GitHub Desktop.
Prototype snmp interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace LibreNMS; | |
class SNMP | |
{ | |
/** | |
* @param array $device | |
* @param string|array $oids single or array of oids to get | |
* @param string $mib Additional mibs to search, optionally you can specify full oid names | |
* @param string $mib_dir Additional mib directory, should be rarely needed, see definitions to add per os mib dirs | |
* @return array array or object of results, format to be determined | |
*/ | |
public static function get($device, $oids, $mib = null, $mib_dir = null) | |
{ | |
// return cached result or get from device | |
// parse data | |
// return formatted array or object | |
} | |
/** | |
* @param array $device | |
* @param string|array $oids single or array of oids to walk | |
* @param string $mib Additional mibs to search, optionally you can specify full oid names | |
* @param string $mib_dir Additional mib directory, should be rarely needed, see definitions to add per os mib dirs | |
* @return string exact results from snmpget | |
*/ | |
public static function getRaw($device, $oids, $options = null, $mib = null, $mib_dir = null) | |
{ | |
// snmpget data from device | |
} | |
/** | |
* @param array $device | |
* @param string|array $oids single or array of oids to walk | |
* @param string $mib Additional mibs to search, optionally you can specify full oid names | |
* @param string $mib_dir Additional mib directory, should be rarely needed, see definitions to add per os mib dirs | |
* @return array array or object of results, format to be determined | |
*/ | |
public static function walk($device, $oids, $mib = null, $mib_dir = null) | |
{ | |
// return cached result or get from device | |
// parse data | |
// return formatted array or object | |
} | |
/** | |
* @param array $device | |
* @param string $oid single oid to walk | |
* @param string $options Options to send to snmpwalk | |
* @param string $mib Additional mibs to search, optionally you can specify full oid names | |
* @param string $mib_dir Additional mib directory, should be rarely needed, see definitions to add per os mib dirs | |
* @return string exact results from snmpwalk | |
*/ | |
public static function walkRaw($device, $oid, $options = null, $mib = null, $mib_dir = null) | |
{ | |
// snmpwalk data from device | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment