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
stringThe target host for SNMP queries.
stringThe community to use for SNMP queries.
\OSS_SNMP\OSS_SNMPAn instance of $this (for fluent interfaces)cache() : boolean
booleanTrue of the local lookup cache is enabled. Otherwise false.disableCache() : \OSS_SNMP\SNMP
\OSS_SNMP\SNMPAn instance of this for fluent interfacesenableCache() : \OSS_SNMP\SNMP
\OSS_SNMP\SNMPAn instance of this for fluent interfacesget(string $oid) : mixed
stringThe OID to get
\OSS_SNMP\Exception |
On *any* SNMP error, warnings are supressed and a generic exception is thrown |
|---|
mixedThe resultant valuegetCache() : \OSS_SNMP\Cache
\OSS_SNMP\CacheThe cache objectgetCommunity() : string
stringThe community string currently in use.getHost() : string
stringThe target host as currently configured for SNMP queriesgetLastResult() : mixed
mixedThe unaltered original last SNMP resultgetPlatform()
getResultCache() : array
arrayThe internal result cachegetRetry() : string
stringThe SNMP query retry countgetTimeout() : int
intThe the SNMP query timeout (microseconds)parseSnmpValue(string $v) : mixed
stringThe value to parse
\OSS_SNMP\Exception |
|---|
mixedThe parsed valueppHexStringFlags(string $str) : array
stringThe hex string to parse
arrayThe array of true / false flags indexed from 1ppTruthValue(integer $value) : boolean
integerThe TruthValue ( 1 => true, 2 => false) to convert
booleanrealWalk(string $oid) : array
stringThe OID to walk
arrayThe results of the walksetCache(\OSS_SNMP\Cache $c) : \OSS_SNMP\SNMP
\OSS_SNMP\CacheThe cache to use
\OSS_SNMP\SNMPFor fluent interfacessetCommunity(string $c) : \OSS_SNMP\OSS_SNMP
stringThe community to use for SNMP queries.
\OSS_SNMP\OSS_SNMPAn instance of $this (for fluent interfaces)setHost(string $h) : \OSS_SNMP\SNMP
stringThe target host for SNMP queries.
\OSS_SNMP\SNMPAn instance of $this (for fluent interfaces)setOidOutputFormat(int $f) : \OSS_SNMP\OSS_SNMP\SNMP
intThe fomat to use
\OSS_SNMP\OSS_SNMP\SNMPAn instance of $this (for fluent interfaces)setRetry(int $r) : \OSS_SNMP\OSS_SNMP
intThe SNMP query retry count
\OSS_SNMP\OSS_SNMPAn instance of $this (for fluent interfaces)setTimeout(int $t) : \OSS_SNMP\OSS_SNMP
intThe timeout to use for SNMP queries (microseconds).
\OSS_SNMP\OSS_SNMPAn instance of $this (for fluent interfaces)subOidWalk(string $oid, int $position) : array
stringThe OID to walk
intThe 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 |
|---|
arrayThe resultant valuestranslate(mixed $values, array $translator) : mixed
mixedA scalar or array or values to translate
arrayAn associated array to use to translate the values
mixedThe translated scalar or arrayuseExtension(string $mib, array $args) : \OSS_SNMP\MIBS
stringThe extension class to use
array
\OSS_SNMP\MIBSwalk1d(string $oid) : array
stringThe OID to walk
\OSS_SNMPException |
On *any* SNMP error, warnings are supressed and a generic exception is thrown |
|---|
arrayThe resultant valueswalkIPv4(string $oid) : array
stringThe OID to walk
\OSS_SNMP\Exception |
On *any* SNMP error, warnings are supressed and a generic exception is thrown |
|---|
arrayThe 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
1000000OID_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