-
Notifications
You must be signed in to change notification settings - Fork 297
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
[3] "Deactivated Switch" for Collectors. #715
Comments
Excellent idea, I also thought about it before. Ideally it should be shown visually in the manager. But please let's call this flag "enabled" [Y/N]
a. |
That's possible. The default for enabled should be "yes", right? Or should a bot be deactivated unless it's explicitly activated? Is there a guideline how to deal with such boolean Input (Y/N, 0/1, True/False [and string representations therof])? Because user-input might be manifold. EDIT:
Yes, that would be nice. But currently out of scope. |
Concerning the syntax of boolean in the config files: in JSON of course it needs to be a boolean value . That is a clearly defined syntax for JSON. Not sure if I understood the question correctly.
|
Yes, this question does concern the manager. But it does also concern the JSON configuration, when we interpret it in a naive way, because:
That's why I asked if there is a guideline on dealing with boolean's. Unintended misconfiguration is so easy here ;-( |
Generic answer:
That is related to the issue of having a "intelmqctl configtest" tool for 1.x or 2.0 [1] http://json-schema.org/
|
See also certtools/intelmq-manager#81 |
Sorry, I don't get that reference. Why is the "Cymru Encoding Fix" relevant? |
On 09/30/2016 10:08 AM, Dustin Demuth wrote:
Because you asked how booleans should be saved:
The answer is: Save as boolean. |
This introduces the enabled-switch for all Collector-Bots. By doing so it fixes certtools#715. The Collectorbot was extended with an own start-function which checks if the enabled paramter is present and was set to a representation of False. To check the "representation of False" the function to_bool was introduced in utils.py, which maps well-known-text to booleans. It has a a fallbackmode parameter which determines if the function returns true of false if no mapping was found. As long as to_bool does not evaluate to False the bot will be started.
Anyway, I just finished an implementation of this switch. See: |
Why only for collectors? Implementation looks good. Tests would be nice, but not necessary. |
I was sure that this question will come up, eventually. If this is not the problem, the code could easily be moved to the bots base class. BTW: Do we want to merge this while it's hot? I'd create a PR then. |
I thought more of parsers. E.g. in our current setups 20 collectors and parsers are stopped. But anyway, the functionality is not at specific to collectors, so why constrain the use case? Yes, you can create a PR and I merge it in the next days. Or I'll just cherry pick the commits^^ |
That's ok if done intentionally.
But yes, I think that should be a property of the base class. |
That's more complex. If the code I proposed here can be kept, this could be achieved by adding a "config-reload" (a ticket exists for that somewhere) option and an additional check for |
We can implement that separately. Apart from that I agree with the above said and think an "enabled" option is a good idea. +1 |
Since Bots were split into different classes, it's possible to enhance certain types of bots. That is a very good development.
I'd like to add a "Deactivated Switch" to the CollectorBot, in order to enable the deactivation of Collectors. When a bot is starting / restarted it checks if it was deactivated, and automatically stops if this is the case.
This is useful for a temporary deactivation of collectors , for instance when feeds are providing erroneous data. Restarting the whole bot-net would not start such bots, once a "deactivated switch" is in place.
The text was updated successfully, but these errors were encountered: