Skip to content
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

Fix icinga_version to detect version without leading v/r #1956

Merged
merged 1 commit into from
Sep 26, 2019
Merged

Fix icinga_version to detect version without leading v/r #1956

merged 1 commit into from
Sep 26, 2019

Conversation

kevin-olbrich
Copy link
Contributor

CentOS 7:

[root@server121 ~]# icinga2 --version 2>/dev/null | grep version
icinga2 - The Icinga 2 network monitoring daemon (version: 2.11.0-1)
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl2.html>
  Platform version: 7 (Core)
  Kernel version: 4.4.193-1.el7.elrepo.x86_64

Debian 10:

root@slde0030 ~ # icinga2 --version 2>/dev/null | grep version
icinga2 - The Icinga 2 network monitoring daemon (version: r2.11.0-1)
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl2.html>
  Platform version: 10 (buster)
  Kernel version: 4.19.0-6-amd64

At least for CentOS, version is not prepended by "v" or "r".

@dnsmichi
Copy link
Contributor

r and v should still be kept, they may re-occur. Also, older versions of Icinga don't work with this patch. Please see #1957 for a generic regex :-)

@kevin-olbrich
Copy link
Contributor Author

r and v should still be kept, they may re-occur. Also, older versions of Icinga don't work with this patch. Please see #1957 for a generic regex :-)

You are right, I totaly missed that point :-)
The regex from #1957 still detects all other rows, shouldn't it be something like that to prevent it?:
'\(version: [rv]?\K\d+\.\d+\.\d+[^\)]*'

@dnsmichi
Copy link
Contributor

Yep, it should but somehow the rest works in that script. I honestly don't understand the awk parts with the version compare. My PR was just a quickfix to allow a release soon-ish.

Maybe you can rebase your branch PR and apply the regex fix, force push the branch?

@kevin-olbrich
Copy link
Contributor Author

Yep, it should but somehow the rest works in that script. I honestly don't understand the awk parts with the version compare. My PR was just a quickfix to allow a release soon-ish.

Maybe you can rebase your branch PR and apply the regex fix, force push the branch?

Done

@kevin-olbrich kevin-olbrich changed the title Fix icinga_version to detect version on CentOS7 Fix icinga_version to detect version without leading v/r Sep 24, 2019
@Thomas-Gelf Thomas-Gelf merged commit 237572a into Icinga:master Sep 26, 2019
@Thomas-Gelf
Copy link
Contributor

Thank you!

@Thomas-Gelf Thomas-Gelf added this to the 1.7.0 milestone Sep 26, 2019
@kevin-olbrich kevin-olbrich deleted the patch-1 branch October 10, 2019 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants