-
Notifications
You must be signed in to change notification settings - Fork 284
Feature/new output infra #2064
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/new output infra #2064
Conversation
|
that's a lot of code... :-) From a quick look, i would prefer the But I'd rather change the guidelines :-) Besides that, I'd would prefer to keep vendor specific things out. But i am still curious, is there an example of how the icinga2 specific output differs from the normal output. And |
|
It currently looks like this: One-lineThis output format is for systems which display only a single line of output. I don't know if and which systems that would be icingaweb2This format is multi-line and adds some indentation to improve readability if there are multiple "subchecks" (individual tests which are summarized by the main test). Summary onlyThis format was just added because I can. Maybe there is a purpose for that. Very short messages for alerting via SMS or something like that. mp-test-jsonThis is a JSON based output format which is a) good for internal testing ( |
No strong opinions on that, whatever satisfies the most people.
I do agree with that, in my ideal world formatting is not our problem and we just provide the pure information (ideally this is where the JSON experiment is going). |
|
thanks for the clarification. |
|
The current design idea is, that the summary is either set by the plugin or generated automatically (mostly not that usefull probably). So that would be the duty of Is there some highlighting in Naemon (Thruk then I guess) which would be nice to have? Thanks for the Input. I think I will remove |
No idea what you mean. Some more ideas and issues with plugin output we face so far is that some plugins have html output to present the data in a more human friendly way. However, this looks bad on a pager or in a sms. But issues like this could easily be solved with JSON data. |
|
Making output more streamlined is good, so I'm very happy anybody is caring about that. |
|
@waja Could you elaborate a bit on what you mean with "I'm using plugins output in some setups for detecting things"? Do you have some tooling which tries to parse the output? And yes, I would say 3.0 for changes like these. |
44b4427 to
7c8c9d9
Compare
|
Imagine anybody uses the monitoring plugins as snmp extends as described in https://rafael-monteiro.medium.com/monitoring-linux-systems-with-snmp-extend-method-55769ddae505 and gather the status via |
This PR contains my approach to a new centralised infrastructure for output generation in C.
The idea is to have a data structure for check results, which contain the test result (exit code), the free form output and the perfdata.
The introduced funtionality should reduce the various hacks which were introduced to get the output in the right form and, at least in the bigger picture, reduce complexity overall.
An additional advantage is the possibility to have different formats which can be selected at runtime.
These formats currently include a "one line" format (similar to what the plugins produce right now), a "IcingaWeb2" format which looks generally nice and especially in "IcingaWeb2" the main web interface in Icinga setups.
More experimental is a JSON based format (currently named
MP_FORMAT_TEST_JSON) with which the end to end tests for plugins can be improved (better selection of partial results or perfdata).Currently this mostly useful for tests, but might be a good approach for a future replacement of the current output.
In addition to the general functionality I modified
check_swapto use the new functionality to have a demonstrator.For generating JSON I did include (vendor) the
cJSONlibrary inlib/vendor/cJSON.replaces #1979