{"id":13473581,"url":"https://github.com/etingof/pysnmp","last_synced_at":"2025-12-29T23:27:25.102Z","repository":{"id":45261963,"uuid":"52478762","full_name":"etingof/pysnmp","owner":"etingof","description":"Python SNMP library","archived":false,"fork":false,"pushed_at":"2024-07-31T03:49:31.000Z","size":3548,"stargazers_count":580,"open_issues_count":209,"forks_count":200,"subscribers_count":53,"default_branch":"master","last_synced_at":"2024-10-30T06:32:53.987Z","etag":null,"topics":["mib","pysnmp","python","snmp","snmpv3"],"latest_commit_sha":null,"homepage":"http://snmplabs.com/pysnmp/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/etingof.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.txt","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.rst","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},"funding":{"custom":"http://snmplabs.com/sponsorship.html"}},"created_at":"2016-02-24T22:23:43.000Z","updated_at":"2024-10-30T03:24:25.000Z","dependencies_parsed_at":"2024-01-03T05:07:45.000Z","dependency_job_id":"acac4e45-5650-4b05-b26a-37a1b4c96c4b","html_url":"https://github.com/etingof/pysnmp","commit_stats":{"total_commits":1913,"total_committers":27,"mean_commits":70.85185185185185,"dds":"0.20491374803972817","last_synced_commit":"becd15c79c9a6b5696928ecd50bf5cca8b1770a1"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etingof%2Fpysnmp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etingof%2Fpysnmp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etingof%2Fpysnmp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etingof%2Fpysnmp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/etingof","download_url":"https://codeload.github.com/etingof/pysnmp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245722868,"owners_count":20661841,"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":["mib","pysnmp","python","snmp","snmpv3"],"created_at":"2024-07-31T16:01:05.033Z","updated_at":"2025-12-29T23:27:25.057Z","avatar_url":"https://github.com/etingof.png","language":"Python","funding_links":["http://snmplabs.com/sponsorship.html"],"categories":["Python","Libraries","Recently Updated"],"sub_categories":["Python","[Oct 31, 2024](/content/2024/10/31/README.md)"],"readme":"\nSNMP library for Python\n-----------------------\n[![PyPI](https://img.shields.io/pypi/v/pysnmp.svg?maxAge=2592000)](https://pypi.org/project/pysnmp/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/pysnmp.svg)](https://pypi.org/project/pysnmp/)\n[![GitHub license](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/etingof/pysnmp/master/LICENSE.rst)\n[![Build status](https://travis-ci.org/etingof/pysnmp.svg?branch=master)](https://travis-ci.org/etingof/pysnmp)\n[![Downloads](https://img.shields.io/pypi/dm/pysnmp.svg)](https://pypi.org/project/pysnmp/)\n\nThis is a pure-Python, open source and free implementation of v1/v2c/v3\nSNMP engine distributed under 2-clause [BSD license](http://snmplabs.com/pysnmp/license.html).\n\nThe PySNMP project was initially sponsored by a [PSF](http://www.python.org/psf/) grant.\nThank you!\n\nFeatures\n--------\n\n* Complete SNMPv1/v2c and SNMPv3 support\n* SMI framework for resolving MIB information and implementing SMI\n  Managed Objects\n* Complete SNMP entity implementation\n* USM Extended Security Options support (3DES, 192/256-bit AES encryption)\n* Extensible network transports framework (UDP/IPv4, UDP/IPv6)\n* Asynchronous socket-based IO API support\n* [Twisted](http://twistedmatrix.com), [Asyncio](https://docs.python.org/3/library/asyncio.html)\n  and [Trollius](http://trollius.readthedocs.org/index.html) integration\n* [PySMI](http://snmplabs.com/pysmi/) integration for dynamic MIB compilation\n* Built-in instrumentation exposing protocol engine operations\n* Python eggs and py2exe friendly\n* 100% Python, works with Python 2.6 though 3.7\n* MT-safe (if SnmpEngine is thread-local)\n\nFeatures, specific to SNMPv3 model include:\n\n* USM authentication (MD5/SHA-1/SHA-2) and privacy (DES/AES) protocols (RFC3414, RFC7860)\n* View-based access control to use with any SNMP model (RFC3415)\n* Built-in SNMP proxy PDU converter for building multi-lingual\n  SNMP entities (RFC2576)\n* Remote SNMP engine configuration\n* Optional SNMP engine discovery\n* Shipped with standard SNMP applications (RC3413)\n\n\nDownload \u0026 Install\n------------------\n\nThe PySNMP software is freely available for download from [PyPI](https://pypi.org/project/pysnmp/)\nand [GitHub](https://github.com/etingof/pysnmp.git).\n\nJust run:\n\n```bash\n$ pip install pysnmp\n```\n    \nto download and install PySNMP along with its dependencies:\n\n* [PyASN1](http://snmplabs.com/pyasn1/)\n* [PySMI](http://snmplabs.com/pysmi/) (required for MIB services only)\n* Optional [pysnmpcrypto](https://github.com/etingof/pysnmpcrypto) package\n  whenever strong SNMPv3 encryption is desired\n\nBesides the library, command-line [SNMP utilities](https://github.com/etingof/snmpclitools)\nwritten in pure-Python could be installed via:\n\n```bash\n$ pip install snmpclitools\n```\n    \nand used in the very similar manner as conventional Net-SNMP tools:\n\n```bash\n$ snmpget.py -v3 -l authPriv -u usr-md5-des -A authkey1 -X privkey1 demo.snmplabs.com sysDescr.0\nSNMPv2-MIB::sysDescr.0 = STRING: Linux zeus 4.8.6.5-smp #2 SMP Sun Nov 13 14:58:11 CDT 2016 i686\n```\n    \nExamples\n--------\n\nPySNMP is designed in a layered fashion. Top-level and easiest to use API is known as\n*hlapi*. Here's a quick example on how to SNMP GET:\n\n```python\nfrom pysnmp.hlapi import *\n\niterator = getCmd(SnmpEngine(),\n                  CommunityData('public'),\n                  UdpTransportTarget(('demo.snmplabs.com', 161)),\n                  ContextData(),\n                  ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysDescr', 0)))\n\nerrorIndication, errorStatus, errorIndex, varBinds = next(iterator)\n\nif errorIndication:  # SNMP engine errors\n    print(errorIndication)\nelse:\n    if errorStatus:  # SNMP agent errors\n        print('%s at %s' % (errorStatus.prettyPrint(), varBinds[int(errorIndex)-1] if errorIndex else '?'))\n    else:\n        for varBind in varBinds:  # SNMP response contents\n            print(' = '.join([x.prettyPrint() for x in varBind]))\n```\n\nThis is how to send SNMP TRAP:\n\n```python\nfrom pysnmp.hlapi import *\n\nerrorIndication, errorStatus, errorIndex, varBinds = next(\n    sendNotification(\n        SnmpEngine(OctetString(hexValue='8000000001020304')),\n        UsmUserData('usr-sha-aes128', 'authkey1', 'privkey1',\n                    authProtocol=USM_AUTH_HMAC96_SHA,\n                    privProtocol=USM_PRIV_CFB128_AES),\n        UdpTransportTarget(('demo.snmplabs.com', 162)),\n        ContextData(),\n        'trap',\n        NotificationType(ObjectIdentity('SNMPv2-MIB', 'authenticationFailure'))\n    )\n)\n\nif errorIndication:\n    print(errorIndication)\n```\n\nWe maintain publicly available SNMP Agent and TRAP sink at \n[demo.snmplabs.com](http://snmplabs.com/snmpsim/public-snmp-agent-simulator.html). You are\nwelcome to use it while experimenting with whatever SNMP software you deal with.\n\n```bash\n$ python3 examples/hlapi/asyncore/sync/manager/cmdgen/usm-sha-aes128.py\nSNMPv2-MIB::sysDescr.0 = SunOS zeus.snmplabs.com 4.1.3_U1 1 sun4m\n$\n$ python3 examples//hlapi/asyncore/sync/agent/ntforg/v3-inform.py\nSNMPv2-MIB::sysUpTime.0 = 0\nSNMPv2-MIB::snmpTrapOID.0 = SNMPv2-MIB::warmStart\nSNMPv2-MIB::sysName.0 = system name\n```\n    \nOther than that, PySNMP is capable to automatically fetch and use required MIBs from HTTP, FTP sites\nor local directories. You could configure any MIB source available to you (including\n[this one](http://mibs.snmplabs.com/asn1/)) for that purpose.\n\nFor more example scripts please refer to [examples section](http://snmplabs.com/pysnmp/examples/contents.html#high-level-snmp)\nat pysnmp web site.\n\nDocumentation\n-------------\n\nLibrary documentation and examples can be found at the [pysnmp project site](http://snmplabs.com/pysnmp/).\n\nIf something does not work as expected, please\n[open an issue](https://github.com/etingof/pysnmp/issues) at GitHub or\npost your question [on Stack Overflow](http://stackoverflow.com/questions/ask)\nor try browsing pysnmp \n[mailing list archives](https://sourceforge.net/p/pysnmp/mailman/pysnmp-users/).\n\nBug reports and PRs are appreciated! ;-)\n\nCopyright (c) 2005-2019, [Ilya Etingof](mailto:etingof@gmail.com). All rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetingof%2Fpysnmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fetingof%2Fpysnmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetingof%2Fpysnmp/lists"}