sni / lmd

Livestatus Multitool Daemon - Create livestatus federation from multiple sources
https://labs.consol.de/omd/packages/lmd/
GNU General Public License v3.0
42 stars 31 forks source link

Fix Icinga 2 version regex for v2.11.x #96

Closed druchoo closed 3 years ago

druchoo commented 4 years ago

Seems version format was changed in v2.11+. Update regex based on:

druchoo commented 4 years ago

Fixes https://github.com/sni/lmd/issues/92.

Tested with v2.10.x / v2.11.x:

$ icinga2 --version | head -n1
icinga2 - The Icinga 2 network monitoring daemon (version: r2.10.2-1
```)

$ icinga2 --version | head -n1 icinga2 - The Icinga 2 network monitoring daemon (version: 2.11.3-1)

sni commented 4 years ago

That boost regular expression is specifically created for icinga2 but much to unspecific to be used on all possible cores. I prepared the regex already, so that as soon as icinga2 will add the -icinga2 suffix to its livestatus version, it will work again. There is a pull request for icinga2 here: https://github.com/Icinga/icinga2/pull/7931 From the comments i assume its targeted for Icinga 2.13

druchoo commented 4 years ago

Ok I understand. Would you consider something like ^(r?[\d\.-]+|.*\-icinga2) until https://github.com/Icinga/icinga2/pull/7931 is merged so LMD will work with Icinga 2.11/12?

sni commented 4 years ago

no, because that regular expression will match on everything that looks like a number and will break everything except icinga2.

druchoo commented 4 years ago

Ok np. I've patched for my use case and the info is here for anyone else that needs it. I guess you can close this PR?

Thanks for your work on this project and time on this issue!

sni commented 4 years ago

Glad it works for you. I will keep it open till its fixed in icinga2. That way its easier to find.