Config file, toggleable Livestatus, NagiosSpoolfile and NagfluxSpoolfile modules#7
Merged
Config file, toggleable Livestatus, NagiosSpoolfile and NagfluxSpoolfile modules#7
Conversation
added 9 commits
January 13, 2026 11:52
make livestatus, nagios spoolfile and nagflux spoolfile inputs toggleable. Add a new config section for them, and deprecate some options that were in the main section of the config file. the deprecated options may still be used, but will complain in the log about being deprecated. Add helper functions that use code relection to get a config value given the primary path and older deprecated paths. Depending on the enablement, dont construct and use the modules for livestatus, nagios spoolfile collector and nagflux spoolfile collector
…g, exit the program if there is none
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add "Enabled" option to the [Livestatus] config section, add [NagiosSpoolfile] section with "Enabled,Folder,WorkerCount" options, add [NagfluxSpoolfile] section with "Enabled,Folder" sections. Only the enablement toggles are new, the other options previously had values found inside [Main] section.
The older options for these are simply deprecated. Write a function that uses reflection to discover the final parsed config struct and take the preferred option if its available, which also reports the older deprecated paths under the [Main] section.
Update the example config and test configs embedded in the test files to the newer config standard.
Use another function to exit the program if the parsed config does not result in any watchers/listeners/spoolers being activated. This behavior was tested to work.
Also update the code that it passes the newer linter checks on the latest golangci. This includes moving some files around, renaming packages to avoid conflicts with the standard library, preallocations on dynamic arrays, unhandled errors, functions that always return nil on an error etc.
Another test disabled livestatus, NagiosSpoolfile and NagfluxSpoolfile only left the ModGearman perfdata listener. Worker was still created and consumed the gearman queue.