Skip to content

perfdata: add --legacy-perfdata flag and fix plugins= count mismatch#55

Open
dmueckli wants to merge 4 commits into
NETWAYS:masterfrom
dmueckli:feature/legacy-perfdata-flag
Open

perfdata: add --legacy-perfdata flag and fix plugins= count mismatch#55
dmueckli wants to merge 4 commits into
NETWAYS:masterfrom
dmueckli:feature/legacy-perfdata-flag

Conversation

@dmueckli

@dmueckli dmueckli commented Jul 9, 2026

Copy link
Copy Markdown

Summary

Two related fixes around the perfdata/check_multi output:

  1. An opt-in --legacy-perfdata flag that restores the exact pre-1.4.4
    performance data format, for users with existing RRD/PNP4Nagios graph
    definitions that broke on upgrade.
  2. A plugins= count fix, independent of the flag, that corrects a
    mismatch between the advertised and actual number of perfdata blocks.

Background

v1.4.4 changed the perfdata output under the label "general linter and
style fixes":

  • added checktime=<unixtime> to the check_multi header
  • added inBitps=/outBitps= per interface

This silently broke existing RRD definitions that parse the perfdata by
fixed field layout, since new fields shifted/extended what downstream
tools expect.

Change 1: --legacy-perfdata flag

Restores the exact pre-1.4.4 output when passed:

  • no checktime=
  • no inBitps=/outBitps= fields

Without the flag, behavior is unchanged from current master.

Change 2: plugins= count fix

plugins= in the check_multi header used
number_of_matched_interfaces (how many interfaces matched the regex),
but the loop that prints check_snmp blocks below only emits a block
for interfaces that are neither ignored nor administratively down.

Example from a real device: 44 interfaces matched the regex, 40 of
them administratively down → only 4 ::check_snmp:: blocks are
actually printed, but the header said plugins=44. This mismatch can
confuse RRD/check_multi consumers that rely on this count to know how
many data sources to expect.

plugins= now reflects the number of blocks actually printed, in both
the default and --legacy-perfdata output. The , of which X matched the regex status text is unaffected by this fix, since that's meant to
report the raw regex match count regardless of admin-down status - it's
purely informational (appears before the |, not parsed by RRD tools).

Testing

Verified on a real Ekinops router with 44 regex-matched interfaces (40
administratively down).

Dennis Mücklich ITO and others added 4 commits July 9, 2026 14:17
v1.4.4 changed the perfdata output (added checktime=, the ", of which
X matched the regex" text, and inBitps/outBitps per interface) under
the label "general linter and style fixes", which broke existing RRD
graph definitions that expect the old field layout.

This adds an opt-in --legacy-perfdata flag that restores the exact
pre-1.4.4 output for users who need to keep existing RRDs working,
while leaving the new, richer default format untouched for everyone
else.

No change to default behavior when the flag is not given.
plugins= in the check_multi header used number_of_matched_interfaces
(i.e. how many interfaces matched the regex), but the loop below only
prints a check_snmp block for interfaces that are neither ignored nor
administratively down. This mismatch (e.g. plugins=44 while only 4
blocks are actually printed, because 40 of the 44 matched interfaces
are administratively down) can confuse RRD/check_multi consumers that
rely on this count to know how many data sources to expect.

plugins= now reflects the actual number of printed blocks, independent
of --legacy-perfdata. The ", of which X matched the regex" status
text is unaffected, since that's meant to report the raw regex match
count regardless of admin-down status.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant