checkmk icon indicating copy to clipboard operation
checkmk copied to clipboard

Added compability for python3 in mk_sap.py

Open stefan7018 opened this issue 4 years ago • 5 comments

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.

stefan7018 avatar Apr 30 '21 09:04 stefan7018

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.

jherbel avatar Apr 30 '21 09:04 jherbel

But it would be nice if that could happen in a timely manner. The old solution was simply neglected for years.

LMS235 avatar Apr 30 '21 09:04 LMS235

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.

Yogibaer75 avatar Jan 26 '22 09:01 Yogibaer75

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.

LMS235 avatar Jan 26 '22 18:01 LMS235

@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).

LMS235 avatar Mar 04 '22 07:03 LMS235

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.

godspeed-you avatar Nov 30 '22 15:11 godspeed-you

@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.

godspeed-you avatar Dec 07 '22 10:12 godspeed-you

And what we should not forget when it is addressed, SNC support for the connections. This is becoming more and more important.

LMS235 avatar Dec 08 '22 14:12 LMS235

@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.

stefan7018 avatar Dec 08 '22 15:12 stefan7018

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.

LMS235 avatar Mar 26 '23 08:03 LMS235

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.

godspeed-you avatar Mar 26 '23 10:03 godspeed-you

Small update on this one: One of our developers is currently preparing the merge.

godspeed-you avatar Apr 21 '23 10:04 godspeed-you

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.

LMS235 avatar May 04 '23 08:05 LMS235

Currently, I'm waiting for the PR to be merged. There is no schedule for the next step, yet.

godspeed-you avatar May 15 '23 07:05 godspeed-you

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

godspeed-you avatar Jun 09 '23 12:06 godspeed-you