pysnmp.compat.snmpy.snmpy
index
/home/mcfletch/pylive/pysnmp/compat/snmpy/snmpy.py

Compatibility interface to the snmpy package. The degree of compatibility
is mostly limited by the lack of MIB parser in PySNMP.
 
For more information on snmpy project, please, refer to
http://www.sf.net/projects/snmpy/
 
Copyright 1999-2002 by Ilya Etingof <ilya@glas.net>. See LICENSE for
details.
 
Initial copyrights for prototype code and API are as follows:
 
Written by Anthony Baxter, arb@connect.com.au
Copyright (C) 1994,1995,1996 Anthony Baxter.
 
Modified extensively by Tim O'Malley, timo@bbn.com.
The changes are Copyright (C) 1996 of BBN.
 
Permission is hereby granted, free of charge, to any person obtaining
a copy of this source file to use, copy, modify, merge, or publish it
subject to the following conditions:
 
The above copyright notice and this permission notice shall be included
in all copies or in any new file that contains a substantial portion of
this file.
 
THE  AUTHOR  MAKES  NO  REPRESENTATIONS ABOUT  THE  SUITABILITY  OF
THE  SOFTWARE FOR  ANY  PURPOSE.  IT IS  PROVIDED  "AS IS"  WITHOUT
EXPRESS OR  IMPLIED WARRANTY.  THE AUTHOR DISCLAIMS  ALL WARRANTIES
WITH  REGARD TO  THIS  SOFTWARE, INCLUDING  ALL IMPLIED  WARRANTIES
OF   MERCHANTABILITY,  FITNESS   FOR  A   PARTICULAR  PURPOSE   AND
NON-INFRINGEMENT  OF THIRD  PARTY  RIGHTS. IN  NO  EVENT SHALL  THE
AUTHOR  BE LIABLE  TO  YOU  OR ANY  OTHER  PARTY  FOR ANY  SPECIAL,
INDIRECT,  OR  CONSEQUENTIAL  DAMAGES  OR  ANY  DAMAGES  WHATSOEVER
WHETHER IN AN  ACTION OF CONTRACT, NEGLIGENCE,  STRICT LIABILITY OR
ANY OTHER  ACTION ARISING OUT OF  OR IN CONNECTION WITH  THE USE OR
PERFORMANCE OF THIS SOFTWARE.

 
Modules
       
pysnmp.asn1.base
pysnmp
pysnmp.mapping.udp.role
pysnmp.proto.v1

 
Classes
       
Exception
SnmpError
SnmpTimeout
CompatBase
SNMP_Session
snmpmibnode
snmptrap

 
class CompatBase
    Base class for compatibility classes
 
 

 
class SNMP_Session(CompatBase)
    SNMP session object
 
  Methods defined here:
__init__(self, hostname, community='public', remote_port=0, local_port=0, retries=0, timeout=0, callback=None)
Initialize transport layer, store passed args
fileno(self)
Return transport fileno
get(self, oid)
Perform SNMP GET request
getnext(self, oid)
Perform SNMP GETNEXT request
mibnode(self, name, extension=None)
Return a MIBNODE object
read(self)
Read SNMP response from transport level, decode it and
invoke the callback routine
set(self, oid, val, valType='string')
Perform SNMP SET request
thepowerfulgetnext = getnext(self, oid)

 
class SnmpError(Exception)
    # Module exceptions
 
  Methods inherited from Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
class SnmpTimeout(Exception)
     Methods inherited from Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
class snmpmibnode(CompatBase)
    A single MIB object (variable-binding)
 
  Methods defined here:
__getattr__(self, attr)
Translate some attributes
__getitem__(self, key)
Support creating child OIDs by subscription
__init__(self, parent, name, extension)
Class constructor: initialize object internals from passed OID
__len__(self)
Returns number of sub-OIDs in SNMP table (can't be implemented
w/o MIB parser)
__repr__(self)
Try to look similar to original implementation
__setattr__(self, attr, val)
Set certain attributes
__setitem__(self, key, value)
Support creating child OIDs by subscription
enums(self)
Not clear what this does so far
get(self)
Indirect GET request access to parent session object
getnext(self)
Indirect GETNEXT request access to parent session object
nodes(self)
Return child sub-nodes
oidlist(self)
Return a list of sub-OIDs
set(self, val)
Indirect SET request access to parent session object

 
class snmptrap(CompatBase)
    A SNMP TRAP request object
 
  Methods defined here:
__getattr__(self, attr)
Translate some attributes
__init__(self, parent, addr, name, trap_type, specific_type, uptime, varbind)
Class constructor: initialize object internals from passed params
__repr__(self)
Try to look similar to original implementation
__setattr__(self, attr, val)
Set certain attributes

 
Functions
       
addmibdir()
Add a path to MIB search path
checkoid(oid)
Return true if given OID is syntaxically valid XXX
handletimeout()
Expire long pending SNMP requests
issuboid(miboid1, miboid2)
Compare two MIB oids, return 1 if equal
merge(filename)
Load and parse MIB file
session(hostname, community, remote_port, local_port, retries, timeout, callback=None)
Return SNMP session object
time(...)
time() -> floating point number
 
Return the current time in seconds since the Epoch.
Fractions of a second may be present if the system clock provides them.
timeout()
Return the estimated time till timeout

 
Data
        SNMP_TRAP_PORT = 162
pendingSessions = {}
version = 0.72999999999999998