HTTP reader

HttpReader class instance tries to download MIB files using configured URL.

class pysmi.reader.httpclient.HttpReader(host, port, locationTemplate, timeout=5, ssl=False)

Fetch ASN.1 MIB text by name from a web site.

HttpReader class instance tries to download ASN.1 MIB files by name and return their contents to caller.

Create an instance of HttpReader bound to specific URL.

Note

The http_proxy and https_proxy environment variables are respected by the underlying urllib stdlib module.

Parameters:
  • host (str) – domain name or IP address of web server
  • port (int) – TCP port web server is listening
  • locationTemplate (str) – location part of the URL optionally containing @mib@ magic placeholder to be replaced with MIB name. If @mib@ magic is not present, MIB name is appended to locationTemplate
Keyword Arguments:
 
  • timeout (int) – response timeout
  • ssl (bool) – access HTTPS web site