Skip to main content

SNMP poller oriented to poll bunch of hosts in short time. Package include poller and SNMP library

Project description

fastsnmp

SNMP poller oriented to poll bunch of hosts in short time. Package include poller and SNMP coder/encoder library.

[Reference manual] (http://fastsnmp.readthedocs.org/)

Example:

from fastsnmp import snmp_poller

hosts = ("127.0.0.1",)
# oids in group must be with same indexes
oid_group = {"1.3.6.1.2.1.2.2.1.2": "ifDescr",
             "1.3.6.1.2.1.2.2.1.10": "ifInOctets",
             }

community = "public"
snmp_data = snmp_poller.poller(hosts, [list(oid_group)], community)
for d in snmp_data:
    print ("host=%s oid=%s.%s value=%s" % (d[0], oid_group[d[1]], d[2], d[3]))

Output:

host=127.0.0.1 oid=ifInOctets.1 value=243203744
host=127.0.0.1 oid=ifDescr.1 value=b'lo'
host=127.0.0.1 oid=ifInOctets.2 value=1397428486
host=127.0.0.1 oid=ifDescr.2 value=b'eth0'

Type conversion:

SNMP Python
octetstring, ipaddress bytes
null None
objectid str
counter32, unsigned32, gauge32, counter64, integer int
noSuchInstance None
noSuchObject None
endOfMibView None

Notices:

  • ipaddress can be converted to string using str(ipaddress.IPv4Address(b"\x01\x01\x01\x01")) or socket.inet_ntoa(b"\x01\x01\x01\x01")

Another python SNMP libraries:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastsnmp-0.14.tar.gz (150.1 kB view details)

Uploaded Source

File details

Details for the file fastsnmp-0.14.tar.gz.

File metadata

  • Download URL: fastsnmp-0.14.tar.gz
  • Upload date:
  • Size: 150.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for fastsnmp-0.14.tar.gz
Algorithm Hash digest
SHA256 2ae88fd94f8e6cc2cfce7f9bc391973ca7beb33170c93b455c38c6baec112362
MD5 7a24c74ec327f94cd36b0f126c9ebdaa
BLAKE2b-256 95cd8301c0d38921f27bda67a15f1a207493125fb3e50f6d6ae34e2b15a22899

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastsnmp-0.14.tar.gz:

Publisher: publish.yml on gescheit/fastsnmp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page