Hi Florian, Thank you for your input. I was trying using >= yesterday and it worked. I'll try using the proper match () today.
Hi Gunnar and Michael, Thank you for the information. Not sure if this is also bug, on CentOS 7 I got this when checking --version icinga2 --version icinga2 - The Icinga 2 network monitoring daemon (version: v2.4.1-99-gcd9cb47) ... System information: Platform: ME="cpe:/o:centos:centos:7 Platform version: UPPORT_PRODUCT_VERSION="7 Kernel: Linux Kernel version: 3.10.0-229.7.2.el7.x86_64 Architecture: x86_64 The description on bug #10784 said that it affect RHEL <=6.x. Thank you. Regards, Panji On Wed, Jan 27, 2016 at 12:56 AM, Michael Friedrich < michael.friedr...@netways.de> wrote: > > > On 26 Jan 2016, at 14:08, Gunnar Beutner <gunnar.beut...@netways.de> > wrote: > > > > Hello, > > > > The >= operator can be used to alphabetically order strings: > > > > <1> => "a" >= "a" > > true > > <2> => "a" >= "b" > > false > > <3> => "b" >= "a" > > true > > > > As you’ve pointed out match() and regex() are much better choices for > this problem. > > > > > > The fact that PlatformName contains garbage atm (NAME=„…) is already > being worked on. > > Will hit the next bugfix release - > https://dev.icinga.org/issues/10784#change-47228 > > Please check the roadmap for open issues before asking for a release date > ;-) > > Kind regards, > Michael > > > > > Kind regards > > Gunnar Beutner > > > > > > > > > > On 26/01/16 14:04, "icinga-users on behalf of Florian Bachmann" < > icinga-users-boun...@lists.icinga.org on behalf of bachman...@gmail.com> > wrote: > > > >> Hi, > >> > >> > >> I would guess that the >= operator is strictly for comparing numerical > values. For string matching you would really need to use either of the > built-in "match()" or "regex()" functions. > >> > >> > >> Like so: > >> > >> > >> assign where match ("Ubuntu*", PlatformName) > >> > >> > >> Kind regards > >> Florian > >> > >> > >> 2016-01-26 10:33 GMT+01:00 Muhammad Panji > >> <sumodi...@gmail.com>: > >> > >> Hi All, > >> I'm trying to use Platform* constants to group hosts. My > /etc/conf.d/groups.conf below : > >> > >> > >> object HostGroup "Ubuntu" { > >> display_name = "Ubuntu" > >> > >> assign where PlatformName >= "Ubuntu" > >> > >> } > >> > >> object HostGroup "PlatformName" { > >> display_name = PlatformName > >> > >> assign where PlatformName >= "" > >> } > >> > >> object HostGroup "PlatformArchitecture" { > >> display_name = PlatformArchitecture > >> assign where PlatformArchitecture >= "" > >> } > >> > >> Unfortunately the PlatformName show _NAME="Ubuntu 14.04.3 LTS instead > of only "Ubuntu 14.04.3 LTS". PlatformVersion also show ID=\"14.04 instead > of only 14.04. > >> > >> Is this expected or bug? if expected why icinga have to use _NAME and > ID in front of each value? Are there any way including text processing to > remove _NAME and ID? > >> > >> I use Ansible to provision icinga so I might be able to assign ansible > variable but I think using default consts might be better or maybe set > variable per host is better? > >> Thank you. > >> Regards, > >> > >> > >> > >> > >> > >> -- > >> Muhammad Panji > >> http://www.panji.web.id > >> http://www.kurungsiku.com > >> > >> > >> > >> _______________________________________________ > >> icinga-users mailing list > >> icinga-users@lists.icinga.org > >> https://lists.icinga.org/mailman/listinfo/icinga-users > >> > >> > >> > >> > >> > >> > > > > -- > > Gunnar Beutner > > Senior Developer > > > > NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg > > Tel: +49 911 92885-0 | Fax: +49 911 92885-77 > > CEO: Julian Hein, Bernd Erk | AG Nuernberg HRB18461 > > http://www.netways.de | gunnar.beut...@netways.de > > > > ** OSDC 2016 - April - netways.de/osdc ** > > ** OSBConf 2016 - September - osbconf.org ** > > _______________________________________________ > > icinga-users mailing list > > icinga-users@lists.icinga.org > > https://lists.icinga.org/mailman/listinfo/icinga-users > > > -- > Michael Friedrich, DI (FH) > Senior Developer > > NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg > Tel: +49 911 92885-0 | Fax: +49 911 92885-77 > CEO: Julian Hein, Bernd Erk | AG Nuernberg HRB18461 > http://www.netways.de | michael.friedr...@netways.de > > ** OSDC 2016 - April - netways.de/osdc ** > ** OSBConf 2016 - September - osbconf.org ** > _______________________________________________ > icinga-users mailing list > icinga-users@lists.icinga.org > https://lists.icinga.org/mailman/listinfo/icinga-users > -- Muhammad Panji http://www.panji.web.id http://www.kurungsiku.com
_______________________________________________ icinga-users mailing list icinga-users@lists.icinga.org https://lists.icinga.org/mailman/listinfo/icinga-users