Hi Stephane,
this is looking a bit wierd. I just checked my own setup and implemented your
thresholds, and it seems everything does exactly what you are intending it to
do, so there's some problem in a place you didn't look for it yet.
1. Could you please provice the *full* output of the following two commands:
icinga2 object list --type=host --name=test-target
2. What are you seeing in the "Performance Data" section for the host
"test-target" and its "ping4" and/or "ping6" service in Icinga Web 2? Are the
thresholds the ones you set (like in the below screenshot) for all two/three
(this probably won't work if you haven't enabled perfdata)?
Your command "icinga2 object list --type service" gives you the definition of
services, not the host object which is used for defining the thresholds for the
"hostalive" check command, so I expect the alarms you are seeing are for the
host itself (as a DOWN alert), not for the "ping4"/"ping6" service (as a
WARNING/CRITICAL alert), correct?
The output of your command querying the service object showing variables of
some (what?) service
> * vars
> * ping_cpl = 35
> % = modified in '/etc/icinga2/conf.d/services.conf', lines 51:6-51:23
> * ping_crta = 1050
> % = modified in '/etc/icinga2/conf.d/services.conf', lines 49:6-49:26
> * ping_wpl = 20
> % = modified in '/etc/icinga2/conf.d/services.conf', lines 50:6-50:23
> * ping_wrta = 750
> % = modified in '/etc/icinga2/conf.d/services.conf', lines 48:6-48:25
does not match the definition you provided for the host object according to
your last mail:
> object Host "test-target" {
> import "generic-host"
>
> vars.ping_wrta = 750
> vars.ping_crta = 1050
> vars.ping_wpl = 20
> vars.ping_cpl = 35
>
> address = "target.bortzmeyer.org"
> address6 = "target.bortzmeyer.org"
>
> }
which should result in variables on the host object, like these:
> icinga2 object list --type host --name test-target
> Object 'test-target' of type 'Host':
> [...]
> * vars
> [...]
> * ping_cpl = 35
> % = modified in '/etc/icinga2/zones.d/master/test-hosts.conf', lines
> 7:5-7:22
> * ping_crta = 1050
> % = modified in '/etc/icinga2/zones.d/master/test-hosts.conf', lines
> 5:5-5:25
> * ping_wpl = 20
> % = modified in '/etc/icinga2/zones.d/master/test-hosts.conf', lines
> 6:5-6:22
> * ping_wrta = 750
> % = modified in '/etc/icinga2/zones.d/master/test-hosts.conf', lines
> 4:5-4:24
> [...]
so I assume you did some changes to the configuration in the meantime.
Defining the variables for the service object will not affect the host object
and thus the 'hostalive' check, so there should be "DOWN" alerts for the
"test-target" host, but not for its "ping4"/"ping6" service (provided the
variables have actually been applied to the service, not the host).
Peter.
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users