Hey everyone,

I just started a couple of days ago to use Icinga 2. So far it looks
very promising, so a big thanks to the developers for this piece of
software!

For my setup I have to manage a lot of SNMP devices, and my idea was to
create a service / check command that looks at certain vars and then
decides if the query should go for SNMPv2c or v3. The default will be
v3, but nonetheless I'd like to specify on a per host basis, that SNMPv2
gets used.

What I don't seem to get working is a dynamic construct like this, and I
don't know why. Any hints are highly appreciated:

object CheckCommand "mySnmp" {
  if ( "$snmp_version$" == "2" ) {
      arguments += {
        "-P" = "2c"
      }
    } else {
      arguments += {
        "-P" = "3"
      }
  }
}

object Host "myHost" {
  import "myTemplate"
  address = "192.168.10.111"
  vars.is_virtual = true
  vars.snmp_version = "2"
}

It seems to me, that $snmp_version$ doesn't resolve but on the other
hand the else path is not taken?! Any ideas?

Thanks,
Stephan

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to