{"library":"pysnmp-lextudio","title":"pysnmp-lextudio","description":"pysnmp-lextudio was a specific distribution or fork of the PySNMP library, providing capabilities for managing network devices via the SNMP (Simple Network Management Protocol). It is now officially deprecated, with its last release (6.3.0) in 2022. Users are strongly advised to migrate to the actively maintained `pysnmp` package for ongoing support, security updates, and compatibility with newer Python versions.","language":"python","status":"deprecated","last_verified":"Fri Apr 17","install":{"commands":["pip install pysnmp-lextudio"],"cli":null},"imports":["from pysnmp.hlapi import SnmpEngine"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from pysnmp.hlapi import *\nimport os\n\n# IMPORTANT: This package (pysnmp-lextudio) is deprecated.\n# This code is provided for historical context or if you are forced\n# to use this specific deprecated version. For all new projects,\n# you MUST use the actively maintained 'pysnmp' package instead.\n\n# Define SNMP agent parameters\nhostname = os.environ.get('SNMP_AGENT_HOST', 'localhost') # Replace with your SNMP agent's IP/hostname\ncommunity_string = os.environ.get('SNMP_COMMUNITY_STRING', 'public') # Replace with your SNMP community string\nport = int(os.environ.get('SNMP_AGENT_PORT', 161))\n\n# Define the OID to query (e.g., sysDescr.0)\noid = '1.3.6.1.2.1.1.1.0'\n\n# Perform a synchronous GET operation\nerrorIndication, errorStatus, errorIndex, varBinds = next(\n    getCmd(SnmpEngine(),\n           CommunityData(community_string, mpModel=0),\n           UdpTransportTarget((hostname, port)),\n           ContextData(),\n           ObjectType(ObjectIdentity(oid)))\n)\n\nif errorIndication:\n    print(f\"Error: {errorIndication}\")\nelif errorStatus:\n    print(f\"Error: {errorStatus.prettyPrint()} at {errorIndex and varBinds[int(errorIndex) - 1][0] or '?'}\")\nelse:\n    for varBind in varBinds:\n        print(' = '.join([x.prettyPrint() for x in varBind]))\n\n# To run this, you'd typically need an SNMP agent listening on the specified host:port\n# (e.g., snmpd on Linux or a network device with SNMP enabled).","lang":"python","description":"This quickstart demonstrates a basic SNMP GET operation using pysnmp-lextudio. It attempts to retrieve the 'sysDescr.0' OID (system description). Note the prominent warning that this package is deprecated and migration to `pysnmp` is highly recommended.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}