Class Switch_SNMP

Description

This class is intended to perform SNMP queries to all kind of switches.

This class extends the Common class.

Located in /lib/Switch_SNMP.php (line 23)

Common
   |
   --Switch_SNMP
Method Summary
 Switch_SNMP __construct (mixed $ip)
 array getAllProps ()
 mixed getPortDescription (mixed $port, [mixed $port_index = false], [mixed $community = false])
 mixed getPortStatus (mixed $port, [mixed $port_index = false], [mixed $community = false])
 mixed getPortType (mixed $port, [mixed $port_index = false], [mixed $community = false])
 mixed getVlanOnPort (mixed $port, [mixed $port_index = false], [mixed $community = false])
 mixed getVlan_ID (mixed $vlan_name, [mixed $community = false])
 boolean programVlanOnPort (mixed $port_name, mixed $vlan_name, [mixed $community = false])
 boolean restartPort (mixed $port, [mixed $port_index = false], [mixed $community = false])
 boolean SetPortToDynamic (mixed $port_name, [mixed $community = false])
 boolean turnOffPort (mixed $port, [mixed $port_index = false], [mixed $community = false])
 boolean turnOnPort (mixed $port, [mixed $port_index = false], [mixed $community = false])
 mixed __call (mixed $methodName, array $parameters)
 mixed __get (mixed $key)
Variables

Inherited Variables

Inherited from Common

Common::$conf
Common::$db_conn
Common::$logger
Methods
Constructor __construct (line 464)

Initialize the Switch_SNMP object

  • access: public
Switch_SNMP __construct (mixed $ip)
  • mixed $ip: IP address of the switch

Redefinition of:
Common::__construct()
Get the current instance of our Settings and Logger classes
getAllProps (line 1021)

Return all properties assigned to this system. This method is here only for debugging purposes, please delete it after

  • return: All properties present
  • access: public
array getAllProps ()
getPortDescription (line 873)

Get the description for the specified port

  • return: The description of the port, false otherwise
  • access: public
mixed getPortDescription (mixed $port, [mixed $port_index = false], [mixed $community = false])
  • mixed $port: The port name
  • mixed $port_index: SNMP port index if available
  • mixed $community: SNMP community to use
getPortStatus (line 939)

Get the status for the specified port

  • return: The status associated to the port, false otherwise
  • access: public
mixed getPortStatus (mixed $port, [mixed $port_index = false], [mixed $community = false])
  • mixed $port: The port name
  • mixed $port_index: SNMP port index if available
  • mixed $community: SNMP community to use
getPortType (line 816)

Get port type for the specified port

  • return: The Vlan id if present on this switch, false otherwise
  • access: public
mixed getPortType (mixed $port, [mixed $port_index = false], [mixed $community = false])
  • mixed $port: The port name
  • mixed $port_index: SNMP port index if available
  • mixed $community: SNMP community to use
getVlanOnPort (line 906)

Get the vlan associated to the specified port

  • return: The vlan associated to the port, false otherwise
  • access: public
mixed getVlanOnPort (mixed $port, [mixed $port_index = false], [mixed $community = false])
  • mixed $port: The port name
  • mixed $port_index: SNMP port index if available
  • mixed $community: SNMP community to use
getVlan_ID (line 781)

Get the vlan id as declared in the switch for the requested vlan name

  • return: The Vlan id if present on this switch, false otherwise
  • access: public
mixed getVlan_ID (mixed $vlan_name, [mixed $community = false])
  • mixed $vlan_name: The name of the vlan we are interested in
  • mixed $community: SNMP community to use
programVlanOnPort (line 1129)

Program the specified vlan on the specified port

  • return: Result of the operation
  • access: public
boolean programVlanOnPort (mixed $port_name, mixed $vlan_name, [mixed $community = false])
  • mixed $port_name: The port name
  • mixed $vlan_name: Vlan name to program
  • mixed $community: SNMP community to use
restartPort (line 1107)

Turn on the specified port

  • return: Result of the operation
  • access: public
boolean restartPort (mixed $port, [mixed $port_index = false], [mixed $community = false])
  • mixed $port: The port name
  • mixed $port_index: SNMP port index if available
  • mixed $community: SNMP community to use
SetPortToDynamic (line 1211)

Set a port to VMPS

  • return: Result of the operation
  • access: public
boolean SetPortToDynamic (mixed $port_name, [mixed $community = false])
  • mixed $port_name: The port name
  • mixed $community: SNMP community to use
turnOffPort (line 1033)

Turn off the specified port

  • return: Result of the operation
  • access: public
boolean turnOffPort (mixed $port, [mixed $port_index = false], [mixed $community = false])
  • mixed $port: The port name
  • mixed $port_index: SNMP port index if available
  • mixed $community: SNMP community to use
turnOnPort (line 1070)

Turn on the specified port

  • return: Result of the operation
  • access: public
boolean turnOnPort (mixed $port, [mixed $port_index = false], [mixed $community = false])
  • mixed $port: The port name
  • mixed $port_index: SNMP port index if available
  • mixed $community: SNMP community to use
__call (line 979)

Interceptor to call the poll function associated to a certain property

with this interceptor is possible to do something like $object->property() and if property is already defined, it'll return its value. If not, it will call its associated function as long as there is a pollProperty method present in the class. Then it'll return the value of the property

  • return: The value of the requested property
  • access: public
mixed __call (mixed $methodName, array $parameters)
  • mixed $methodName: The name of the property we want to know
  • array $parameters: The parameters to use. Ideally only an SNMP community will be used
__get (line 1011)

Get the value of one property if it exists

  • return: The value of the wanted property, or false if such a property doesn't exist
  • access: public
mixed __get (mixed $key)
  • mixed $key: Property to lookup

Inherited Methods

Inherited From Common

 Common::__construct()
 Common::getConnection()
 Common::htmlescape()
 Common::log2db()
 Common::real_escape_string1()
 Common::sqlescape()

Documentation generated on Mon, 06 Oct 2008 01:10:45 +0200 by phpDocumentor 1.4.0