Am 27.05.2015 um 13:11 schrieb Henti Smith:
Thank you all.

Got it sorted with much help from everybody here and IRC.

Working config is :

apply Dependency "dc-dep" to Host {
   parent_host_name = "gw.dc.domain.com <http://gw.dc.domain.com>"
   assign where match("*.dc.domain.com <http://dc.domain.com>",
host.name <http://host.name>)
   states = [ Up ]
   disable_checks = true
   disable_notifications = true
}

Just a tip for better readability top-down:

"
Apply object name to type

import templates
set object attributes

assign/ignore where type objects match
"

and now adopt your configuration similar to that. You brain will
certainly thank you for that when looking into the configuration again :)

Kind regards,
Michael




On Wed, May 27, 2015 at 12:40 PM, Michael Friedrich
<[email protected] <mailto:[email protected]>> wrote:

    Am 27.05.2015 um 09:12 schrieb Markus Joosten:

        That error is caused because a host does not have an "OK" state
        (that's
        a service state).
        Hosts have states such as up, down, unreachable (and maybe more
        that i
        can't remember right now).


    Only Up and Down. Unreachable isn't considered a state in Icinga 2 - and
    also does not make sense for dependencies where you'll render objects
    unreachable but don't filter based on that.



        Regards,
        Markus

        Sent from my iPhone

        On 27 May 2015, at 09:06, Henti Smith <[email protected]
        <mailto:[email protected]>
        <mailto:[email protected] <mailto:[email protected]>>> wrote:

            Hi Markus,

            I changed to :

            assign where match("*.int.domain.com <http://int.domain.com>
            <http://int.domain.com>",
            host.name <http://host.name> <http://host.name>)

            and now I get the following error with checkconfig

            critical/config: Error: Validation failed for Object
            'int-dep' (Type:
            'Dependency') at /etc/icinga2/conf.d/deps.d/network.conf:10:
            State
            filter is invalid for host dependency.

            Also, I used "==" based on examples in the docs
            
http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/object-types#objecttype-dependency

            I'm also using a
            
http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/icinga2-client#icinga2-client-configuration-local
            configuration where the clients configs are imported to the
            master,
            hence I'm trying to get the deps in place on the master.

            Regards
            Henti


            On Wed, May 27, 2015 at 8:51 AM, Henti Smith
            <[email protected] <mailto:[email protected]>
            <mailto:[email protected] <mailto:[email protected]>>>
            wrote:

                 Hi Markus,

                 Thanks. that would explain the warnings in the
            startup.log I just
                 found "'Dependency' does not match anywhere!"

                 Regards
                 Henti

                 On Wed, May 27, 2015 at 8:49 AM, Markus Joosten
                 <[email protected]
            <mailto:[email protected]>
            <mailto:[email protected]
            <mailto:[email protected]>>> wrote:

                     Wildcard matching is as far as i know not supported
            by ==.
                     You need to use the match() function, it's
            described in the docs.

                     Regards,
                     Markus

                     Sent from my iPhone

                     On 27 May 2015, at 08:20, Henti Smith
            <[email protected] <mailto:[email protected]>
                     <mailto:[email protected]
            <mailto:[email protected]>>> wrote:

                         Good day all.

                         I'm trying to get some dependencies in place
                for our monitoring.

                         We have a DC network and an Internal network at
                the office.
                         the networks are connected via two gateways.

                         All hosts in the DC network has dc.domain.com
                <http://dc.domain.com>
                         <http://dc.domain.com> suffix, while the
                internal network is
                int.domain.com <http://int.domain.com>
                <http://int.domain.com>.

                         The monitoring server is in the DC.

                         I've added the following config so all
                *.dc.domain.com <http://dc.domain.com>
                         <http://dc.domain.com> hosts depends on the parent
                gw.dc.domain.com <http://gw.dc.domain.com>
                <http://gw.dc.domain.com> and all
                         *.int.domain.com <http://int.domain.com>
                <http://int.domain.com> hosts depend on
                         parent gw.int.domain.com
                <http://gw.int.domain.com> <http://gw.int.domain.com>.

                         apply Dependency "dc-dep" to Host {
                           parent_host_name = "gw.dc.domain.com
                <http://gw.dc.domain.com>
                         <http://gw.dc.domain.com> "
                           assign where host.name <http://host.name>
                <http://host.name> ==
                         "*.dc.domain.com <http://dc.domain.com>
                <http://dc.domain.com>"
                           states = [ OK ]
                           disable_checks = true
                           disable_notifications = true
                         }

                         apply Dependency "int-dep" to Host {
                           parent_host_name = "gw.int.domain.com
                <http://gw.int.domain.com>
                         <http://gw.int.domain.com> "
                           assign where host.name <http://host.name>
                <http://host.name> ==
                         "*.int.domain.com <http://int.domain.com>
                <http://int.domain.com>"
                           states = [ OK ]
                           disable_checks = true
                           disable_notifications = true
                         }

                         My logic being that is the GW in INT is not
                accessible, I
                         don't want notifications from the hosts in INT.

                         Last night we had an outage, we received a DOWN
                notification
                         for gw.int.domain.com
                <http://gw.int.domain.com> <http://gw.int.domain.com>,
                but I also
                         received notifications for all the
                *.int.domain.com <http://int.domain.com>
                         <http://int.domain.com> hosts.

                         what am I missing ?

                         Regards
                         Henti

                         --
                         --
                         _______________________________________________

                         icinga-users mailing list

                [email protected]
                <mailto:[email protected]>
                <mailto:[email protected]
                <mailto:[email protected]>>

                https://lists.icinga.org/mailman/listinfo/icinga-users


                     _______________________________________________
                     icinga-users mailing list
            [email protected]
            <mailto:[email protected]>
                     <mailto:[email protected]
            <mailto:[email protected]>>
            https://lists.icinga.org/mailman/listinfo/icinga-users




                 --
                 --




            --
            --
            _______________________________________________

            icinga-users mailing list

            [email protected]
            <mailto:[email protected]>
            <mailto:[email protected]
            <mailto:[email protected]>>

            https://lists.icinga.org/mailman/listinfo/icinga-users



        _______________________________________________
        icinga-users mailing list
        [email protected] <mailto:[email protected]>
        https://lists.icinga.org/mailman/listinfo/icinga-users



    -- 
    Michael Friedrich, DI (FH)
    Application Developer

    NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
    Tel: +49 911 92885-0 <tel:%2B49%20911%2092885-0> | Fax: +49 911
    92885-77 <tel:%2B49%20911%2092885-77>
    GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
    http://www.netways.de | [email protected]
    <mailto:[email protected]>

    ** OSBConf 2015 - September - osbconf.org <http://osbconf.org> **
    ** OSMC 2015 - November - netways.de/osmc <http://netways.de/osmc> **

    _______________________________________________
    icinga-users mailing list
    [email protected] <mailto:[email protected]>
    https://lists.icinga.org/mailman/listinfo/icinga-users




--
--


_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users



-- 
Michael Friedrich, DI (FH)
Application Developer

NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
Tel: +49 911 92885-0 | Fax: +49 911 92885-77
GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
http://www.netways.de | [email protected]

** OSBConf 2015 - September - osbconf.org **
** OSMC 2015 - November - netways.de/osmc **
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to