checkmk
checkmk copied to clipboard
Added compability for python3 in mk_sap.py
After Upgrade to 2.0.0p3 I've noticed the sap checks are only working with python2 because required python-sapnwrfc-0.19 isn't maintained anymore and not available for python3.
So I've rewritten the check to use maintained pyrfc.
Its a quick and dirty implementation I think some refactoring is needed but the check is operational.
Hi, thank you for this PR. Unfortunately, we can at the moment only accept pure bug fixes, as stated in our contribution guidelines. Also, as you stated yourself, we would probably first need some refactoring here.
But it would be nice if that could happen in a timely manner. The old solution was simply neglected for years.
Hi, thank you for this PR. Unfortunately, we can at the moment only accept pure bug fixes, as stated in our contribution guidelines. Also, as you stated yourself, we would probably first need some refactoring here.
This is a bug fix as the old solution is not working anymore with CMK 2 and Python3.
A few adjustments should be made, however.
- Timeout parameter if system can not be reached (network, shutdown etc.) and then correct message the system is not available
- Errorhandling if something in the return value is not correct (e.g. incorrect values/config in the RZ20)
Currently, we help ourselves with very many SAP systems (~ 100) to store their own mk_sap_"landscape" scripts and then to work with their own configuration files (sap_"andscape".cfg) to use several processes at the same time (otherwise the mk_sap run would take too long until it is through all systems), perhaps there would be a nicer solution here that the script independently here several processes. So when mk_sap is started on a central monitoring server.
UPDATE: However, the most important thing is that the "Dialog" service should trigger an alarm as soon as the system is no longer accessible, NOT the "SAP State" service. Because the "mk_sap" can run on a completely different server and that makes it cumbersome to group. Currently the "Dialog" service of the SID would not generate an alarm if the "mk_sap" does not provide any values anymore (currently only "SAP State" generates the alarm). This is what I meant above with the clean error handling.
@jherbel / @LarsMichelsen is there already something new for this? a bit sad that you should "officially" still use the ancient python2 when there is already something (even if it should be adapted a bit).
Just to inform the possible reader of this PR: I tried to describe our current problem with this PR in our forum. Here's the quote, so don't need to click the link:
Just a short update on this case. We’re currently working on an improvement regarding the efficiency/speed of our exporter. The first step is finished (adding metrics to the “OMD mysite performance” service). Please keep an eye to our werks, even if I try to spread the updates, e.g. to this topic.
Indeed, I am already in contact with a well known user. If the results are positive, I do see chances to merge the PR. There may be some changes needed, anyway.
Thanks to everyone for their patience, so far.
@stefan7018 I took some time here. We (tribe29) try to find a way to merge your changes. For that, we need some more things to do/adjust. Most likely it's about the problems mentioned by @LMS235. Please take a look at his suggestions. Some of them may need to split up into follow-up commits. Others may be integrated directly with this PR.
I can understand, if you want to opt out of this PR. In this case, we would like to continue your work with some other users from our community. Please let us know if this is okay for you.
And what we should not forget when it is addressed, SNC support for the connections. This is becoming more and more important.
@stefan7018 I took some time here. We (tribe29) try to find a way to merge your changes. For that, we need some more things to do/adjust. Most likely it's about the problems mentioned by @LMS235. Please take a look at his suggestions. Some of them may need to split up into follow-up commits. Others may be integrated directly with this PR. I can understand, if you want to opt out of this PR. In this case, we would like to continue your work with some other users from our community. Please let us know if this is okay for you.
Hey @godspeed-you first thanks to take care about this topic! :) Actually I've no time to contribute here and implement this required changes so please take over and improve this PR. Let me know if you have any further questions.
Is there a timeline in the meantime? Some things have been discussed. First and foremost, creating an officially supported state (python 3 and pyrfc) would be priority 1.
Hi, I'm currently waiting for another feedback. As soon as this is clarified, we can pick up this PR and merge the first step that has been made here.
Small update on this one: One of our developers is currently preparing the merge.
Good to hear, is there an approximate schedule yet?
Especially the issue that the "SAP State hostname" is also displayed on the system itself (and not only on the host on which mk_sap is running) would be extremely important.
Currently, I'm waiting for the PR to be merged. There is no schedule for the next step, yet.
News on this case: My colleagues have been able to merge the changes. Thanks to all contributors and helping hands! You'll find the change in this commit: 3c6b70f75a7bbe2c69f80efdd800626255b63ef0 Also in this werk: #15545