Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extraneous spacing in plugin output from errors and thresholds sections #223

Open
atc0005 opened this issue Aug 4, 2023 · 0 comments
Open
Assignees
Labels
bug Something isn't working errors output/plugin plugin output intended for monitoring system ingest question Further information is requested thresholds
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Aug 4, 2023

Here we emit two leading nagios.CheckOutputEOL separators:

go-nagios/sections.go

Lines 47 to 54 in 06615b3

fmt.Fprintf(w,
"%s%s**%s**%s%s",
CheckOutputEOL,
CheckOutputEOL,
p.getErrorsLabelText(),
CheckOutputEOL,
CheckOutputEOL,
)

This should probably be a single separator.

Here we opt to emit the separator if sections are not displayed:

go-nagios/sections.go

Lines 122 to 140 in 06615b3

// Hide section header/label if threshold and error values were not
// specified by client code or if client code opted to explicitly hide
// those sections; there is no need to use a header to separate the
// LongServiceOutput from those sections if they are not displayed.
//
// If we hide the section header, we still provide some padding to
// prevent the LongServiceOutput from running up against the
// ServiceOutput content.
switch {
case !p.isThresholdsSectionHidden() || !p.isErrorsHidden():
fmt.Fprintf(w,
"%s**%s**%s",
CheckOutputEOL,
p.getDetailedInfoLabelText(),
CheckOutputEOL,
)
default:
fmt.Fprint(w, CheckOutputEOL)
}

This default separator is likely not needed.

@atc0005 atc0005 added bug Something isn't working question Further information is requested output/plugin plugin output intended for monitoring system ingest errors thresholds labels Aug 4, 2023
@atc0005 atc0005 added this to the Future milestone Aug 4, 2023
@atc0005 atc0005 self-assigned this Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working errors output/plugin plugin output intended for monitoring system ingest question Further information is requested thresholds
Projects
None yet
Development

No branches or pull requests

1 participant