Thanks for your help on this.

In case anyone want to know what I did.

I fixed this by removing the default ping4 command in services.conf,
then created two applys to replace:

Everyone gets the default check_ping4 unless in a remote vpn host group:

applys/check_ping4.conf

apply Service "check_ping4" to Host {
      import "generic-service"
  display_name = "Normal Ping Check"
  assign where host.address
  ignore where "remote-vpn-hosts" in host.groups
  check_command = "ping4"
}

If in the VPN host group
applys/check_high_latency_ping4.conf

apply Service "check_high_latency_ping4" to Host {
      import "generic-service"
  display_name = "High Latency Ping Check"
  assign where "remote-vpn-hosts" in host.groups
  ignore where host.name == "localhost"
  check_command = "ping4"
  vars.ping_wrta = "400"
  vars.ping_crta = "1200"
  vars.ping_wpl = "25"
  vars.ping_cpl = "45"
  vars.ping_packets = "5"
}


Seems to be working.

I might have an issue with hosts trying to use ping4 that are created
out of this process (switches, non-comuter hosts), trying to determine
that now.

This is of course all done via puppet configs.



On Sun, Nov 15, 2015 at 6:48 AM, Michael Friedrich
<michael.friedr...@netways.de> wrote:
>
>> On 12 Nov 2015, at 21:14, Lance Reed <reed.r.la...@gmail.com> wrote:
>>
>> I suspect my question has been answered multiple times in the past,
>> but I am not easily finding answers so here goes.
>>
>> I have multiple remote locations that use VPNs, so ping latency can
>> often go failure high and I get alerts on hosts and ping4 checks (the
>> default checks).
>>
>> We use multiple custom vars for things like location, and environment etc.
>> Because of this it was easy to setup in each hosts file created via
>> puppet to override hostalive.
>>
>> e.g.
>>
>> object Host "somehost.abcd.com" {
>>      import "generic-host"
>> ...
>>  vars.ping_wrta = "500"
>>  vars.environment = "abcd"
>>  vars.customer_monitored = "true"
>>  vars.customer = "abcd"
>>  vars.ping_cpl = "30"
>> }
>>
>>
>> That works well.  However the default service checks are using default
>> attributes for ping4 which are not modified.
>>
>> I am wondering what people use to override default values for existing
>> service checks that get applied.
>> Or do I have to modify what type of check gets used in my host object
>> and make sure the correct one is used much like hostalive.  I'd prefer
>> not to have any more Custom Vars added to each host object if
>> possible.
>
> I’d personally set these thresholds inside the service apply rules, and use 
> the assign where/ignore where expressions to selectively apply certain 
> services with different thresholds. Similar to what Thomas already posted.
>
> A different approach might also be to add conditionals inside your service 
> apply rules, for example:
>
> apply Service “ping4” {
>   check_command = “ping4”
>
>   if (host.vars.customer == “abcd”) {
>     vars.ping_cpl = 50
>   } else if (host.vars.customer == “efgh”) {
>     vars.ping_cl = 30
>   } else { //default
>     vars.ping_cpl = 40
>   }
>
>   assign where host.address
> }
>
> Service apply rules may access all host configuration attributes, so you’re 
> not bound to custom variables here. One could also match against the host 
> name, or its display_name.
>
> Kind regards,
> Michael
>
>
> --
> Michael Friedrich, DI (FH)
> Senior 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 | michael.friedr...@netways.de
>
> ** OSMC 2015 - November - netways.de/osmc **
> ** OSDC 2016 - April – netways.de/osdc **
> _______________________________________________
> icinga-users mailing list
> icinga-users@lists.icinga.org
> 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