Page 1 of 1

Issue with Free Variables through Service Templates/Groups

Posted: Thu Oct 28, 2021 7:52 am
by antdis
I am trying to use Service Groups and Service Templates to assign Free Variables to services and variables are not showing up. If I assign the Service Template directly to the service, the Free Variables show up, but not when the service is in a Service Group that has a Service Template with the Free Variables listed there. Here's an example of our setup:

Mem Check Major
CPU Check Major
Disk Check Major

Each has a service template assigned directly to the service with two Free Variables (_appid and _appname) called "default-template"

For each of these, I have a Service Group:
mem-major-sg
cpu-major-sg
disk-major-sg

Within each of these Service Groups is a Service Template named "major-template" with the following Free Variables:
_notify = True
_assignmentgroup = MajorGroup

When looking up the services or checking the free variables being sent when alerting, I only see the Free Variables from the template assigned directly to the services (default-template) and not the one assigned through the Service Groups (major-template). If I assign major-template directly to the service, I get the variables (which defeats the purpose of having it assigned through Service Groups).

We have this same setup for multiple thresholds and none of the Free Variables assigned through Service Templates attached to Service Groups make it to the Service inside the Service Group. I end up seeing:
_appid = AppValue
_appname = Name

With these missing:
_notify = True
_assignmentgroup = MajorGroup

We are on the latest version (5.8.6) of Nagios XI.

Re: Issue with Free Variables through Service Templates/Grou

Posted: Fri Oct 29, 2021 10:00 am
by benjaminsmith
Hi,

The best way to assign the template to the Service Group would be to use the Bulk Mods Tool. Go to Tools > Bulk Mods Tool > + Free Variable and choose the service group.
add-free-variables-groups.png
When you're creating a Service Template, the service group assignment is only going to add the service to the corresponding group, it's not going to pass along the other values in the template to all members of the service group.

Let me know if that helps or if you have any questions or comments.

--Benjamin