-
Notifications
You must be signed in to change notification settings - Fork 474
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
Upstream PR for all bugfixes since first commit of Nutanix Prism checks #638
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA. |
From a PM perspective, I approve this change. It creates value for Checkmk and fixes bugs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your contribution. In general, it looks good, it even has tests ❤️ very nice!
To merge I would add three (or two) werks, but I need some more context to the following items:
- vm memory -> unknown if no memory values existing fixed
- vm_tools -> state can be ignored
It would be good to know what the previous behavior was, and how it was fixed, so I can come up with a Werk that other customers can understand.
Can you split your two commits into three commits? Two commits for the two fixes and an additional commit for the new feature.
You can add the style change in cmk/base/plugins/agent_based/prism_cluster_io.py
to any of these commits, but it would be cool if you could mention it in the commit message.
This probably seems overly picky, but git history is often the only way to understand the intent of changes from years ago, so we try to maintain it as best we can.
I've also left four code annotations with questions and comments, I'm open to discussiong these issues.
@@ -0,0 +1,118 @@ | |||
#!/usr/bin/env python3 | |||
# -*- encoding: utf-8; py-indent-offset: 4 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use the checkmk license header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this now a problem in all the other checks made before there is the same header?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before asking you to change this, i asked internally and the official statement is, that we should only use the checkmk license header.
your files were the only exception that used non-official license headers. our license header check was very lax in this regard. today i merged a change which applies stricter rules from now on.
) | ||
|
||
|
||
def _create_interface(section: Section) -> interfaces.Section[interfaces.InterfaceWithRates]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be possible to move the content of this function into the parse function?
making the return type of the parse function interfaces.Section[interfaces.InterfaceWithRates]
this way you could remove the calls to _create_interface
from the discovery and check function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must added this workaround to make tests working. I copied this part from one of your own checks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is 100% the same as the code for esx_vsphere_counters_if
def check_prism_host_networks( | ||
item: str, params: Mapping[str, Any], section: Section | ||
) -> CheckResult: | ||
data = section.get(item) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure that those statements are really needed?
i would think that this case is already handled by interfaces.check_multiple_interfaces
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the other checked/tested code versions where not working together with the tests.
That was the only way the test subsystem was happy. My original code (2.2 mkp file) was not so "bloated".
Ok that's a point. As this was a commit of all the collected changes from my repo it is possible that i forgot to mention.
I think some constructs are over complicated inside CMK if you want to make the test environment happy. |
Thanks for your response and the additional info about your change. We are happy that you share your domain knowledge with checkmk and want to include this in our product. |
Yes why not :) |
Add a new check to monitor host networks via prism refs #638 Change-Id: I600a434b11f4c7aee3bdb29a30d3560c65e5542c Co-Authored-By: Benedikt Seidl <[email protected]>
@Yogibaer75 yesterday i merged a first version of your change into the master branch. can you please check in a daily master build if it is working as intended? i've implemented some bigger changes for parsing the json file, as it was suggested in the internal code review. the internal code review also opened the question if the api already returns rates, or if those are global counters? as far as i understand those are rates based on a 30 seconds interval. is the comment i added correct? checkmk/cmk/base/plugins/agent_based/prism_host_networks.py Lines 78 to 80 in b9f640b
thanks again for your contribution! |
Yes these are already rates and no counters. And the rate is based on the last 30 seconds. I found no other way than this to get the interface data. For the master build i must check the next days if it does what it should :) |
This PR request includes two bug fixes and 1 missing check for Nutanix.
Missing checks - host network interfaces
Bug fixes