SMP Check from host variable

Hello all,

I am currently trying an SMNP check.
Now I have stored my community string in a custom host variable.
Now I want to refer to this host variable string in my service template.

Unfortunately I have not found a way to access it here.

The whole thing runs under Icinga Web 2 Version
2.8.2, director 1.8.1.

Does anyone have a solution for me?

Thanks in advance

Hi and welcome,

you can use macros. e.g.
$host.vars.[field name]$

For more about custom vars look here: Monitoring Basics - Icinga 2

If this doesn’t solve your questions, please give us more information or show us (with screenshots e.g.) what you have now

Hey there,

tahnks for your reply and sorry for my late answer.

My requirement is to solve the whole thing via the director.

Unfortunately he dont 't translate the variable in services, as you can see in the screenshots below, actually in the service check.

Host configuration:
host

Service configuration:
service

Service check:
check

Thanks for your help.

This behaviour is correct :wink:

As @stevie-sy suggests, that is the correct result.
From my environment:
image

What you need to look for:
1.) Does $host.vars.snmp_string$ contain the right value or any value at all.
2.) Underneath the “Service” in Icinga, click the Inspect link to view the expanded command to make sure Icinga is executing the command and options you think it’s executing.
image