$ show oetiker/SmokePing
SmokePing is a mature network latency monitoring and visualization application written in Perl. It measures round-trip time and packet loss to targets using a wide variety of pluggable probes (ICMP, TCP, HTTP, DNS, SSH, SNMP, etc.), stores the time-series data in RRD files, and presents interactive web-based graphs via a CGI/FastCGI interface. The architecture includes a daemon that runs probes on a schedule, a master/slave mode for distributed monitoring, and an alerting system that can trigger notifications based on configurable patterns or matcher plugins. While primarily an application, it also includes data analysis components such as matchers and sorters that compute statistics (median, loss, standard deviation) from stored data. The codebase is monolithic in parts (Smokeping.pm >3000 lines) and uses outdated JavaScript libraries, but offers well-designed extensibility through probe base classes and a self-contained SNMP stack (BER.pm, SNMP_Session.pm) that could be reused independently.
The LLM identified 3 files worth highlighting for reuse:
Implements ASN.1 Basic Encoding Rules (BER) for SNMP communication. Fully self-contained Perl module that can encode/decode SNMP messages, handle OIDs, and manage sequence, integer, octet string, and other primitive types. Could be extracted and reused in any Perl project needing raw SNMP packet construction without external dependencies.
Provides a high-level SNMP session abstraction built on top of BER.pm. Handles SNMPv1/v2c Get, GetNext, Set requests, session management, retries, timeouts, and community-based authentication. Designed as a standalone library with minimal coupling to SmokePing internals, making it reusable for other SNMP monitoring or management tools.
Base class for SmokePing's probe system, defining a clear interface (pingone, probevars, targetvars) and lifecycle (forking, timeout handling, result parsing). Demonstrates a well-structured plugin pattern where new probes are created by subclassing and overriding a few methods. The design decouples measurement logic from scheduling, RRD storage, and alerting, making it a reusable template for any periodic measurement tool.