icinga2-diagnostics
icinga2-diagnostics copied to clipboard
Rewrite in Python
Should we do a complete rewrite in Python?
Some users suggested that a python Version of this script might be more powerful and easier to maintain. Our main goal is to allow to run icinga diagnostics with as less hassle as possible on all platforms that run Icinga. Even those not officially supported.
So what we need from you as part of the community:
- Would you be ok with a python script?
- Can it run on the OS you are using for Icinga?
- Which version of Python do you have on your Icinga hosts?
- Would you be ok with a python script? -- yes
- Can it run on the OS you are using for Icinga? -- yes, ubuntu & centOS for me
- Which version of Python do you have on your Icinga hosts? -- 2.7.15 (Ubuntu18), 2.7.12 (Ubuntu16), 2.7.? CentOS 7
Hi,
- DEV knows a lot of Python, so yes.
- Since el5 und sles11 are EOL, you can expect Python 2.7 at least. Windows is a different story, but you may get things done there too.
- Python 2.7 is EOL but available in el7, sles12, Ubuntu/Debian.
I would write it in a way that it runs on Python 2 and 3. There are some language differences with dictionary iterators, but nothing which cannot be solved. If you need a good book, I have one on my desk - Head first Python.
I'd also suggest to move certain parts into libraries and packages, and use setup.py
to create a package / pip package. I've done that with Pretix plugins already. That way you can point your users to 1) a release tarball on GitHub 2) Pypi pip install.
If you want, let's discuss this on Monday. I also want to deprecate icinga2 troubleshoot
as CLI command.
Cheers, Michael
Ok, thanks for the input. I asked the community to join the conversation so we can keep Diagnostics available on all OSes people run Icinga on.
One side note from an ops point of view: I would only release it via pip if that can make package building easier. I would never suggest that someone has to install it via pip. So either an easy to use tarball (especially for non-standard-os) or, much better, packages in the Icinga repository.
For FreeBSD:
- Would you be ok with a python script? Sure
- Can it run on the OS you are using for Icinga? Yes
- Which version of Python do you have on your Icinga hosts? 2.7 and 3.6 are the default versions in FreeBSD ports
I'm not a user of icinga2-diagnostics, but I think you shouldn't focus on supporting both Python 2 and 3 as Python 2.7 is 10 years, is EOL and won't be maintained after the end of this year and Python 3 is available pretty much everywhere.
The problem I can see: RHEL7 and other ELs are here for the next years, and they cannot simply switch from 2 to 3.
If a user must install python3 in order to run a diagnostics script, feels wrong. Especially since none of the other products enforces this already.
PHP via icingacli would be a slightly better option, poke @lippserd and @thomas-gelf about it :)
I don't know RHEL very well, but it seems to only be a matter of activating some repositories and install python3 with yum
.
@johanfleury yes, but that's a lot for just enabling a simple diagnostics tool which main focus is to be easily usable.
If we rewrite this in Python, we must be version 2-3 compatible. It is not much of an effort to do so. We could also consider the Web and CLI (PHP) option. Though I'm unsure what to do with satellites and agents which may not have PHP installed. We already have icingacli
as a separate package but it is not fully independent from Web at the moment if I remember correctly. Python is just there.
Hi,
Python shipped via OpenIndiana (openindiana.org).
$ uname -a
SunOS zfs-2011 5.11 illumos-9c7c0c4b59 i86pc i386 i86pc
$ python --version
Python 2.7.15
HTH, Marianne
Oracle Solaris 11.1 X86
# python --version
Python 2.6.8
Raspbian GNU/Linux 9 (stretch)
# python --version
Python 2.7.13
Debian GNU/Linux 9 (stretch)
# python --version
Python 2.7.13
CentOS release 6.10 (Final)
# python --version
Python 2.6.6
CentOS Linux release 7.6.1810 (Core)
# python --version
Python 2.7.5
Fedora release 30 (Thirty)
# python --version
2.7.16
Python 2.6 shouldn't be too hard, if you have CI jobs for PRs.
@dnsmichi I'm counting on you to give me some hints for that. ;-)
Just something like this, which runs the script after a short icinga2 installation for instance. https://docs.travis-ci.com/user/languages/python/