Page 1 of 1

Setting different $ARG1$ for hosts, based on group membershp

Posted: Thu Dec 07, 2017 7:13 am
by Jorrit
I'm trying to keep our definitions as centralized as possible, but for some host I need a bit of refinement in thresholds.

Situation: 400+ host, grouped/separated in host groups and host templates. Checks are grouped in services en and service tempates.
For 25 hosts, I need an ealier warning for disk space usage. (eg. default = warn@85% full, now warn@75%full)

I'm setting it up using custom variables.
It works, by defining a custom variable in the base host template (variable name: _DRIVETHRESHOLD, variable value: MaxWarnUsed=85%!MaxCritUsed=95%) and overriding the variable on the host. It's used in the service definition as $ARG1$ = $_HOSTDRIVETHRESHOLD$

But I was hoping I could override the variable in a more centralized way, based on a 'special' group membership and not per host.
Most simple solution would be by host group. But custom variables are not supported and are not planned to be supported for host groups.

I've tried creating an additional host template, with an updated the variable and added the group of hosts on the host template.
But that does not override the setting.

Any suggestions?

Re: Setting different $ARG1$ for hosts, based on group membe

Posted: Fri Dec 08, 2017 3:55 pm
by kyang
Custom variables are only supported for hosts, services, and contacts as you have mentioned.

Did it say somewhere that it wasn't going to be supported for host groups?

You could file this as a feature request on the Nagios Github for Core and see what the Core developer says.

https://github.com/NagiosEnterprises/nagioscore/issues

Re: Setting different $ARG1$ for hosts, based on group membe

Posted: Mon Dec 11, 2017 6:24 am
by Jorrit
kyang wrote:Did it say somewhere that it wasn't going to be supported for host groups?
You could file this as a feature request on the Nagios Github for Core and see what the Core developer says.
https://github.com/NagiosEnterprises/nagioscore/issues
It was kind of asked/proposed before in this topic, but the suggested solution was to use host templates.
But using a different host template, would need modification of all hosts. I was hoping to be able set the variable by 'just' placing hosts in a group.

Re: Setting different $ARG1$ for hosts, based on group membe

Posted: Mon Dec 11, 2017 5:24 pm
by kyang
You could file it as an enhancement if you would like?

Otherwise, using templates is still the only option.