Skip to content

[Feature Request] Expose Ping count parameter in snmp-base.yaml to prevent binary packet loss calculation #876

Description

@qryuu

Is your feature request related to a problem? Please describe.

Currently, the Ping input logic in pkg/inputs/snmp/ping/ping.go supports a count variable in the Pinger struct, which determines the number of ICMP packets sent per polling cycle.

https://github.com/kentik/ktranslate/blob/main/pkg/inputs/snmp/ping/ping.go#L30
https://github.com/kentik/ktranslate/blob/main/pkg/inputs/snmp/ping/ping.go#L96-L97

However, there seems to be no parameter exposed in snmp-base.yaml (or CLI flags) to configure this count value. It appears to default to 1 in the calling logic.

Problem:
Because the count is effectively fixed at 1, the calculated Packet Loss is binary: either 0% (success) or 100% (fail).
If a single packet is dropped due to a transient network glitch, KTranslate reports 100% packet loss immediately. This causes noisy alerts and false positives in downstream monitoring systems like New Relic, as we cannot configure it to send multiple pings (e.g., 5 pings) to get a more granular loss percentage (e.g., 20%).

Describe the solution you'd like

I would like to request adding a configuration parameter (e.g., ping_count or retries) to snmp-base.yaml that passes the integer value to the Pinger.Reset method or the NewPinger constructor.

Desired Configuration Example (snmp-base.yaml):

global:
  poll_time_sec: 60
  timeout_ms: 1000
  ping_count: 5  # Requesting this parameter

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions