-
Notifications
You must be signed in to change notification settings - Fork 580
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
Add support for in-memory negation of CheckCommand results #6937
Comments
Hey guys, I just thought: Why not to abstract this to a general check result transformation configurable via our DSL (and implemented completely via our DSL?) and this negate stuff being a concrete use case. E.g. I've a bunch of DNSBL checks in my private setup. They regularily time out, but I don't care and would like to just turn UNKNOWN to OK. |
I've removed this from 2.11, since the argument is valid. Needs re-iteration on the implementation details. |
@dgoetz rescheduling this for later this year. This needs a better design round after 2.11 has been released. |
Something like this:
The scope is a problem, since you may not have access to the original objects on a command endpoint. So this can only be used as command output replacement strategy. Just a thought from yesterday evening, I'm not sure about it yet. |
I've got the following idea on this: Either Checkable and/or CheckCommand have a new config attribute "transform_check_result". This shall be either not set (null) or a function which takes one parameter – the check result – and may modify it:
|
Let's look into the |
You're not working on this, right? |
Would also be useful as full-blown closures in the DSL to manipulate other returned values:
This would eliminate a plethora of wrapper scripts. +1 for this |
For completeness to also have that references from here: this was brought up over at https://community.icinga.com/t/use-closure-like-statement-to-manipulate-response/8796 and I also suggested some alternative configuration over there (which I think would be more feasible to implement):
|
Unassigned myself, because I'm not working on this (and I don't see me working on this in the future.) I like the idea by @julianbrost. |
For the record, I'd also benefit from #6937 (comment) . But -for the case not everyone likes DSL functions- I'm open to alternatives. E.g. to a per check command and/or checkable mapping of target exit codes by plugin's exit code. But now while writing these lines, I can't think of any more in that mapping beyond OK -> crit. and vice-versa. So a bool should do it as well. |
💡 #6937 (comment) is already possible, at least theoretically. Create your service as usual, preferably -for your own sake- w/o notifications. Then create a dummy service taking its output from the first service and negating the exit code via DSL. |
Expected Behavior
Current Behavior
One needs to incorporate the negate plugin into the current CheckCommand which is cumbersome.
Possible Solution
Add support for built-in (in-memory) status negation. Handling should be available in all CheckCommand objects and automatically inject the check result creation in libmethods. This involves not only pluginchecktask but also our internal in-memory checks.
Context
@dgoetz asked for this on NET Discourse.
The text was updated successfully, but these errors were encountered: