Python API Reference¶
This page documents the Python package ezsnmp_data_logger, its CLI entry point, and the cross-platform GUI modules (CliSubprocessBridge and StudioHttpServer) that drive the CLI behind the scenes across Linux, macOS, and Windows.
Top-Level Package (ezsnmp_data_logger)¶
ezsnmp_data_logger: C++17 SNMP Data Logger powered by ezsnmp with SWIG bindings.
- class ezsnmp_data_logger.Batch[source]¶
Proxy of C++ ezsnmp_data_logger::Batch class.
- property dut_ip¶
- property dut_name¶
- property samples¶
- property thisown¶
The membership flag
- property ts_unix_ns¶
- class ezsnmp_data_logger.CliResult[source]¶
Proxy of C++ ezsnmp_data_logger::CliResult class.
- property exit_code¶
- property stderr_text¶
- property stdout_text¶
- property thisown¶
The membership flag
- class ezsnmp_data_logger.CliRunner[source]¶
Proxy of C++ ezsnmp_data_logger::CliRunner class.
- static execute(args) CliResult[source]¶
Parameters¶
args: std::vector< std::string,std::allocator< std::string > > const &
- static run(args) int[source]¶
Parameters¶
args: std::vector< std::string,std::allocator< std::string > > const &
- property thisown¶
The membership flag
- class ezsnmp_data_logger.DataLogger(*args)[source]¶
Proxy of C++ ezsnmp_data_logger::DataLogger class.
- static from_file(file_path) DataLogger[source]¶
Parameters¶
file_path: std::string const &
- static inspect_json(json_config, limit=50, dut_filter='', metric_filter='', indent=-1) std::string[source]¶
Parameters¶
json_config: std::string const & limit: int dut_filter: std::string const & metric_filter: std::string const & indent: int
- static probe(config, dut_filter='') DutProbeResultVector[source]¶
Parameters¶
config: ezsnmp_data_logger::LoggerConfig const & dut_filter: std::string const &
- static probe_json(json_config, dut_filter='', indent=-1) std::string[source]¶
Parameters¶
json_config: std::string const & dut_filter: std::string const & indent: int
- static request_json(json_config, dut_name, operation, oids, max_repeaters=10, record_to_sinks=False, indent=-1) std::string[source]¶
Parameters¶
json_config: std::string const & dut_name: std::string const & operation: std::string const & oids: std::vector< std::string,std::allocator< std::string > > const & max_repeaters: int record_to_sinks: bool indent: int
- static set_json(json_config, dut_name, oid, set_type, set_value, record_to_sinks=False, indent=-1) std::string[source]¶
Parameters¶
json_config: std::string const & dut_name: std::string const & oid: std::string const & set_type: std::string const & set_value: std::string const & record_to_sinks: bool indent: int
- stats(self) LoggerStats[source]¶
- property thisown¶
The membership flag
- class ezsnmp_data_logger.DutConfig[source]¶
Proxy of C++ ezsnmp_data_logger::DutConfig class.
- property dut_ip¶
- property enabled¶
- property metrics¶
- property name¶
- property poll_interval_ms¶
- property snmp¶
- property thisown¶
The membership flag
- class ezsnmp_data_logger.DutProbeResult[source]¶
Proxy of C++ ezsnmp_data_logger::DutProbeResult class.
- property dut_ip¶
- property dut_name¶
- property error¶
- property latency_ms¶
- property reachable¶
- property samples¶
- property thisown¶
The membership flag
- class ezsnmp_data_logger.GuiConfig[source]¶
Proxy of C++ ezsnmp_data_logger::GuiConfig class.
- property cli_executable¶
- property frontend¶
- property host¶
- property locale¶
- property locale_file¶
- property max_log_lines¶
- property open_browser¶
- property port¶
- property refresh_interval_ms¶
- property theme¶
- property thisown¶
The membership flag
- property window_height¶
- property window_width¶
- class ezsnmp_data_logger.InspectRow[source]¶
Proxy of C++ ezsnmp_data_logger::InspectRow class.
- property dut_ip¶
- property dut_name¶
- property f64¶
- property i64¶
- property metric_name¶
- property oid¶
- property oid_index¶
- property raw_value¶
- property sink_type¶
- property snmp_type¶
- property status¶
- property str_val¶
- property thisown¶
The membership flag
- property ts_unix_ns¶
- property type_tag¶
- class ezsnmp_data_logger.LoggerConfig[source]¶
Proxy of C++ ezsnmp_data_logger::LoggerConfig class.
- property duts¶
- static from_file(file_path) LoggerConfig[source]¶
Parameters¶
file_path: std::string const &
- static from_json(json_text) LoggerConfig[source]¶
Parameters¶
json_text: std::string const &
- property gui¶
- property logger¶
- property sinks¶
- property thisown¶
The membership flag
- class ezsnmp_data_logger.LoggerRuntimeConfig[source]¶
Proxy of C++ ezsnmp_data_logger::LoggerRuntimeConfig class.
- property log_level¶
- property max_cycles¶
- property poll_interval_ms¶
- property process_start_method¶
- property queue_depth¶
- property run_duration_seconds¶
- property stats_interval_ms¶
- property status_file¶
- property thisown¶
The membership flag
- property worker_threads¶
- property zmq_endpoint¶
- property zmq_hwm¶
- class ezsnmp_data_logger.LoggerStats[source]¶
Proxy of C++ ezsnmp_data_logger::LoggerStats class.
- property cycles_completed¶
- property dropped_batches¶
- property last_error¶
- property poll_errors¶
- property processed_batches¶
- property processed_samples¶
- property queue_depth¶
- property running¶
- property sink_errors¶
- property thisown¶
The membership flag
- property uptime_ms¶
- class ezsnmp_data_logger.MetricConfig[source]¶
Proxy of C++ ezsnmp_data_logger::MetricConfig class.
- property max_repeaters¶
- property name¶
- property oid¶
- property operation¶
- property set_type¶
- property set_value¶
- property thisown¶
The membership flag
- class ezsnmp_data_logger.Sample[source]¶
Proxy of C++ ezsnmp_data_logger::Sample class.
- property f64¶
- property i64¶
- static make_float(name, oid_str, val, status_code=0) Sample[source]¶
Parameters¶
name: std::string const & oid_str: std::string const & val: double status_code: int
- static make_int(name, oid_str, val, status_code=0) Sample[source]¶
Parameters¶
name: std::string const & oid_str: std::string const & val: int64_t status_code: int
- static make_string(name, oid_str, val, status_code=0) Sample[source]¶
Parameters¶
name: std::string const & oid_str: std::string const & val: std::string const & status_code: int
- property metric_name¶
- property oid¶
- property oid_index¶
- property raw_value¶
- property snmp_type¶
- property status¶
- property str_val¶
- property thisown¶
The membership flag
- property type_tag¶
- class ezsnmp_data_logger.SinkConfig[source]¶
Proxy of C++ ezsnmp_data_logger::SinkConfig class.
- property dir¶
- property enabled¶
- property flush_every_n¶
- property prometheus_host¶
- property prometheus_port¶
- property prometheus_prefix¶
- property psql_batch_size¶
- property psql_conninfo¶
- property psql_enable_timescaledb¶
- property psql_reconnect_delay_ms¶
- property sqlite_commit_every_ms¶
- property sqlite_commit_every_n¶
- property sqlite_path¶
- property thisown¶
The membership flag
- property type¶
- class ezsnmp_data_logger.SnmpConfig[source]¶
Proxy of C++ ezsnmp_data_logger::SnmpConfig class.
- property auth_passphrase¶
- property auth_protocol¶
- property boots_time¶
- property community¶
- property context¶
- property context_engine_id¶
- property load_mibs¶
- property mib_directories¶
- property mode¶
- property port_number¶
- property print_enums_numerically¶
- property print_full_oids¶
- property print_hex_strings¶
- property print_oids_numerically¶
- property print_timeticks_numerically¶
- property privacy_passphrase¶
- property privacy_protocol¶
- property retries¶
- property security_engine_id¶
- property security_level¶
- property security_username¶
- property thisown¶
The membership flag
- property timeout_seconds¶
- property version¶
CLI Module (ezsnmp_data_logger.cli)¶
Command-line entry point for ezsnmp_data_logger (delegates to C++17 CliRunner or GUI).
GUI Launcher (ezsnmp_data_logger.gui)¶
Cross-platform Graphical User Interface launcher for ezsnmp_data_logger.
Supports Linux, macOS, and Windows via: 1. tk: Native cross-platform desktop application (tkinter.ttk), or 2. web: Cross-platform Browser Studio (http.server + HTML5/SVG).
Both frontends interact strictly with the ezsnmp-data-logger CLI behind the scenes and store 100% of configuration and GUI settings in JSON.
- class ezsnmp_data_logger.gui.CliSubprocessBridge(config_path: str | Path, cli_override: str = '')[source]¶
Thread-safe controller that drives ezsnmp-data-logger strictly via CLI + JSON.
- request(dut_name: str, operation: str, oids: list[str], max_repeaters: int = 10, record: bool = False) dict[str, Any][source]¶
- set_oid(dut_name: str, oid: str, set_type: str, value: str, record: bool = False) dict[str, Any][source]¶
- class ezsnmp_data_logger.gui.LocaleManager(locale: str = 'en', locale_file: str | Path | None = None)[source]¶
Manages string resolution, language selection, and fallback for GUIs.
Supports the key-centric format: {“LOCALE_KEY_NAME”: {“en”: “…”, “es”: “…”, …}}
- ezsnmp_data_logger.gui.can_use_tkinter_display() bool[source]¶
Return True if tkinter is installed and a graphical display is available.
GUI Behind-the-Scenes CLI Bridge (ezsnmp_data_logger.gui.cli_bridge)¶
Pure CLI subprocess + JSON bridge powering all ezsnmp_data_logger GUIs.
All Graphical User Interfaces (native tkinter.ttk desktop and Browser Web Studio) interact exclusively with the ezsnmp-data-logger CLI behind the scenes and store 100% of settings in JSON configuration files.
- class ezsnmp_data_logger.gui.cli_bridge.CliSubprocessBridge(config_path: str | Path, cli_override: str = '')[source]¶
Thread-safe controller that drives ezsnmp-data-logger strictly via CLI + JSON.
- request(dut_name: str, operation: str, oids: list[str], max_repeaters: int = 10, record: bool = False) dict[str, Any][source]¶
- set_oid(dut_name: str, oid: str, set_type: str, value: str, record: bool = False) dict[str, Any][source]¶
GUI Cross-Platform Browser Studio Server (ezsnmp_data_logger.gui.server)¶
Cross-platform Browser Studio HTTP server for Linux, macOS, and Windows.
Uses Python’s standard-library ThreadingHTTPServer so zero external web frameworks are required, delegating 100% of operations to CliSubprocessBridge (CLI + JSON).
- class ezsnmp_data_logger.gui.server.StudioHttpServer(server_address: tuple[str, int], bridge: CliSubprocessBridge, locale_mgr: LocaleManager | None = None)[source]¶
ThreadingHTTPServer carrying a shared CliSubprocessBridge instance.
- allow_reuse_address = True¶
- class ezsnmp_data_logger.gui.server.StudioRequestHandler(request, client_address, server)[source]¶
REST JSON + static asset handler backed strictly by CliSubprocessBridge.
- log_message(format: str, *args: Any) None[source]¶
Log an arbitrary message.
This is used by all other logging functions. Override it if you have specific logging wishes.
The first argument, FORMAT, is a format string for the message to be logged. If the format string contains any % escapes requiring parameters, they should be specified as subsequent arguments (it’s just like printf!).
The client ip and current date/time are prefixed to every message.
Unicode control characters are replaced with escaped hex before writing the output to stderr.
- server: StudioHttpServer¶
- ezsnmp_data_logger.gui.server.create_web_server(bridge: CliSubprocessBridge, host: str = '127.0.0.1', port: int = 8765, locale_mgr: LocaleManager | None = None) StudioHttpServer[source]¶
Create a bound StudioHttpServer instance (supports port=0 ephemeral bind).
- ezsnmp_data_logger.gui.server.launch_web_gui(bridge: CliSubprocessBridge, host: str = '127.0.0.1', port: int = 8765, open_browser: bool = True, locale_mgr: LocaleManager | None = None) int[source]¶
Start the cross-platform Browser Studio and block until Ctrl+C.
GUI Cross-Platform Native Desktop Studio (ezsnmp_data_logger.gui.desktop_tk)¶
Cross-platform Native Desktop GUI (tkinter.ttk) for Linux, macOS, and Windows.
Drives ezsnmp-data-logger strictly through CliSubprocessBridge (CLI + JSON) with zero duplicated engine or SNMP logic.
- class ezsnmp_data_logger.gui.desktop_tk.DesktopLoggerStudio(bridge: CliSubprocessBridge, schedule_refresh: bool = True, locale_mgr: LocaleManager | None = None)[source]¶
Cross-platform tkinter.ttk GUI interacting exclusively with the CLI + JSON.
- ezsnmp_data_logger.gui.desktop_tk.launch_desktop_gui(bridge: CliSubprocessBridge, locale_mgr: LocaleManager | None = None) int[source]¶
Launch the cross-platform tkinter.ttk Desktop Studio mainloop.