Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when creating trigger dependencies #38

Open
madhu-reddy opened this issue Jul 26, 2022 · 6 comments
Open

Issue when creating trigger dependencies #38

madhu-reddy opened this issue Jul 26, 2022 · 6 comments
Labels
waiting Waiting for answer

Comments

@madhu-reddy
Copy link

Terraform v0.13.7
+ provider registry.terraform.io/claranet/zabbix v0.4.0
+ provider registry.terraform.io/hashicorp/aws v2.70.1

Ran in to an issue when creating trigger dependencies, with the below error,

Terraform will perform the following actions:

  # zabbix_trigger.testing-unreachable will be updated in-place
  ~ resource "zabbix_trigger" "testing-unreachable" {
        dependencies = [
            "30934",
        ]
      ~ description  = "testing" -> "{HOST.NAME} is Unreachable !"
        expression   = "{HQ VPN:icmpping.max($,#3)}=0"
        id           = "31018"
        priority     = 0
        status       = 0
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

zabbix_trigger.testing-unreachable: Modifying... [id=31018]

Error: -32602 (Invalid params.): Invalid parameter "/1/expression": incorrect expression starting from "{HQ VPN:icmpping.max($,#3)}=0".

  on zabbix-trigger-dependencies.tf line 373, in resource "zabbix_trigger" "testing-unreachable":
 373: resource "zabbix_trigger" "testing-unreachable" {
@pdecat
Copy link
Member

pdecat commented Jul 27, 2022

Hi @madhu-reddy, do you manage to set that expression from the Zabbix UI?

If so, what is the plan like after that?

@pdecat pdecat added the waiting Waiting for answer label Jul 27, 2022
@madhu-reddy
Copy link
Author

Hi @pdecat ,

In the Zabbix UI (version: 5.4), the expression present "max(/HQ VPN/icmpping,#3)=0" already present, but not sure when I do an "terraform import trigger-id", it imported the expression with old syntax.

@pdecat
Copy link
Member

pdecat commented Jul 27, 2022

What does it do if you put max(/HQ VPN/icmpping,#3)=0 in the expression field in your terraform configuration file?

@madhu-reddy
Copy link
Author

If I do so, "terraform plan" does not throw any error, but when I do "terraform apply", I get below error,

Error: -32602 (Invalid params.): Invalid parameter "/1/expression": incorrect expression starting from "max(//HQ VPN/icmpping,#3)=0".
  on zabbix-trigger-dependencies.tf line 299, in resource "zabbix_trigger" "hq-vpn-host-unreachable":
 299: resource "zabbix_trigger" "hq-vpn-host-unreachable" {

@madhu-reddy
Copy link
Author

FYI, "terraform plan" output,

# zabbix_trigger.hq-vpn-host-unreachable will be updated in-place
  ~ resource "zabbix_trigger" "hq-vpn-host-unreachable" {
      ~ comment      = <<~EOT
         +         # testing
        EOT
        dependencies = [
            "30934",
        ]
        description  = "{HOST.NAME} is Unreachable !"
      ~ expression   = "{HQ VPN:icmpping.max($,#3)}=0" -> "max(/HQ VPN/icmpping,#3)=0"
        id           = "31012"
        priority     = 4
        status       = 0
    }

@pdecat
Copy link
Member

pdecat commented Oct 4, 2022

If I do so, "terraform plan" does not throw any error, but when I do "terraform apply", I get below error,

Error: -32602 (Invalid params.): Invalid parameter "/1/expression": incorrect expression starting from "max(//HQ VPN/icmpping,#3)=0".
  on zabbix-trigger-dependencies.tf line 299, in resource "zabbix_trigger" "hq-vpn-host-unreachable":
 299: resource "zabbix_trigger" "hq-vpn-host-unreachable" {

You have a suspicious duplicate / in that expression syntax:

max(//HQ VPN/icmpping,#3)=0

Instead of:

max(/HQ VPN/icmpping,#3)=0

Please double check your terraform configuration files 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting Waiting for answer
Projects
None yet
Development

No branches or pull requests

2 participants