Class snmp

Description

SNMP

Located in /snmp.php (line 52)


	
			
Variable Summary
 mixed $timeout
 mixed $version
Method Summary
 snmp snmp ()
 integer assignRequestID ()
 string build_packet (mixed $varbind, [mixed $security = NULL], [string $type = 'get'], mixed $target, string $community, string $value, string $value_type)
 array build_varbind (string $oid, mixed $value, [string $type = 'n'])
 array bulk_get (string $host, array $oids, [array $security = NULL])
 array exec (array $hosts, string $type, mixed $varbind, [array $security = NULL], [string $stop = ''], string $packet)
 array get (string $host, mixed $target, [array $security = NULL])
 float microtime ()
 array multi_bulk_get (string $hosts, array $oids, [array $security = NULL])
 array multi_get (array $hosts, mixed $target, [array $security = NULL])
 void multi_set (array $hosts, mixed $target, mixed $value, [string $type = 'i'], [array $security = NULL])
 array multi_walk (array $hosts, sring $oid, [array $security = NULL])
 void set (string $host, mixed $target, mixed $value, [string $type = 'i'], [array $security = NULL])
 void trap (string $manager, array $security, mixed $varbind, [string $enterprise = ''], [string $agent = ''], integer $trap_type, integer $specific_trap_type, integer $timestamp, array $varbinds)
 array walk (string $host, string $oid, [array $security = NULL])
Variables
mixed $default_security (line 56)
mixed $timeout = 10.0 (line 55)
mixed $version = SNMP_VERSION_1 (line 54)
Methods
Constructor snmp (line 61)

Constructor

snmp snmp ()
assignRequestID (line 539)

Assign a unique requestID

  • return: a request id
integer assignRequestID ()
build_packet (line 302)

execute a poll on hosts

  • return: packet
string build_packet (mixed $varbind, [mixed $security = NULL], [string $type = 'get'], mixed $target, string $community, string $value, string $value_type)
  • mixed $target
  • string $community: string
  • string $type: is either get, getnext, or set
  • string $value: to use for set
  • string $value_type: to use for set
build_varbind (line 239)

build a variable binding

  • return: varbind
array build_varbind (string $oid, mixed $value, [string $type = 'n'])
  • string $oid: (oids must be numeric)
  • mixed $value: to set
  • string $type: 'i' = integer; 't' = time ticks; 'x' = hex string; 's' = string; 'a' = IP address; 'o' = object ID; 'n' = null value
bulk_get (line 112)

bulk get oids from a single host

  • return: in the format $oid=>$value
array bulk_get (string $host, array $oids, [array $security = NULL])
  • string $host: hostname or ip address
  • array $oids: (oids must be numeric)
  • array $security: parameters
exec (line 397)

execute a poll on hosts

  • return: in the format $ip=>array($oid=>$value)
array exec (array $hosts, string $type, mixed $varbind, [array $security = NULL], [string $stop = ''], string $packet)
  • array $hosts: hostnames or ip addresses
  • string $type: is either get, getnext, or set
  • string $packet: to send
  • array $security: parameters
  • string $stop
get (line 78)

get an oid from a single host

  • return: in the format $oid=>$value
array get (string $host, mixed $target, [array $security = NULL])
  • string $host: hostnames or ip addresses
  • mixed $target: varbind array or oid (oids must be numeric)
  • array $security: parameters
microtime (line 551)

Get microtime as a float

  • return: microtime
float microtime ()
multi_bulk_get (line 125)

bulk get oids from a mulitple hosts

  • return: in the format $oid=>$value
array multi_bulk_get (string $hosts, array $oids, [array $security = NULL])
  • string $hosts: hostnames or ip addresses
  • array $oids: (oids must be numeric)
  • array $security: parameters
multi_get (line 95)

get an oid from multiple hosts

  • return: in the format $ip=>array($oid=>$value)
array multi_get (array $hosts, mixed $target, [array $security = NULL])
  • array $hosts: hostnames or ip addresses
  • mixed $target: varbind array or oid (oids must be numeric)
  • array $security: parameters
multi_set (line 183)

set a variable

void multi_set (array $hosts, mixed $target, mixed $value, [string $type = 'i'], [array $security = NULL])
  • array $hosts: hostnames or ip addresses
  • mixed $target: varbind array or oid (oids must be numeric)
  • mixed $value: to set
  • string $type: 'i' = integer; 't' = time ticks; 'x' = hex string; 's' = string; 'a' = IP address; 'o' = object ID; 'n' = null value
  • array $security: parameters
multi_walk (line 151)

walk an oid on multiple hosts

  • return: in the format $ip=>array($oid=>$value)
array multi_walk (array $hosts, sring $oid, [array $security = NULL])
  • array $hosts: hostnames or ip addresses
  • sring $oid: (oids must be numeric)
  • array $security: parameters
set (line 165)

set a variable

void set (string $host, mixed $target, mixed $value, [string $type = 'i'], [array $security = NULL])
  • string $host: hostname or ip address
  • mixed $target: varbind array or oid (oids must be numeric)
  • mixed $value: to set
  • string $type: 'i' = integer; 't' = time ticks; 'x' = hex string; 's' = string; 'a' = IP address; 'o' = object ID; 'n' = null value
  • array $security: parameters
trap (line 202)

send a trap

void trap (string $manager, array $security, mixed $varbind, [string $enterprise = ''], [string $agent = ''], integer $trap_type, integer $specific_trap_type, integer $timestamp, array $varbinds)
  • string $manager: hostname or ip address of the manager
  • array $security: parameters
  • array $varbinds: created by build_varbind
  • string $enterprise: oid (oids must be numeric) of the object generating the trap (this is only for version 1)
  • string $agent: hostname or ip address of the agent generating the trap (this is only for version 1)
  • integer $trap_type: from TRAP_COLDSTART, TRAP_WARMSTART, TRAP_LINKDOWN, TRAP_LINKUP, TRAP_AUTH_FAIL, TRAP_EGP_NEIGHBOR_LOSS, TRAP_ENTERPRISE_SPECIFIC (this is only for version 1)
  • integer $specific_trap_type: (this is only for version 1)
  • integer $timestamp: time since last restart (this is only for version 1)
walk (line 138)

walk an oid

  • return: in the format $ip=>array($oid=>$value)
array walk (string $host, string $oid, [array $security = NULL])
  • string $host: hostnames or ip addresses
  • string $oid: (oids must be numeric)
  • array $security: parameters

Documentation generated on Mon, 14 Nov 2005 17:55:52 -0700 by phpDocumentor 1.3.0RC3