{"id":24479484,"url":"https://github.com/bluecmd/python3-netsnmp","last_synced_at":"2025-04-13T14:21:22.480Z","repository":{"id":13484935,"uuid":"74564876","full_name":"bluecmd/python3-netsnmp","owner":"bluecmd","description":"Python3 port of the Net-SNMP bindings","archived":false,"fork":false,"pushed_at":"2024-01-18T12:54:44.000Z","size":45,"stargazers_count":16,"open_issues_count":12,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T09:09:48.528Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.net-snmp.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bluecmd.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-23T10:14:18.000Z","updated_at":"2024-01-20T12:46:58.000Z","dependencies_parsed_at":"2024-06-19T16:02:11.844Z","dependency_job_id":"aa6a5436-5faf-441c-b7a4-1e4072eff168","html_url":"https://github.com/bluecmd/python3-netsnmp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluecmd%2Fpython3-netsnmp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluecmd%2Fpython3-netsnmp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluecmd%2Fpython3-netsnmp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluecmd%2Fpython3-netsnmp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bluecmd","download_url":"https://codeload.github.com/bluecmd/python3-netsnmp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248725098,"owners_count":21151627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-21T10:16:15.779Z","updated_at":"2025-04-13T14:21:22.441Z","avatar_url":"https://github.com/bluecmd.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\t\t  The Python 'netsnmp' Extension Module\n\t\t      for the Net-SNMP Library\n\nContents:\n   Introduction:\n   Availability:\n   Contact:\n   Supported Platforms:\n   Release Notes:\n   Installation:\n   Operational Description:\n   Trouble Shooting:\n   Acknowledgments:\n   License/Copyright:\n\nIntroduction:\n\n   This is the Python 'netsnmp' extension module. The 'netsnmp' module\n   provides a full featured, tri-lingual SNMP (SNMPv3, SNMPv2c,\n   SNMPv1) client API. The 'netsnmp' module internals rely on the\n   Net-SNMP toolkit library. For information on the Net-SNMP library\n   see the documentation provided with the Net-SNMP distribution or\n   the project web page available on 'Source Forge':\n\n   http://www.net-snmp.org/\n\nAvailability:\n\n   The most recent release of the Python 'netsnmp' module can be found\n   bundled with the latest Net-SNMP distribution available from:\n\n     http://www.net-snmp.org/download.html\n\nContact:\n\n   The following mailing list should be consider the primary support\n   mechanism for this module:\n\n   net-snmp-users@lists.sourceforge.net mail list\n\n   (see http://www.net-snmp.org/lists/users/ to subscribe)\n\nSupported Platforms:\n\n   Linux 2.x\n   Other UNIX/POSIX variants (untested)\n   MS Windows (untested)\n\n   Let us know where it *doesn't* work, as it should on most systems\n\nRelease Notes:\n\n   This initial alpha release of the Python 'netsnmp' extension module\n   has been developed against net-snmp 5.4.pre1.\n\n   Only syncronous, client-side functionality is implemented.\n\n   Access to the parsed MIB database is not yet implemented.\n\nKNOWN BUGS:\n\n   Too many to mention at this point\n\nInstallation:\n\n   Build and install the Net-SNMP package - see Net-SNMP README and\n   INSTALL docs.\n\n   Unix:\n\n   cd net-snmp/python\n   python setup.py build\n   python setup.py test (requires a locally running agent w/ config provided)\n   python setup.py install\n\n\nOperational Description:\n\n   The basic operations of the SNMP protocol are provided by this\n   module through an object oriented interface for modularity and ease\n   of use.  The primary class is netsnmp.Session which encapsulates\n   the persistent aspects of a connection between the management\n   application and the managed agent. This class supplies 'get',\n   'getnext', 'getbulk', 'set' and other method calls. \n\n   A description of the fields which can be specified when instantiating an\n   netsnmp.Session follows:\n\n   netsnmp.Session(\u003ctag\u003e=\u003cvalue\u003e, ... )\n\n    DestHost    - default 'localhost', hostname or ip addr of SNMP agent\n    Version     - default '3', [1, 2 (equiv to 2c), 3]\n    RemotePort  - default '161', allow remote UDP port to be overridden\n    Timeout     - default '500000', micro-seconds before retry\n    Retries     - default '3', retries before failure\n    RetryNoSuch - default '0', if enabled NOSUCH errors in 'get' pdus will\n                  be repaired, removing the varbind in error, and resent -\n                  undef will be returned for all NOSUCH varbinds, when set\n                  to '0' this feature is disabled and the entire get request\n                  will fail on any NOSUCH error (applies to v1 only)\n    UseLongNames - set to non-zero to have \u003ctags\u003e for 'getnext' methods \n                  generated preferring longer Mib name convention (e.g., \n\t\t  system.sysDescr vs just sysDescr)\n    UseSprintValue - set to non-zero to have return values\n                  for 'get' and 'getnext' methods formatted with the libraries\n                  sprint_value function. This will result in certain data types\n                  being returned in non-canonical format Note: values returned\n                  with this option set may not be appropriate for 'set' \n                  operations (see discussion of value formats in \u003cvars\u003e \n                  description section)\n    UseEnums    - set to non-zero to have integer return values\n                  converted to enumeration identifiers if possible, \n                  these values will also be acceptable when supplied to \n                  'set' operations\n    UseNumeric  - set to non-zero to have \u003ctags\u003e returned by the 'get'\n                  methods untranslated (i.e. dotted-decimal).  Setting the\n                  UseLongNames value for the session is highly recommended.\n    BestGuess   - this setting controls how \u003ctags\u003e are parsed.  setting \n                  to 0 causes a regular lookup.  setting to 1 causes a regular \n                  expression match (defined as -Ib in snmpcmd). setting to 2 \n                  causes a random access lookup (defined as -IR in snmpcmd).\n    ErrorStr    - read-only, holds the error message assoc. w/ last request\n    ErrorNum    - read-only, holds the snmp_err or status of last request\n    ErrorInd    - read-only, holds the snmp_err_index when appropriate\n\n   SNMPv1/SNMPv2c options:\n    Community   - default 'public', SNMP community string (used for both R/W)\n\n   SNMPv3 Options:\n    SecName     - default 'initial', security name (v3)\n    SecLevel    - default 'noAuthNoPriv', security level [noAuthNoPriv,\n                  authNoPriv, authPriv] (v3)\n    ContextEngineId - default \u003cSecEngineId\u003e, context engineID, will be\n                      probed if not supplied (v3)\n    Context     - default '', context name (v3)\n\n   SNMPv3 over TLS or DTLS options:\n    OurIdentity   - The fingerprint or file name for the local X.509\n                    certificate to use for our identity.  Run\n                    net-snmp-cert to create and manage certificates.\n    TheirIdentity - The fingerprint or file name for the local X.509\n                    certificate to use for their identity.  \n    TrustCert     - A trusted certificate to use for validating\n                    certificates.  Typically this would be a CA\n                    certificate.\n    TheirHostname - Their hostname to expect.  Either \"TheirIdentity\"\n    \t\t    or a trusted certificate plus a hostname is needed\n    \t\t    to validate the server is the proper server.\n    \n   SNMPv3 with USM security Options:\n    SecEngineId - default \u003cnone\u003e, security engineID, will be probed if not\n                  supplied (v3)\n    AuthProto   - default 'MD5', authentication protocol [MD5, SHA] (v3)\n    AuthPass    - default \u003cnone\u003e, authentication passphrase\n    PrivProto   - default 'DES', privacy protocol [DES] (v3)\n    PrivPass    - default \u003cnone\u003e, privacy passphrase (v3)\n\n   private:\n    sess_ptr    - internal field used to cache a created session structure\n\n   methods:\n\n    get(\u003cnetsnmp.VarList object\u003e)\n                    - SNMP GET a netsnmp.VarList object must be supplied,\n\t\t      returns a tuple of values for each varbind in list\n\n    getnext(\u003cnetsnmp.VarList object\u003e)\n                    - SNMP GETNEXT, a netsnmp.VarList object must be supplied\n                      returns retrieved value(s), VarList passed as arguments\n\t\t      are updated to return a list of next lexicographical \n\t\t      Varbind objects. returns a tuple of values for each \n\t\t      varbind in list\n\n    set(\u003cnetsnmp.VarList object\u003e)\n                    - SNMP SET, a netsnmp.VarList object must be supplied\n                      the value field in all Varbinds must be in a canonical\n                      format (i.e., well known format) to ensure unambiguous\n                      translation to SNMP MIB data value (see discussion of\n                      canonical value format \u003cvars\u003e description section),\n                      returns true on success or None on error. \n\n    getbulk(\u003cnon-repeaters\u003e, \u003cmax-repeaters\u003e, \u003cnetsnmp.VarList object\u003e)\n                    - SNMP GETBULK, a netsnmp.VarList object must be supplied\n                      the single next lexico instance is fetched for the first \n\t\t      n Varbinds in the list as defined by \u003cnon-repeaters\u003e. \n                      For the remaining Varbinds, the next m lexico instances \n                      are retrieved each of the remaining Varbinds, \n                      where m is \u003cmax-repeaters\u003e. Returns a tuple of values \n\t\t      retrieved.\n\n    walk(\u003cnetsnmp.VarList object\u003e)\n             \t    - Performs multiple GETNEXT requests in order to\n             \t      return a tuple of values retrieved from the MIB\n             \t      below the Varbind passed in.  The VarList passed\n             \t      in will be updated to contain a complete set of\n             \t      Varbinds created for the results of the walk.\n\n             \t      Note that only one varbind should be contained in the\n             \t      VarList passed in.  The code is structured to maybe\n             \t      handle this is the the future, but right now walking\n             \t      multiple trees at once is not yet supported and will\n             \t      produce insufficient results.\n\n\n   Acceptable variable formats:\n\n    netsnmp.VarList:  - represents an list of Varbind objects to get or set.\n                        takes are arguments and unspecified number of Varbinds,\n\t\t\tor tuples which will be converted to Varbinds.\n\n\n    netsnmp.Varbind:  - represents a single MIB object to get or set\n\t\t\timplemented as Python[\u003ctag\u003e, \u003ciid\u003e, \u003cval\u003e, \u003ctype\u003e].\n\t\t\t\u003ctag\u003e  - one of the following forms:\n                           1) leaf identifier (e.g., 'sysDescr') assumed to be\n                           unique for practical purposes\n                           2) fully qualified identifier (e.g.,\n   \t\t\t   '.iso.org.dod.internet.mgmt.mib-2.system.sysDescr')\n                           3) fully qualified, dotted-decimal, numeric OID \n\t\t\t   (e.g., '.1.3.6.1.2.1.1.1')\n                      \u003ciid\u003e  - the dotted-decimal, instance identifier. for\n                               scalar MIB objects use '0'\n   \t\t      \u003cval\u003e  - the SNMP data value retrieved from or being set\n                               to the agents MIB. for set operations the \u003cval\u003e \n                               format must be canonical to ensure unambiguous \n\t\t\t       translation. The canonical forms are as follows:\n\t\t\t    OBJECTID =\u003e dotted-decimal (e.g., .1.3.6.1.2.1.1.1)\n\t\t\t    OCTETSTR =\u003e perl scalar containing octets,\n\t\t\t    INTEGER =\u003e decimal signed integer (or enum),\n\t\t\t    NETADDR =\u003e dotted-decimal,\n\t\t\t    IPADDR =\u003e dotted-decimal,\n\t\t\t    COUNTER =\u003e decimal unsigned integer,\n\t\t\t    COUNTER64  =\u003e decimal unsigned integer,\n\t\t\t    GAUGE,  =\u003e decimal unsigned integer,\n\t\t\t    UINTEGER,  =\u003e decimal unsigned integer,\n\t\t\t    TICKS,  =\u003e decimal unsigned integer,\n\t\t\t    OPAQUE =\u003e perl scalar containing octets,\n\t\t\t    NULL,  =\u003e perl scalar containing nothing,\n\n                      \u003ctype\u003e - SNMP data type (see list above), this field is\n                               populated by 'get' and 'getnext' operations. In\n                               some cases the programmer needs to populate this\n                               field when passing to a 'set' operation. this\n                               field need not be supplied when the attribute\n                               indicated by \u003ctag\u003e is already described in the\n                               parsed MIB. for 'set's, if a numeric OID is used\n                               and the object is not in the parsed MIB,\n                               the \u003ctype\u003e field must be supplied\n\n\n   Python 'netsnmp' package variables and functions:\n\n\n    netsnmp.verbose       - default '0', \n                            controls warning/info output of themodule \n\t\t\t    0 =\u003e no output, \n\t\t\t    1 =\u003e enables warning/info\n\n(needs implementation)\n    $SNMP::debugging     - default '0', controls debugging output level\n                           within SNMP module and libsnmp\n                           1 =\u003e enables 'SNMP::verbose' (see above)\n                           2 =\u003e level 1 plus snmp_set_do_debugging(1),\n                           3 =\u003e level 2 plus snmp_set_dump_packet(1)\n\n    $SNMP::dump_packet   - default '0', set [non-]zero to independently set\n                           snmp_set_dump_packet()\n\n   Exported 'netsnmp' package utility functions:\n\n   snmpget(\u003cVarbind/VarList\u003e, \u003cSession args\u003e) \n             - takes args of netsnmp.Session preceded by those of the \n               corresponding netsnmp.Session method. Returns a tuple with \n               Varbind values fetched, and input is updated to contain\n               complete Varbinds fetched. \n\n   snmpgetnext(\u003cVarbind/VarList\u003e, \u003cSession args\u003e)\n             - takes args of netsnmp.Session preceded by those of the\n               corresponding netsnmp.Session method. Returns a tuple with \n               Varbind values fetched, and input is updated to contain\n               complete Varbinds fetched. \n\n   snmpgetbulk(nonrepeaters, maxrepetitions,\u003cVarList\u003e, \u003cSession args\u003e)\n             - takes args of netsnmp.Session preceded by those of the\n               corresponding netsnmp.Session method. Returns a tuple with \n               Varbind values fetched, and VarList is updated to contain\n               complete Varbinds fetched. \n\n   snmpset(\u003cVarbind/VarList\u003e, \u003cSession args\u003e)\n             - takes args of netsnmp.Session preceded by those of the\n               corresponding netsnmp.Session method. returns True on success,\n               otherwise False.\n\n   snmpwalk(\u003cVarbind/VarList\u003e, \u003cSession args\u003e)) \n             - takes args of netsnmp.Session preceded by a Varbind or\n               VarList from which the 'walk' operation will start.\n               Returns a tuple of values retrieved from the MIB below\n               the Varbind passed in.  If a VarList is passed in it\n               will be updated to contain a complete set of VarBinds\n               created for the results of the walk.  It is not\n               recommended to pass in just a Varbind since you loose\n               the ability to examine the returned OIDs.  But, if only\n               a Varbind is passed in it will be returned unaltered.\n\n               Note that only one varbind should be contained in the\n               VarList passed in.  The code is structured to maybe\n               handle this is the the future, but right now walking\n               multiple trees at once is not yet supported and will\n               produce insufficient results.\n\nTrouble Shooting:\n\n   If problems occur there are number areas to look at to narrow down the\n   possibilities.\n\n   The first step should be to test the Net-SNMP installation\n   independently from the Python 'netsnmp' Extension.\n\n   Try running the apps from the Net-SNMP distribution.\n\n   Make sure your agent (snmpd) is running and properly configured with\n   read-write access for the community you are using.\n\n   Ensure that your MIBs are installed and environment variables are set\n   appropriately (see man mib_api)\n\n   Be sure to ensure headers and libraries from old CMU installations are\n   not being used by mistake (see -NET-SNMP-PATH).\n\n   If the problem occurs during compilation/linking check that the snmp\n   library being linked is actually the Net-SNMP library (there have been\n   name conflicts with existing snmp libs).\n\n   Also check that the header files are correct and up to date.\n\n   Sometimes compiling the Net-SNMP library with\n   'position-independent-code' enabled is required (HPUX specifically).\n\n   If you cannot resolve the problem you can email \n   net-snmp-users@lists.sourceforge.net.\n\n   Please give sufficient information to analyze the problem (OS type,\n   versions for OS/python/net-SNMP/compiler, complete error output, etc.)\n\nAcknowledgments:\n\n   Giovanni Marzot (the original author)\n   ScienceLogic, LLC sponsored the initial development of this module.\n   Wes Hardaker and the net-snmp-coders\n\n   Thanks in advance to any who supply patches, suggestions and feedback.\n\nLicense:\n\n   Please see the LICENSE file contained with this package\n\nCopyright:\n\n   Copyright (c) 2006 G. S. Marzot. All rights reserved.\n   This program is free software; you can redistribute it and/or\n   modify it under the same terms as Net-SNMP itself.\n\n   Copyright (c) 2006 SPARTA, Inc.  All Rights Reserved.  This\n   program is free software; you can redistribute it and/or modify\n   it under the same terms as Net-SNMP itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluecmd%2Fpython3-netsnmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluecmd%2Fpython3-netsnmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluecmd%2Fpython3-netsnmp/lists"}