On 06/02/17 09:58, Jan Matis wrote:
Thank you.
>are you using an automated method to register the hosts
yes

>you can just add the host (via templates) to the host group and that way any service check assigned to the group will be applied to the host in that group. That is exactly what I'm doing. The problem is I have an exception of this rule and I wanted to avoid hard coding those exceptions into my "autoregister" script and just set them in services.

Jan



Can you share the error you are getting ? it would be helpful to help understand the issue.


On Sun, Feb 5, 2017 at 1:35 PM, Assaf Flatto <ici...@flatto.net <mailto:ici...@flatto.net>> wrote:

    On 02/02/17 18:32, Jan Matis wrote:
    Hi all,

    this is to my understanding quite easily achievable in icinga2
    : (not tested, but this is where i'd start )

    apply Service "app: tomcat" {
      import "generic-service"
      check_command = "nrpe"
      vars.nrpe_command = "check_tomcat"
      assign where "tomcats" in host.groups
      ignore where match("internal*", host.name <http://host.name>)
    }


    Unfortunately, I have icinga1 on the server,  where I need to
    implement this
    (and no power over changing to icinga2), so I have started with
    define service{
            use generic-service-nobody
            hostgroups               tomcats
            host_name !internal*
            service_description   app: tomcat
            check_command  check_nrpe!check_tomcat
    }

    the  usage of * failed during service icinga checkconfig
    and after going through icinga1 documentation I'm starting to
    think this it not possible in icinga1.

    The reason why I'm trying to do this, is that we have host
    definitions that include aws instanceid in the host name and
    those instance ids are changing in time. so I also can not write
    whole host name (as internal_i-234sdq234) because upon next
    icinga restart that host definition might not exist anymore and
    there could be another (internal-i_123asdf324tre )

    Is there any way to use regular expression in service definitions
    in icinga1 ? Or any other way of achieving this in icinga1 ?

    many thanks in advance
    Jan



    Yes it possible, are you using an automated method to register the
    hosts ?
    you can just add the host (via templates) to the host group and
    that way any service check assigned to the group will be applied
    to the host in that group.








    _______________________________________________
    icinga-users mailing list
    icinga-users@lists.icinga.org <mailto:icinga-users@lists.icinga.org>
    https://lists.icinga.org/mailman/listinfo/icinga-users
    <https://lists.icinga.org/mailman/listinfo/icinga-users>

    _______________________________________________ icinga-users
    mailing list icinga-users@lists.icinga.org
    <mailto:icinga-users@lists.icinga.org>
    https://lists.icinga.org/mailman/listinfo/icinga-users
<https://lists.icinga.org/mailman/listinfo/icinga-users>
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to