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

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Jorrit
Posts: 2
Joined: Thu Dec 07, 2017 4:08 am

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

Post 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?
kyang

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

Post 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
Jorrit
Posts: 2
Joined: Thu Dec 07, 2017 4:08 am

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

Post 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.
kyang

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

Post by kyang »

You could file it as an enhancement if you would like?

Otherwise, using templates is still the only option.
Locked