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

[Feature Request] Generic output formatting with global format parameter #65

Open
RincewindsHat opened this issue Apr 4, 2023 · 5 comments

Comments

@RincewindsHat
Copy link
Member

Idea

Implement the output generating code in a way to have one or multiple parameters to specify the output formatting as a whole.

For example, some monitoring systems still use a single line as output, one might want to have output fitting on a pager or, and this is speculation for the future, properly machine readable output might be a thing.

Ideally, in the end I can do something like this:

# my_check --foo bar
[OK] all ok
  \_ [OK] bar

# my_check --foo bar --output one-line
[OK] all ok - [OK] bar


# my_check --foo bar --output whatever
ok - all ok : ok - bar
@martialblog
Copy link
Member

I'm not sure if this is something the downstream code should handle or not. Might be too prescriptive.

This would also depend on how this lib is used. E.g when out config module is not used and people use their own CLI libs.

@RincewindsHat
Copy link
Member Author

You are right, my idea was more in the direction of having a parameter for overall.GetOutput or somewhere to say: I want to have Icingaweb output format ([OK] and such things are nicely formatted there) or one line output (might be better for naemon/zabbix and similar systems.

@RincewindsHat
Copy link
Member Author

Additional idea: sorting the subchecks by criticality to put the worst one at the top

@martialblog
Copy link
Member

@RincewindsHat you mean for the Overall?

@RincewindsHat
Copy link
Member Author

jup, mainly, also this could/should be applied to the printing of the subchecks too.

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

No branches or pull requests

2 participants