A class for performing SNMP V2 queries and processing the results.
copyright | Copyright (c) 2012, Open Source Solutions Limited, Dublin, Ireland |
---|---|
author | Barry O'Donovan |
__call(string $method, array $args)
string
array
\OSS_SNMP\Exception |
---|
__construct(string $host= '127.0.0.1'
, string $community= 'public'
) : \OSS_SNMP\OSS_SNMP
string
The target host for SNMP queries.
string
The community to use for SNMP queries.
\OSS_SNMP\OSS_SNMP
An instance of $this (for fluent interfaces)cache() : boolean
boolean
True of the local lookup cache is enabled. Otherwise false.disableCache() : \OSS_SNMP\SNMP
\OSS_SNMP\SNMP
An instance of this for fluent interfacesenableCache() : \OSS_SNMP\SNMP
\OSS_SNMP\SNMP
An instance of this for fluent interfacesget(string $oid) : mixed
string
The OID to get
\OSS_SNMP\Exception |
On *any* SNMP error, warnings are supressed and a generic exception is thrown |
---|
mixed
The resultant valuegetCache() : \OSS_SNMP\Cache
\OSS_SNMP\Cache
The cache objectgetCommunity() : string
string
The community string currently in use.getHost() : string
string
The target host as currently configured for SNMP queriesgetLastResult() : mixed
mixed
The unaltered original last SNMP resultgetPlatform()
getResultCache() : array
array
The internal result cachegetRetry() : string
string
The SNMP query retry countgetTimeout() : int
int
The the SNMP query timeout (microseconds)parseSnmpValue(string $v) : mixed
string
The value to parse
\OSS_SNMP\Exception |
---|
mixed
The parsed valueppHexStringFlags(string $str) : array
string
The hex string to parse
array
The array of true / false flags indexed from 1ppTruthValue(integer $value) : boolean
integer
The TruthValue ( 1 => true, 2 => false) to convert
boolean
realWalk(string $oid) : array
string
The OID to walk
array
The results of the walksetCache(\OSS_SNMP\Cache $c) : \OSS_SNMP\SNMP
\OSS_SNMP\Cache
The cache to use
\OSS_SNMP\SNMP
For fluent interfacessetCommunity(string $c) : \OSS_SNMP\OSS_SNMP
string
The community to use for SNMP queries.
\OSS_SNMP\OSS_SNMP
An instance of $this (for fluent interfaces)setHost(string $h) : \OSS_SNMP\SNMP
string
The target host for SNMP queries.
\OSS_SNMP\SNMP
An instance of $this (for fluent interfaces)setOidOutputFormat(int $f) : \OSS_SNMP\OSS_SNMP\SNMP
int
The fomat to use
\OSS_SNMP\OSS_SNMP\SNMP
An instance of $this (for fluent interfaces)setRetry(int $r) : \OSS_SNMP\OSS_SNMP
int
The SNMP query retry count
\OSS_SNMP\OSS_SNMP
An instance of $this (for fluent interfaces)setTimeout(int $t) : \OSS_SNMP\OSS_SNMP
int
The timeout to use for SNMP queries (microseconds).
\OSS_SNMP\OSS_SNMP
An instance of $this (for fluent interfaces)subOidWalk(string $oid, int $position) : array
string
The OID to walk
int
The position of the OID to use as the key
\OSS_SNMP\Exception |
On *any* SNMP error, warnings are supressed and a generic exception is thrown |
---|
array
The resultant valuestranslate(mixed $values, array $translator) : mixed
mixed
A scalar or array or values to translate
array
An associated array to use to translate the values
mixed
The translated scalar or arrayuseExtension(string $mib, array $args) : \OSS_SNMP\MIBS
string
The extension class to use
array
\OSS_SNMP\MIBS
walk1d(string $oid) : array
string
The OID to walk
\OSS_SNMPException |
On *any* SNMP error, warnings are supressed and a generic exception is thrown |
---|
array
The resultant valueswalkIPv4(string $oid) : array
string
The OID to walk
\OSS_SNMP\Exception |
On *any* SNMP error, warnings are supressed and a generic exception is thrown |
---|
array
The resultant values$HEX_STRING_WORDS_AS_ARRAY
array('0' => array(false, false, false, false), '1' => array(false, false, false, true), '2' => array(false, false, true, false), '3' => array(false, false, true, true), '4' => array(false, true, false, false), '5' => array(false, true, false, true), '6' => array(false, true, true, false), '7' => array(false, true, true, true), '8' => array(true, false, false, false), '9' => array(true, false, false, true), 'a' => array(true, false, true, false), 'b' => array(true, false, true, true), 'c' => array(true, true, false, false), 'd' => array(true, true, false, true), 'e' => array(true, true, true, false), 'f' => array(true, true, true, true))
$SNMP_TRUTHVALUES : array
array(self::SNMP_TRUTHVALUE_TRUE => true, self::SNMP_TRUTHVALUE_FALSE => false)
$_cache : \OSS_SNMP\Cache
null
$_community : string
$_disableCache
false
$_host : string
$_lastResult : mixed
null
$_platform : mixed
null
$_retry : int
5
$_timeout : int
1000000
OID_OUTPUT_FULL = SNMP_OID_OUTPUT_FULL : \OSS_SNMP\SNMP
OID_OUTPUT_NUMERIC = SNMP_OID_OUTPUT_NUMERIC : \OSS_SNMP\SNMP
SNMP_TRUTHVALUE_FALSE = 2 : \OSS_SNMP\Definition
SNMP_TRUTHVALUE_TRUE = 1 : \OSS_SNMP\Definition