Change mode execution to allow performing multiple checks sequentually. #46
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.
With this PR I changed the handling of the --mode parameter to allow execution of multiple --mode parameters being provided.
If CPU and memory of a node shall be monitored at once, simply pass "-m cpu -m memory" along with the other usual parameters.
This will return both outputs as if only one of the parameters at once and then be concatenated. The exit code for the check_pve.py will be the highest from all the checks which were performed.
Additionally I added modes which allow to monitor all lxc's/vm's regardless of the host they are running on. These modes are calles -m all_lxcs and -m all_vms.
Furthermore I added a new parameter --checks which allows to set additional parameters which can be used to customize already given functionality. To be precise, I added the possibility to provide "vm_storage" as an argument to --checks. With this argument, the -m vm, vm_status, all_lxcs and all_vms mode will additionally monitor the disk usage of the lxc/vm.
Currently update of the documentation is missing in this PR. I wanted to wait with that until I get some feedback about the implementation and further suggestions.